Puzzled by returned data

  • 2
  • Problem
  • Updated 6 years ago
When I request

...conditions/q/EBAW.json

I get

"station_id":"IANTWERP1",

However, when I request

...conditions/q/Belgium/Antwerp.json

I do get

"station_id":"EBAW",

Can someone explain why this happens and what I can do to avoid this issue? Also, to what degree can I expect the selected weather station to remain stable over time for a certain location query?
Photo of fvu

fvu

  • 5 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 2
Photo of vancew

vancew

  • 9 Posts
  • 0 Reply Likes
don't you have to use the pws:STATION_ID to get specific station data? Otherwise it appears to me that you are given the most recent (or perhaps the first available) station data.

Use the geolookup to find all of the stations in the area you want, then use the pws:station_id to go through each of them. They have gps coords among other useful details, and obviously weather.

So your request would be something like....
...conditions/q/pws:EBAW.json

Good Luck
Photo of fvu

fvu

  • 5 Posts
  • 0 Reply Likes
@vancew my interpretation of the API specs is that pws is just a settings flags that allows or forbids the return of pws information.


pws 0 or 1 Default: 1 (true). Use personal weather stations for conditions.


The station is coded after the q URL element - and my point here is that despite the fact that my question is for a known airport station (EBAW) I get another station returned, whereas if I query via the neighboring city name, that specific airport station is returned. Ie, despite a specific query for known data, other data are returned, which is not what I want.