Support Center

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

weather by city name accent

Romain Mar 13, 2019 03:45PM GMT

Hi,

i am using the forecast api for French cities with the "by city name" request.
example : http://api.openweathermap.org/data/2.5/forecast?q=[nameCity],fr&APPID=[id]&lang=fr&units=metric

It works fine excepted for the following cases :

Cities with accent :
the city must contains the accent in the request.
http://api.openweathermap.org/data/2.5/forecast?q=Velléches,fr&APPID=[id] --> Works
http://api.openweathermap.org/data/2.5/forecast?q=Velleches,fr&APPID=[id]--> doesn't Works

Cities with dash :
the cities must contains the dash in the request.
http://api.openweathermap.org/data/2.5/forecast?q=la roche-posay,fr&APPID=[id] --> Works
http://api.openweathermap.org/data/2.5/forecast?q=la roche posay,fr&APPID=[id] --> doesn't Works

why do we have to send the request with the accent and the dash characters ?
The users often write the city name without them.
So how could we proceed to avoid this problem ?

Up 0 rated Down
diwaker Mar 15, 2019 07:16PM GMT
open
Up 0 rated Down
Pavel Zuykov Mar 17, 2019 05:44PM GMT OpenWeatherMap Agent

Hello,

Our city database working on exact match now. So, dashes and accents may be must for some cities.

You can also use requests by city ID, converting them from your own database.

List of city IDs you can find here: 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