Fun with Weather

Fun with Weather · GPT Actions

Weather Data Service

Provides weather data for a specified location.

  • POST /getWeatherfetchWeatherData

    Fetches weather data for a specific location based on latitude and longitude

原始 API 定义
{
  "openapi": "3.1.0",
  "info": {
    "title": "Weather Data Service",
    "description": "Provides weather data for a specified location.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://weather-gpt-communicato.replit.app"
    }
  ],
  "paths": {
    "/getWeather": {
      "post": {
        "description": "Fetches weather data for a specific location based on latitude and longitude",
        "operationId": "fetchWeatherData",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number",
                    "description": "Latitude of the location"
                  },
                  "lon": {
                    "type": "number",
                    "description": "Longitude of the location"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Weather data response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lat": {
                      "type": "number",
                      "description": "Latitude of the location, decimal (-90; 90)"
                    },
                    "lon": {
                      "type": "number",
                      "description": "Longitude of the location, decimal (-180; 180)"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone name for the requested location"
                    },
                    "timezone_offset": {
                      "type": "integer",
                      "description": "Shift in seconds from UTC"
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "dt": {
                          "type": "integer",
                          "description": "Current time, Unix, UTC"
                        },
                        "sunrise": {
                          "type": "integer",
                          "description": "Sunrise time, Unix, UTC"
                        },
                        "sunset": {
                          "type": "integer",
                          "description": "Sunset time, Unix, UTC"
                        },
                        "temp": {
                          "type": "number",
                          "description": "Temperature"
                        },
                        "feels_like": {
                          "type": "number",
                          "description": "Temperature accounting for human perception"
                        },
                        "pressure": {
                          "type": "integer",
                          "description": "Atmospheric pressure on the sea level, hPa"
                        },
                        "humidity": {
                          "type": "integer",
                          "description": "Humidity, %"
                        },
                        "dew_point": {
                          "type": "number",
                          "description": "Atmospheric temperature below which water droplets begin to condense and dew can form"
                        },
                        "uvi": {
                          "type": "number",
                          "description": "Current UV index"
                        },
                        "clouds": {
                          "type": "integer",
                          "description": "Cloudiness, %"
                        },
                        "visibility": {
                          "type": "integer",
                          "description": "Average visibility, meters"
                        },
                        "wind_speed": {
                          "type": "number",
                          "description": "Wind speed"
                        },
                        "wind_deg": {
                          "type": "integer",
                          "description": "Wind direction, degrees (meteorological)"
                        },
                        "weather": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "description": "Weather condition id"
                              },
                              "main": {
                                "type": "string",
                                "description": "Group of weather parameters (Rain, Snow etc.)"
                              },
                              "description": {
                                "type": "string",
                                "description": "Weather condition within the group"
                              },
                              "icon": {
                                "type": "string",
                                "description": "Weather icon id"
                              }
                            }
                          },
                          "description": "Current weather data API response"
                        },
                        "daily": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "dt": {
                                "type": "integer",
                                "description": "Time of the forecasted data, Unix, UTC"
                              },
                              "sunrise": {
                                "type": "integer",
                                "description": "Sunrise time, Unix, UTC"
                              },
                              "sunset": {
                                "type": "integer",
                                "description": "Sunset time, Unix, UTC"
                              },
                              "moonrise": {
                                "type": "integer",
                                "description": "The time of when the moon rises for this day, Unix, UTC"
                              },
                              "moonset": {
                                "type": "integer",
                                "description": "The time of when the moon sets for this day, Unix, UTC"
                              },
                              "moon_phase": {
                                "type": "number",
                                "description": "Moon phase"
                              },
                              "summary": {
                                "type": "string",
                                "description": "Human-readable description of the weather conditions for the day"
                              },
                              "temp": {
                                "type": "object",
                                "properties": {
                                  "day": {
                                    "type": "number",
                                    "description": "Day temperature"
                                  },
                                  "min": {
                                    "type": "number",
                                    "description": "Min daily temperature"
                                  },
                                  "max": {
                                    "type": "number",
                                    "description": "Max daily temperature"
                                  },
                                  "night": {
                                    "type": "number",
                                    "description": "Night temperature"
                                  },
                                  "eve": {
                                    "type": "number",
                                    "description": "Evening temperature"
                                  },
                                  "morn": {
                                    "type": "number",
                                    "description": "Morning temperature"
                                  }
                                },
                                "description": "Temperature data"
                              },
                              "feels_like": {
                                "type": "object",
                                "properties": {
                                  "day": {
                                    "type": "number",
                                    "description": "Day temperature accounting for human perception"
                                  },
                                  "night": {
                                    "type": "number",
                                    "description": "Night temperature accounting for human perception"
                                  },
                                  "eve": {
                                    "type": "number",
                                    "description": "Evening temperature accounting for human perception"
                                  },
                                  "morn": {
                                    "type": "number",
                                    "description": "Morning temperature accounting for human perception"
                                  }
                                },
                                "description": "Feels-like temperature data"
                              },
                              "pressure": {
                                "type": "integer",
                                "description": "Atmospheric pressure on the sea level, hPa"
                              },
                              "humidity": {
                                "type": "integer",
                                "description": "Humidity, %"
                              },
                              "dew_point": {
                                "type": "number",
                                "description": "Atmospheric temperature below which water droplets begin to condense and dew can form"
                              },
                              "wind_speed": {
                                "type": "number",
                                "description": "Wind speed"
                              },
                              "wind_deg": {
                                "type": "integer",
                                "description": "Wind direction, degrees (meteorological)"
                              },
                              "wind_gust": {
                                "type": "number",
                                "description": "Wind gust speed"
                              },
                              "weather": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "description": "Weather condition id"
                                    },
                                    "main": {
                                      "type": "string",
                                      "description": "Group of weather parameters (Rain, Snow etc.)"
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "Weather condition within the group"
                                    },
                                    "icon": {
                                      "type": "string",
                                      "description": "Weather icon id"
                                    }
                                  }
                                },
                                "description": "Daily weather forecast data"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}