OpenWeatherMap icon

OpenWeatherMap

Get weather data from OpenWeatherMap API

Overview

This node integrates with the OpenWeatherMap API to retrieve hourly weather forecasts for a specified city. It is useful for scenarios where users need detailed, hour-by-hour weather data such as planning outdoor events, managing logistics, or monitoring weather-sensitive operations.

For example, a user can input a city name and receive the next 24 hours of forecast data including temperature, precipitation, and other weather conditions. The node supports customization of units (standard, metric, imperial), language of the response, and the number of forecast hours returned (up to 96).

Properties

Name Meaning
City The name of the city for which to get the hourly forecast.
Additional Fields A collection of optional parameters:
- Units Units of measurement for the forecast data. Options: Standard, Metric, Imperial.
- Language Language for the response text. Options: English, French, German, Spanish, Vietnamese.
- Number of Hours Number of hours to return in the forecast (maximum 96). Defaults to 24.

Output

The node outputs JSON data containing the hourly weather forecast for the specified city. This includes an array of hourly entries with weather details such as temperature, humidity, wind speed, and conditions for each hour requested.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for OpenWeatherMap.
  • The node makes HTTP GET requests to the OpenWeatherMap API endpoint https://pro.openweathermap.org/data/2.5/forecast/hourly.
  • Proper configuration of the API key credential within n8n is necessary for authentication.

Troubleshooting

  • Common issues:
    • Invalid or missing API key will cause authentication errors.
    • Requesting more than 96 hours will likely result in an error or truncated data.
    • Incorrect city names may lead to empty or error responses from the API.
  • Error messages:
    • Authentication failures: Check that the API key credential is correctly set up and valid.
    • Rate limiting or quota exceeded: Ensure your OpenWeatherMap subscription plan supports the requested usage.
    • Invalid parameter values: Verify that units, language, and count values are within allowed options and ranges.

Links and References

Discussion