Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

query for codes

Matthew Pollicove Mar 21, 2019 09:44PM GMT

Hi there,

I'm wondering if there's a way to query for a code via the API. Say I want to find New York, NY, can I send a query and have it return the code back so I can use it in my application?

Thanks,
Matt

Up 0 rated Down
Pavel Zuykov Mar 22, 2019 08:28AM GMT OpenWeatherMap Agent

Hello Matt,

You can make request by city name https://openweathermap.org/current#name And in the response you will get city ID https://openweathermap.org/current#current_JSON (field “id”)

Also you can make your own search engine using our city ID list file: http://bulk.openweathermap.org/sample/city.list.json.gz

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete