Live weather forecasters(실시간 날씨 예보관)

Live weather forecasters(실시간 날씨 예보관) · GPT アクション

Weather API

This API provides current weather information for a specified location.

  • GET /weatherGet current weather information.

    Returns the current weather conditions for a specified city or geographical coordinates.

元の API スキーマ
{
  "openapi": "3.1.0",
  "info": {
    "title": "Weather API",
    "description": "This API provides current weather information for a specified location.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.weather.com/v1",
      "description": "Production server"
    }
  ],
  "paths": {
    "/weather": {
      "get": {
        "operationId": "getCurrentWeather",
        "summary": "Get current weather information.",
        "description": "Returns the current weather conditions for a specified city or geographical coordinates.",
        "parameters": [
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "The name of the city for which to retrieve weather information. Either `city` or (`lat`, `lon`) must be provided.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "Latitude of the location. Required if `city` is not provided.",
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "description": "Longitude of the location. Required if `city` is not provided.",
            "schema": {
              "type": "number",
              "format": "float"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON object containing the current weather information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "temperature": {
                      "type": "number",
                      "format": "float",
                      "description": "Current temperature in Celsius."
                    },
                    "humidity": {
                      "type": "integer",
                      "description": "Current humidity percentage."
                    },
                    "weatherCondition": {
                      "type": "string",
                      "description": "Description of the current weather (e.g., sunny, cloudy, etc.)."
                    },
                    "windSpeed": {
                      "type": "number",
                      "format": "float",
                      "description": "Current wind speed in meters per second."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters. Ensure that either `city` or both `lat` and `lon` are provided."
          },
          "404": {
            "description": "City not found. Check the city name or coordinates and try again."
          },
          "500": {
            "description": "Internal server error. Something went wrong on the server side."
          }
        }
      }
    }
  }
}