Weather data from .JSON API
2 views (last 30 days)
Show older comments
Hi,
Im trying to import the following weather data from an .JSON API. I have tried "webread" on the URL but I dont know how to extract the wheather data values as shown in the table in the bottom of this post.
URL:
https://bank.stat.gl:443/api/v1/da/Greenland/EN/EN30/ENX1SUM.px
JSON query:
{
"query": [
{
"code": "weather station",
"selection": {
"filter": "item",
"values": [
"5"
]
}
},
{
"code": "time",
"selection": {
"filter": "item",
"values": [
"0",
"1",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"2",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
]
}
}
],
"response": {
"format": "px"
}
}
and I expect the follow table to be imported as shown in the table which was generated on this homepage: https://bank.stat.gl/pxweb/da/Greenland/Greenland__EN__EN30/ENX1SUM.px/table/tableViewLayout1/

2 Comments
Rik
on 26 Apr 2023
Your URL doesn't seem to contain the data, but only the row/col headers:
data=webread('https://bank.stat.gl:443/api/v1/da/Greenland/EN/EN30/ENX1SUM.px')
data.variables{1}.valueTexts
data.variables{2}.valueTexts
Answers (0)
See Also
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!