I am trying to use the open weather map API where I simply have an input field where I want to send to the API a city name in order to retrieve some data.
Following the documentation, I cannot find any specific topic where you can just insert the city name as a query parameter, but rather you'd have to send the lattitude and longitude of the desired city.
Does anyone know if I can just simply somehow construct a url with the provided city name , rather than using the coordinates ?
More details can be found for the api here: https://openweathermap.org/.
I am trying something like this: https://api.openweathermap.org/data/2.5/direct?q={city.name}&appid={secret_key}
But if I want to retrieve data for 2 hour forecast or 2 days it returns an 40x error.