# Query Data from influxdb via HTTP GET method

**URL:** <https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676>\
**Category:** General\
**Created:** [21 January 2020 11:18 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676 "2020-01-21T11:18:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user2929](https://avatars.discourse-cdn.com/v4/letter/u/ac8455/32.png) [@user2929](https://discourse.nodered.org/u/user2929)\
**Post date:** [21 January 2020 11:18 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676/1 "2020-01-21T11:18:02Z")

</div>

Hello there everyone,

I am rather new to Node-Red, so please bear with me.

What I have:  
I´ve got a Node-Red Flow working on a Unipi Neuron M503, which logs sensor values every second to an influxdb measurement table. This works fine via the standard contrib-influxdb nodes.

What I want to do:  
I want to extract the data as a csv file in more or less reoccuring intervals. This can be done manually with a button click, preferably by selecting a start time and just extracting the data till "now".

Problem:  
When I use the the builtin contrib-influxdb node, the data is all stored in RAM an my Unipi freezes.

Prefered solution:  
As I have read in the influxdb documentation, there is an option to read data in chunks of e.g. 20k measurements and write it to the csv file. This I have implemented via a curL command and am able to create csv files through ssh-connection.

This is an example curL command:

```auto
curl -G 'http://localhost:8086/query?u=admin&p=password' --data-urlencode "db=mydatabase" --data-urlencode "chunked=true" --data-urlencode "chunk_size=20000" --data-urlencode "q=SELECT * FROM rawvalues WHERE time > now() - 100d AND time <= now()" -H "Accept: application/csv" > /media/usb/unipi75-100d.txt

```

I would like to get this working with a HTTP Request node, but I am having trouble understanding the right syntax. I already googled several days, tried to understand some examples and also tried the Node-Red cookbook, but I am simply out of my depth.

Any help would be greatly appreciated.

Thank you in advance,  
Daniel

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 January 2020 11:41 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676/2 "2020-01-21T11:41:20Z")

</div>

In case you did not realise, you could run the curl command in an exec node.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 January 2020 14:59 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676/3 "2020-01-21T14:59:07Z")

</div>

Yes, that will be the best way since the data shouldn't have to flow through Node-RED at all.

---

<div class="post-metadata">

**Author:** ![user2929](https://avatars.discourse-cdn.com/v4/letter/u/ac8455/32.png) [@user2929](https://discourse.nodered.org/u/user2929)\
**Post date:** [22 January 2020 17:15 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676/4 "2020-01-22T17:15:46Z")

</div>

But... but guys... this would be way to easy. Pls give me the overly complicated version...

Just kidding. Many thanks. Works like a charm.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 January 2020 20:04 UTC](https://discourse.nodered.org/t/query-data-from-influxdb-via-http-get-method/20676/5 "2020-01-22T20:04:06Z")

</div>

Your wish ....

Node-RED calls a Python command that calls a shell script to call PowerShell that uses .net/mono C# library to run the same command.

That what you are looking for? 🤣
