How do I exclude personal weather stations?

  • 2
  • Question
  • Updated 5 years ago
I want to exclude personal weather stations from my current conditions query. Essentially I want to enter a zip code and have it return the conditions from the nearest "official" weather station (typically an airport).

Photo of Globe199


  • 14 Posts
  • 1 Reply Like

Posted 6 years ago

  • 2
Photo of juanbond


  • 20 Posts
  • 8 Reply Likes
Doesn't look like there's an API feature to handle this... However, if you just want to get conditions for the nearest airport station, it is simple enough to do this on the developer's side:

1. Request "geolookup" for the zip
2. From the response, grab one of the airport codes (icao element) from location->nearby_weather_stations->airport->station
3. Request "conditions" for the airport code found in step 2.
Photo of Globe199


  • 14 Posts
  • 1 Reply Like
Thanks for the tip. I got it to work by modifying what you suggested. I got the first ICAO with this php code:


Accessing the [0] array element took me a minute to figure out; I'm not that well-versed in JSON syntax.

My next task is to get my iphone's current location with the Geolocation API and integrate it with this weather API. Should be fun.
Photo of moshen


  • 7 Posts
  • 1 Reply Like
I really suggest there be an API to do this automatically w/a query.
Photo of MarkusR


  • 4 Posts
  • 0 Reply Likes
From "Keepsailing 7 months ago"

Just to let you other guys know, it is now implmented, with an option /pws:0 to exclude personal weather stations.
It works like a charm.