Using an Application Programming Interface (API) for live data
An API allows two computers to talk to each other. When you check the weather or access services, you’re using an API. In a sense, it’s a messenger; it sends a message to a service, such as the weather service, saying that you are requesting data and what the data that you’re requesting is, and then it is returned to you. The API key is the code that gets sent to identify who you are (whether a user or a developer) and it sends the requested information to you if the key is correct. This often is based on the type of account you hold with the API provider.
We’ll be setting up a free account to access an API for weather data. This next activity will take us through the process step by step.
Activity 7.7 – Connecting to an API
In this activity, we’ll use the ESP32 to request the weather data relevant to our specific predetermined locations, using an API for live data. We...