How to call the web API on a node
So far, we've learned what a RESTful API is and which node is appropriate for an API call.
In this part, let's create a flow that actually calls the API from Node-RED and learn how to call the API and how to handle the result value from the API.
There are a few things to think about first, such as which API to call. Fortunately, various APIs are published on the internet.
This time, I would like to use the OpenWeatherMap API. In OpenWeatherMap, for example, the following APIs for data acquisition are prepared:
- Current weather data
- Hourly forecast 4 days
- Daily forecast 16 days
- Climatic forecast 30 days
- Weather alerts
- And more...
For more information, please see the official website of OpenWeatherMap: https://openweathermap.org/.
Okay, let's prepare to use the OpenWeatherMap API.
Creating an account
To use the OpenWeatherMap API, we need to create an account. Please access the following...