This is the first part in a series where I will query and parse the SMHI (Sveriges meteorologiska och hydrologiska institut) API for weather data. This will be a short post where I just work in the Chrome dev tools. I also created a repo to put snippets and code that I use in this series.
When we query the API we get a list of parameters that will look something like this:
And the value in the values array will correspond to a symbol/meaning. We can find the meaning of this in a table. But we need it in our code. We could just write it by hand and it would be done quickly, but what is the fun in that? This is how the table and its markup looks:
Looks easy enough, but there are more tables on the page so we will have to make sure we get the correct table when querying. The table happens to be the last in the list so this should be easy.
Now we have a neat object that we can use to know what symbol we should use when we parse the API.
Hope this at least was somewhat interesting. This series is most likely what I will continue to write next.