Search all guides

Reference · Tools

OpenWeatherMap integration

Get current weather data and 5-day forecasts from the OpenWeatherMap API by city name, city ID, coordinates, or zip code.

Action Utility v1

The OpenWeatherMap node fetches current conditions or a 5-day forecast, locating the place by city name, city ID, coordinates or zip code. A typical build is checking tomorrow's forecast each evening and alerting a field team when conditions would stop work.

Works as
Action
Tool name
open_weather_map
Operations
2 — Current Weather , 5 Day Forecast
Parameters
10
Outputs
Output, Error
Credentials
OpenWeatherMap API
Official docs
OpenWeatherMap docs openweathermap.org

What you can build with OpenWeatherMap

  • Get current weather for London.
  • Get 5-day forecast for New York by coordinates.
  • Get weather in Berlin using zip code in metric units.
  • Get current temperature in Tokyo in Fahrenheit.
  • Get 5-day weather forecast for a city ID.

Overview

OpenWeatherMap provides weather data for any location worldwide. This tool retrieves current weather conditions or 5-day/3-hour forecasts via the OpenWeatherMap API v2.5 (https://api.openweathermap.org/data/2.5). It supports four location selection methods: city name (e.g., “berlin,de”), city ID (from the OpenWeatherMap bulk data), geographic coordinates (latitude/longitude), or zip/postal code (e.g., “10115,de”). Results can be returned in metric (Celsius, m/s), imperial (Fahrenheit, mph), or scientific (Kelvin, m/s) units. An optional language parameter controls the output language for weather descriptions. Authentication is via an API key.

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires OpenWeatherMap API credentials. See the Credentials Guide for setup instructions.

Operations

OperationValueDescription
Current WeathercurrentWeatherReturns the current weather data
5 Day Forecast5DayForecastReturns the weather data for the next 5 days (3-hour intervals)

Parameters

Both operations take the same parameters — the operation only selects which OpenWeatherMap endpoint is queried. Which location field you fill in is decided by Location Selection, not by the operation.

ParameterTypeRequiredDefaultDescription
FormatoptionsNometricThe unit format for the returned data.
Options: imperial (Fahrenheit | miles/hour), metric (Celsius | meter/sec), standard (Kelvin | meter/sec — shown as “Scientific”)
Location SelectionoptionsNocityNameHow to define the location for which to return the weather.
Options: cityName, cityId, coordinates, zipCode
CitystringYes—The name of the city to return the weather of. Optionally include country code (e.g., “london,uk”). Supports expressions. (shown when Location Selection is cityName)
City IDnumberYes160001123The ID of the city to return the weather of. City ID list can be downloaded from http://bulk.openweathermap.org/sample/. (shown when Location Selection is cityId)
LatitudestringYes—The latitude of the location to return the weather of. Supports expressions. (shown when Location Selection is coordinates)
LongitudestringYes—The longitude of the location to return the weather of. Supports expressions. (shown when Location Selection is coordinates)
Zip CodestringYes—The zip/postal code to return the weather of. Optionally include country code (e.g., “10115,de”). Supports expressions. (shown when Location Selection is zipCode)
LanguagestringNo—The two-letter language code to get your output in (e.g., en, de, fr, es, it, pt, ru, ja, zh_cn).
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

The OpenWeatherMap API response is merged onto the input item JSON — the incoming fields pass through unchanged, and binary data is forwarded. Weather values (temperature, humidity, wind, and so on) are reported in the units selected by Format.

How many output items you get depends on the operation:

OperationOutput
currentWeatherOne output item per input item — the current-conditions response merged onto the item.
5DayForecastFans out: one output item per forecast entry in the response’s list (3-hour steps over 5 days). Each entry carries a city property holding the response’s city block, so the location details are available on every item.

Because a forecast turns one input item into many, index-based pairing with the upstream node no longer holds downstream — put any field you need to match on onto the input item and it will still be present on every forecast entry.

Example Configuration

Current weather by city name, in Celsius:

{
  "type": "open_weather_map",
  "parameters": {
    "operation": "currentWeather",
    "locationSelection": "cityName",
    "cityName": "London,UK",
    "format": "metric",
    "language": "en"
  }
}

5-day forecast by coordinates coming from the incoming item, in Fahrenheit:

{
  "type": "open_weather_map",
  "parameters": {
    "operation": "5DayForecast",
    "locationSelection": "coordinates",
    "latitude": "{{ $json.lat }}",
    "longitude": "{{ $json.lon }}",
    "format": "imperial"
  }
}

Current weather by city ID, with German descriptions and Kelvin units:

{
  "type": "open_weather_map",
  "parameters": {
    "operation": "currentWeather",
    "locationSelection": "cityId",
    "cityId": 2643743,
    "format": "standard",
    "language": "de"
  }
}

Weather by postal code, throttled for a large batch of items:

{
  "type": "open_weather_map",
  "parameters": {
    "operation": "currentWeather",
    "locationSelection": "zipCode",
    "zipCode": "{{ $json.postcode }},de",
    "format": "metric",
    "language": "de",
    "maxConcurrency": 5
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

This tool retrieves current weather or 5-day forecasts from the OpenWeatherMap service for a specified location. It is ideal when you need weather information by city name, coordinates, city ID, or zip code, offering a direct alternative to other general information tools. The tool produces either the current weather data or a 5-day forecast with 3-hour intervals.

Important Notes

  • Always ensure the location parameter matches the locationSelection value
  • When using coordinates, both latitude and longitude must be provided as strings
  • City names can include country codes for better accuracy (e.g., “Paris,FR”)
  • Language codes should be standard two-letter ISO codes
  • City IDs are numeric values, not strings

Frequently asked questions

Why is my location not resolving?

The location parameter must match the Location Selection you chose. Supplying a city name while the selection is set to coordinates is the usual cause of a failed lookup.

How do I use coordinates?

Provide both latitude and longitude, as strings. One without the other cannot resolve a location.

How do I disambiguate a common city name?

Include the country code — for example `Paris,FR` — which is far more reliable than the bare name for cities that exist in several countries.

What format do city IDs and language codes take?

City IDs are numeric values rather than strings, and language codes are standard two-letter ISO codes.

Build with OpenWeatherMap

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need OpenWeatherMap API credentials first.

Open BusyBot

Last reviewed . Spotted something wrong? Tell us.