OpenWeatherMap City wrong (by 20+ miles)

Tayschrenn

Young grasshopper
Aug 20, 2019
57
16
Michigan, USA
Good evening,
Due to the death of Wunderground's API (I haven't bought a weatherstation to get a new key) I tried out the built in OpenWeathMap, and to my delight when I first used it, the results were very positive.

However less than a month later, I'm now getting a significantly different city reporting via the API. I double checked my Lat/Long (which was not changed and was correct before) and it is the same/correct.

Anyone know how to troubleshoot this?
 
I'm now getting a significantly different city reporting via the API. I double checked my Lat/Long (which was not changed and was correct before) and it is the same/correct. Anyone know how to troubleshoot this?

I don't think this can be fixed.

According to ChatGPT, OpenWeatherMap maintains a proprietary city/location database. Each location is assigned a unique city ID (id) and includes name, state, country, and sometimes bounding box data. Reverse geocoding (e.g., lat/lon → city name) is inferred using this internal dataset.

You can test this using OpenWeatherMap's forward geocoding API (name → lat/lon) and a limited reverse geocoding API:

API:
https://api.openweathermap.org/geo/1.0/reverse?lat={lat}&lon={lon}&limit={n}&appid={API key}

This API returns an array of nearby cities or locations, with name, local_names, lat, lon, country, and sometimes state.

For more details on the API, see
https://openweathermap.org/api/geocoding-api

If entering your lat,lon in this URL returns an array of more than one element, then maybe your preferred city name is included in the array, which you could isolate programmatically. If Blue Iris is using this API, it is probably requesting only 1 result (&limit=1) (or grabbing the first element). Ken might be able to provide an option to use an element other than 0, if it exists.
 
Last edited: