# How to read CSV from open data URL?

**URL:** <https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147>\
**Category:** General\
**Created:** [15 March 2020 17:46 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147 "2020-03-15T17:46:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![firedude144](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@firedude144](https://discourse.nodered.org/u/firedude144)\
**Post date:** [15 March 2020 17:46 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/1 "2020-03-15T17:46:46Z")

</div>

Noobish question here. I'm trying to read some open data CSV files online to be able to parse it into a graph but I'm not catching on to what I need to do to actually get at the data behind the URL. Here's a [sample URL](https://www.donneesquebec.ca/recherche/fr/dataset/857d007a-f195-434b-bc00-7012a6244a90/resource/16f55019-f05d-4375-a064-b75bce60543d/download/pf-mun-2019-2019.csv).

I've tried HTTP IN and HTTP GET but they just stare at me blankly and say "What?"...actually, they don't say anything. Should I download the file first then parse? If so, how?

Cheers

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 March 2020 17:55 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/2 "2020-03-15T17:55:13Z")

</div>

Seems to be pretty neat.. but you need the http-request node... (to request data 🙂  
here is a simple flow to get you going

```auto
[{"id":"fd65e1f6.44d72","type":"inject","z":"3ead5d77.6a6672","name":"","topic":"","payload":"\"17\",\"N\",,,\"a:0:{}\",\"\",\"Janek\",\"Kowalski\"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":1240,"wires":[["4960a405.20c31c"]]},{"id":"4960a405.20c31c","type":"http request","z":"3ead5d77.6a6672","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"https://www.donneesquebec.ca/recherche/fr/dataset/857d007a-f195-434b-bc00-7012a6244a90/resource/16f55019-f05d-4375-a064-b75bce60543d/download/pf-mun-2019-2019.csv","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":1240,"wires":[["8978ea5e.b77d18"]]},{"id":"8978ea5e.b77d18","type":"csv","z":"3ead5d77.6a6672","name":"","sep":",","hdrin":true,"hdrout":"","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"x":530,"y":1240,"wires":[["49a5a87c.278e48"]]},{"id":"49a5a87c.278e48","type":"debug","z":"3ead5d77.6a6672","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":1240,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![firedude144](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@firedude144](https://discourse.nodered.org/u/firedude144)\
**Post date:** [15 March 2020 18:09 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/3 "2020-03-15T18:09:55Z")

</div>

That was quick! Been spinning my wheels all day trying to figure that out. Thanks for the push!

---

<div class="post-metadata">

**Author:** ![firedude144](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@firedude144](https://discourse.nodered.org/u/firedude144)\
**Post date:** [15 March 2020 20:10 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/4 "2020-03-15T20:10:31Z")

</div>

I get can the data in debug but I don't think it is what the chart node is expecting. The chart shows up blank.

```auto
[{"id":"300c2f1f.e165e","type":"inject","z":"32556e66.f0c022","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":320,"wires":[["d26871e7.693cd"]]},{"id":"d26871e7.693cd","type":"http request","z":"32556e66.f0c022","name":"Get COVID data","method":"GET","ret":"txt","paytoqs":false,"url":"https://covid.ourworldindata.org/data/total_cases.csv","tls":"","persist":false,"proxy":"","authType":"","x":300,"y":320,"wires":[["19ef5c8.f4157a4"]]},{"id":"19ef5c8.f4157a4","type":"csv","z":"32556e66.f0c022","name":"","sep":",","hdrin":true,"hdrout":true,"multi":"one","ret":"\\n","temp":"date,World,Afghanistan,Albania,Algeria,Andorra,Antigua and Barbuda,Argentina,Armenia,Australia,Austria,Azerbaijan,Bahrain,Bangladesh,Belarus,Belgium,Bhutan,Bolivia,Bosnia and Herzegovina,Brazil,Brunei,Bulgaria,Burkina Faso,Cambodia,Cameroon,Canada,Cayman Islands,Chile,China,Colombia,Costa Rica,Cote d'Ivoire,Croatia,Cuba,Cyprus,Czech Republic,Democratic Republic of Congo,Denmark,Dominican Republic,Ecuador,Egypt,Estonia,Ethiopia,Faeroe Islands,Finland,France,French Guiana,French Polynesia,Gabon,Georgia,Germany,Ghana,Gibraltar,Greece,Guadeloupe,Guernsey,Guinea,Guyana,Honduras,Hungary,Iceland,India,Indonesia,International,Iran,Iraq,Ireland,Israel,Italy,Jamaica,Japan,Jersey,Jordan,Kenya,Kuwait,Latvia,Lebanon,Liechtenstein,Lithuania,Luxembourg,Macedonia,Malaysia,Maldives,Malta,Martinique,Mexico,Moldova,Monaco,Mongolia,Morocco,Nepal,Netherlands,New Zealand,Nigeria,Norway,Oman,Pakistan,Palestine,Panama,Paraguay,Peru,Philippines,Poland,Portugal,Puerto Rico,Qatar,Reunion,Romania,Russia,Saint Barthlemy,Saint Martin (French part),Saint Vincent and the Grenadines,San Marino,Saudi Arabia,Senegal,Serbia,Singapore,Slovakia,Slovenia,South Africa,South Korea,Spain,Sri Lanka,Sudan,Sweden,Switzerland,Thailand,Togo,Trinidad and Tobago,Tunisia,Turkey,Ukraine,United Arab Emirates,United Kingdom,United States,Vatican,Venezuela,Vietnam","skip":"0","strings":true,"x":490,"y":320,"wires":[["d6750951.024458","377a982.29e0c68"]]},{"id":"377a982.29e0c68","type":"ui_chart","z":"32556e66.f0c022","name":"","group":"1c71c025.cb23e","order":0,"width":0,"height":0,"label":"chart","chartType":"horizontalBar","legend":"true","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"20000","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":690,"y":300,"wires":[[]]},{"id":"d6750951.024458","type":"debug","z":"32556e66.f0c022","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":360,"wires":[]},{"id":"1c71c025.cb23e","type":"ui_group","z":"","name":"Default","tab":"fae1f75a.b6a308","disp":true,"width":"6","collapse":false},{"id":"fae1f75a.b6a308","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 March 2020 22:35 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/5 "2020-03-15T22:35:33Z")

</div>

Well there is lots of data there - you need to extract something and work out what you want to plot on what sort of chart.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 May 2020 22:35 UTC](https://discourse.nodered.org/t/how-to-read-csv-from-open-data-url/23147/6 "2020-05-14T22:35:35Z")

</div>

Closed on 14 May 2020 22:35 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
