Implementing a City Search feature
Let’s commence the development of our first feature – City Search. Users will be able to enter a city name into a search box, which triggers a request to a remote server. Upon receiving the data, we’ll render it into a list for user selection. Throughout this chapter, we’ll utilize the OpenWeatherMap API for city searches as well as retrieving weather information.
Introducing the OpenWeatherMap API
OpenWeatherMap is a service that offers global weather data via an API, allowing users to access current, forecasted, and historical weather data for any location worldwide. It’s a popular choice among developers for embedding real-time weather updates into apps and websites.
We’re going to use two APIs in our weather application – one for searching the city by name and another for getting the actual real-time weather. To use the API, you’ll need the API key you received when following the...