How do I bring data from an influxdb from another server

I have a server (X) with influxdb, which contains records from the inverter.
On an RPI4 I have HA with influxdb installed. I want to display on HA (installed on RPI4) the records from the X server and plotting the graphs with apexcharts-card. So far, I have not been able to connect to Influxdb from the X server.
With GRAFANA installed on HA, I can see all the records on the X server.
Please advice…