OpenWeatherMap Get Current Forecasts
2 credits/call
ae_openweathermap_get_current_forecasts
Get OpenWeatherMap weather data for specified coordinates, including current conditions, a one-hour minute forecast, a 48-hour hourly forecast, an eight-day daily forecast, and government weather alerts. You can exclude selected data sections and choose standard, metric, or imperial units.
2 credits/call
Pricing
2 credits/call
| Condition | Charge |
|---|---|
| Each call | 2 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
lat | number | Yes | Latitude, decimal (-90; 90) | — |
lon | number | Yes | Longitude, decimal (-180; 180) | — |
lang | string | No | You can use the lang parameter to get the output in your language. | — |
units | enum (standard | metric | imperial) | No | Units of measurement. standard, metric and imperial units are available. If you do not use the units parameter, standard units will be applied by default. | standard |
exclude | enum (current | minutely | hourly | daily | alerts) | No | By using this parameter you can exclude some parts of the weather data from the API response. It should be a comma-delimited list (without spaces). Available values: current, minutely, hourly, daily, alerts | — |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeyRequest coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_openweathermap_get_current_forecasts' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"exclude": "hourly",
"lat": 31.2323437,
"lon": 121.4691024,
"units": "metric"
}
}'Response exampleresponse.json
{
"current": {
"clouds": 27,
"dew_point": 20.04,
"dt": 1790065082,
"feels_like": 28.74,
"humidity": 65,
"pressure": 1014
},
"daily": [
{
"clouds": 61,
"dew_point": 16.96,
"dt": 1790046000,
"feels_like": {
"day": 30.87,
"eve": 28.86,
"morn": 24.15,
"night": 25.47
},
"humidity": 53,
"moon_phase": 0.35
}
],
"lat": 31.2323,
"lon": 121.4691,
"minutely": [
{
"dt": 1790065140,
"precipitation": 0
}
],
"timezone": "Asia/Shanghai"
}This example shows part of the response. Copied content is valid JSON.


