Weather data from .JSON API
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Rik
2023-4-26
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Weather and Atmospheric Science 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!