OpenWeatherMap Get Current Weather
1 credits/call
ae_openweathermap_get_current_weather
Get current weather conditions from OpenWeatherMap using latitude and longitude. City or postal-code locations must first be converted to coordinates, and results can use standard, metric, or imperial units in JSON, XML, or HTML format.
1 credits/call
Pricing
1 credits/call
| Condition | Charge |
|---|---|
| Each call | 1 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
lat | number | Yes | Required latitude of the location in decimal degrees. Resolve a city or area name with openweathermap_get_directgeocoding before calling this operation. | — |
lon | number | Yes | Required longitude of the location in decimal degrees. Resolve a city or area name with openweathermap_get_directgeocoding before calling this operation. | — |
lang | string | No | You can use this parameter to get the output in your language. | — |
mode | enum (xml | html) | No | Response format. Possible values are 'xml' and 'html'. If you don't use the mode parameter format is JSON by default. | — |
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 |
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_weather' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"lat": 35.68,
"lon": 139.65,
"units": "metric"
}
}'Response exampleresponse.json
{
"base": "stations",
"clouds": {
"all": 20
},
"cod": 200,
"coord": {
"lat": 35.68,
"lon": 139.65
},
"id": 1862143,
"name": "Horinouchi"
}This example shows part of the response. Copied content is valid JSON.


