Weather Forecast
Weather Forecast · GPT Actions
OpenWeatherMap Current Weather Data API
API for retrieving current weather data from OpenWeatherMap.
GET /weatherGet Current WeatherRetrieves the current weather for a specified location.
原始 API 定义
{
"openapi": "3.0.0",
"info": {
"title": "OpenWeatherMap Current Weather Data API",
"version": "1.0.0",
"description": "API for retrieving current weather data from OpenWeatherMap."
},
"servers": [
{
"url": "https://api.openweathermap.org/data/2.5"
}
],
"paths": {
"/weather": {
"get": {
"operationId": "getCurrentWeather",
"summary": "Get Current Weather",
"description": "Retrieves the current weather for a specified location.",
"parameters": [
{
"name": "q",
"in": "query",
"description": "City name, state code and country code divided by comma.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "appid",
"in": "query",
"description": "578091bcd908a1db5f664a35b215a0c3",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coord": {
"type": "object",
"properties": {
"lon": {
"type": "number"
},
"lat": {
"type": "number"
}
}
},
"weather": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"main": {
"type": "string"
},
"description": {
"type": "string"
},
"icon": {
"type": "string"
}
}
}
},
"main": {
"type": "object",
"properties": {
"temp": {
"type": "number"
},
"pressure": {
"type": "number"
},
"humidity": {
"type": "number"
}
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}