OpenWeather API
Overview
Section titled “Overview”The OpenWeather API provides access to current weather data, forecasts, and historical weather data for any location worldwide. With the integration in SquadOS, your agents can query current weather, get 5-day forecasts, check air quality, UV index, manage personal weather stations, and fetch real-time weather map tiles.
- Official website: https://openweathermap.org/
- Composio documentation: docs.composio.dev/toolkits/openweather_api
Authentication
Section titled “Authentication”This tool uses API key (API_KEY) to connect.
You will need the following fields:
| Field | Required | Description |
|---|---|---|
api_key | Yes | API key generated in the OpenWeatherMap dashboard under Account → My API Keys. |
How to get credentials
Section titled “How to get credentials”- Go to home.openweathermap.org/users/sign_up and create a free account.
- Confirm your email to activate API access.
- Log in and navigate to home.openweathermap.org/api_keys.
- Copy the pre-generated
Defaultkey or click Generate to create a new key with a descriptive name. - Wait a few minutes for the key to be activated — requests with a newly created key may return
401during the first few minutes.
How to connect in SquadOS
Section titled “How to connect in SquadOS”- Go to Tools in the side menu (
/admin/tools). - Open the Available tab and search for
OpenWeather API. - Click the card to open the details and hit Connect.
- You’re taken to the secure connection page hosted by Composio, where you enter the API key obtained above.
- Once done, you’re sent back to SquadOS with the account connected and the tool available for your agents. (Connection-flow details in Organization Tools.)
Available actions
Section titled “Available actions”Delete Weather Station
Section titled “Delete Weather Station”OPENWEATHER_API_DELETE_WEATHER_STATION
Tool to delete a registered weather station. Use after identifying a station to remove. Returns confirmation message upon success.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
station_id | string | Yes | The unique ID of the weather station to delete. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get 5 Day Forecast
Section titled “Get 5 Day Forecast”OPENWEATHER_API_GET5_DAY_FORECAST
Tool to get a 5-day forecast every 3 hours (up to 40 UTC timestamps). Exactly one location identifier required per call: q, id, zip, or lat+lon pair. Use city.timezone offset to convert timestamps to local time before grouping into daily summaries.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
q | string | No | City name and optional country code, e.g. London,uk. |
id | integer | No | OpenWeatherMap city ID. |
lat | number | No | Latitude in degrees. |
lon | number | No | Longitude in degrees. |
zip | string | No | Zip code with country code, e.g. 94040,us. |
lang | string | No | Language code (ISO 639-1). |
mode | string (json | xml | html) | No | Response format. |
units | string (standard | metric | imperial) | No | Units of measurement (standard, metric, imperial). |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Current Air Pollution Data
Section titled “Get Current Air Pollution Data”OPENWEATHER_API_GET_AIR_POLLUTION_CURRENT
Tool to fetch current air pollution data for a location. Use when you need real-time air quality details by latitude and longitude.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Latitude of the location, between -90 and 90. |
lon | number | Yes | Longitude of the location, between -180 and 180. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Air Pollution Forecast
Section titled “Get Air Pollution Forecast”OPENWEATHER_API_GET_AIR_POLLUTION_FORECAST
Tool to get forecasted air pollution data for a specific location. Use after confirming latitude and longitude. Forecast availability may be limited for remote or oceanic coordinates; verify response timestamps to confirm returned data represents a true forecast rather than a current snapshot.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Geographical latitude in decimal degrees (range -90 to 90). |
lon | number | Yes | Geographical longitude in decimal degrees (range -180 to 180). |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Air Pollution History
Section titled “Get Air Pollution History”OPENWEATHER_API_GET_AIR_POLLUTION_HISTORY
Tool to retrieve historical air pollution data. Use when you need past air quality levels for a specific latitude/longitude and time range.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
end | integer | Yes | End UNIX timestamp (UTC seconds); must be >= start. |
lat | number | Yes | Latitude of the location (range: -90 to 90). |
lon | number | Yes | Longitude of the location (range: -180 to 180). |
start | integer | Yes | Start UNIX timestamp (UTC seconds); must be <= end. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Circle City Weather
Section titled “Get Circle City Weather”OPENWEATHER_API_GET_CIRCLE_CITY_WEATHER
Tool to search for current weather data in cities around a geographic point. Use when you need to fetch weather within a radius circle after confirming latitude and longitude.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
cnt | integer | No | Number of cities to return within the circle (1–50). Default is 10. |
lat | number | Yes | Latitude of the circle center in degrees (-90 to 90). |
lon | number | Yes | Longitude of the circle center in degrees (-180 to 180). |
lang | string | No | Language of the response (ISO 639-1). |
mode | string (json | xml) | No | Response format: json or xml. |
units | string (standard | metric | imperial) | No | Units of measurement: standard, metric, or imperial. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Current Weather
Section titled “Get Current Weather”OPENWEATHER_API_GET_CURRENT_WEATHER
Tool to retrieve current weather data for a location. Use when you need up-to-the-minute weather info. Exactly one location identifier must be provided per call: either q, id, zip, or the pair lat+lon. Passing multiple identifiers causes errors or ambiguous matches.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
q | string | No | City name, state code and country code, e.g., London,uk. |
id | integer | No | City ID, e.g., 2172797. |
lat | number | No | Geographic coordinate latitude, e.g., 35.0. |
lon | number | No | Geographic coordinate longitude, e.g., 139.0. |
zip | string | No | Zip code and country code, e.g., 94040,us. |
lang | string | No | Language for the response (ISO 639-1 code, e.g., en). |
units | string (standard | metric | imperial) | No | Units of measurement. standard (default), metric, or imperial. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Geocoding by Zip Code
Section titled “Get Geocoding by Zip Code”OPENWEATHER_API_GET_GEOCODING_BY_ZIP
Tool to convert zip/post code into geographic coordinates. Use when you need latitude and longitude for a specific postal code.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
zip | string | Yes | Zip/post code and country code divided by comma. Use ISO 3166 country codes (e.g., 10001,US or E14,GB). |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Direct Geocoding
Section titled “Get Direct Geocoding”OPENWEATHER_API_GET_GEOCODING_DIRECT
Tool to convert a location name into geographic coordinates. Use when you need latitude and longitude for a given location after confirming the precise name.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Location query including city name, state code and country code separated by commas (e.g., London,UK). Ambiguous queries can return multiple mismatched locations; use the full three-part format city,state_code,country_code (e.g., Springfield,IL,US) and verify the returned country/region before using coordinates downstream. |
limit | integer | No | Number of results to return (1 to 5). Defaults to 5. Use 1 only for unambiguous locations; for ambiguous queries review all returned results to select the correct match. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Reverse Geocoding
Section titled “Get Reverse Geocoding”OPENWEATHER_API_GET_GEOCODING_REVERSE
Tool to convert geographic coordinates into a location name. Use when you need city, state, and country info from latitude and longitude.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Latitude of the location in decimal degrees. |
lon | number | Yes | Longitude of the location in decimal degrees. |
limit | integer | No | Number of results to return (1 to 5). |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Station Measurements
Section titled “Get Station Measurements”OPENWEATHER_API_GET_STATION_MEASUREMENTS
Tool to retrieve aggregated measurements from a weather station with minute, hour, or day granularity. Use when you need historical weather data from a specific registered station.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
to | integer | Yes | End of time interval (Unix timestamp in seconds). |
from | integer | Yes | Start of time interval (Unix timestamp in seconds). |
type | string (m | h | d) | Yes | Aggregation type: m (minute), h (hour), or d (day). |
limit | integer | Yes | Maximum number of measurement records to return. |
station_id | string | Yes | Internal station ID from OpenWeather. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Current UV Index
Section titled “Get Current UV Index”OPENWEATHER_API_GET_UV_INDEX
Tool to retrieve current UV index for a location. Use when you need up-to-the-minute UV index by latitude and longitude.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Latitude of the location, between -90 and 90. |
lon | number | Yes | Longitude of the location, between -180 and 180. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get UV Index Forecast
Section titled “Get UV Index Forecast”OPENWEATHER_API_GET_UV_INDEX_FORECAST
Tool to retrieve UV index forecast for a specific location. Use when you need upcoming UV index values after confirming latitude and longitude. Returns up to 8 days of data. Data may be sparse or absent for ocean and remote locations; an empty response means no data available, not safe UV conditions.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
cnt | integer | No | Number of days to return (1-8); defaults to 8 if not specified. |
lat | number | Yes | Latitude of the location, between -90 and 90. |
lon | number | Yes | Longitude of the location, between -180 and 180. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get UV Index History
Section titled “Get UV Index History”OPENWEATHER_API_GET_UV_INDEX_HISTORY
Tool to retrieve historical UV index data for a specified location and time range. Use when you need to analyze past UV exposure trends after confirming coordinates and time period.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
end | integer | Yes | End UNIX timestamp (UTC seconds); must be >= start. |
lat | number | Yes | Latitude of the location (range: -90 to 90). |
lon | number | Yes | Longitude of the location (range: -180 to 180). |
start | integer | Yes | Start UNIX timestamp (UTC seconds); must be <= end. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Weather Map Tile (2.0)
Section titled “Get Weather Map Tile (2.0)”OPENWEATHER_API_GET_WEATHER_MAP_TILE
Tool to fetch Weather Maps 2.0 tile images. Use when you need dynamic weather layers at specific zoom and coordinates with advanced styling options.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
x | integer | Yes | Tile X coordinate (non-negative integer). |
y | integer | Yes | Tile Y coordinate (non-negative integer). |
z | integer | Yes | Zoom level of the tile (non-negative integer). |
fill | string | No | Color for empty-data fill areas (hex or named). |
color | string | No | Color schema of the tiles, e.g., original, black. |
layer | string (clouds | clouds_new | precipitation | precipitation_new | pressure | pressure_new | wind | wind_new | temp | temp_new) | Yes | Weather layer name. Options: clouds, clouds_new, precipitation, precipitation_new, pressure, pressure_new, wind, wind_new, temp, temp_new. |
scale | integer (1 | 2) | No | Tile scale factor: 1 or 2 for retina. |
format | string | No | Image format; only png is supported. |
opacity | number | No | Tile opacity value between 0.0 and 1.0. |
palette | string | No | Custom palette definition (comma-separated or JSON). |
fill_bound | boolean | No | Fill tiles outside data coverage if true. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Weather Station
Section titled “Get Weather Station”OPENWEATHER_API_GET_WEATHER_STATION
Tool to get information about a specific weather station by its ID. Use when you need details about a particular station.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
station_id | string | Yes | Internal station ID to retrieve information for. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Weather Stations
Section titled “Get Weather Stations”OPENWEATHER_API_GET_WEATHER_STATIONS
Tool to list all weather stations added to your account. Use after setting up your OpenWeather API key.
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Get Weather Triggers
Section titled “Get Weather Triggers”OPENWEATHER_API_GET_WEATHER_TRIGGERS
Tool to retrieve weather triggers for specific conditions. Use after defining trigger criteria.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
triggers | array | Yes | List of weather trigger definitions. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Add Weather Station
Section titled “Add Weather Station”OPENWEATHER_API_POST_ADD_WEATHER_STATION
Tool to add a new weather station to your account. Use when you need to register a station before sending custom data.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Station name. |
altitude | number | Yes | Station altitude in meters above sea level. |
latitude | number | Yes | Station latitude, range -90 to 90 degrees. |
longitude | number | Yes | Station longitude, range -180 to 180 degrees. |
external_id | string | Yes | External station ID (your own reference). |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Submit Station Measurements
Section titled “Submit Station Measurements”OPENWEATHER_API_POST_SUBMIT_STATION_MEASUREMENTS
Tool to submit weather measurements from a registered station. Use when you need to send temperature, wind, pressure, humidity, or precipitation data for a station.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
measurements | array | Yes | Array of measurement objects to submit. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |
Update Weather Station
Section titled “Update Weather Station”OPENWEATHER_API_UPDATE_WEATHER_STATION
Tool to update weather station details. Use when you need to modify the name, location, or external ID of an existing station.
Input parameters
Section titled “Input parameters”| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | Human-readable name for the station. |
altitude | number | No | Altitude of the station above sea level in meters. |
latitude | number | Yes | Latitude of the station in degrees, between -90 and 90. |
longitude | number | Yes | Longitude of the station in degrees, between -180 and 180. |
station_id | string | Yes | Unique identifier of the weather station to update. |
external_id | string | No | Custom user-provided external identifier for the station. |
Output
Section titled “Output”| Name | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Data from the action execution. |
error | string | No | Error message if execution failed. |
successful | boolean | Yes | Whether the action executed successfully. |