# 天气预报

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/weather/forecast:
    get:
      summary: 天气预报
      deprecated: false
      description: 天气数据来源于腾讯天气
      tags:
        - 🍱 实用功能
      parameters:
        - name: query
          in: query
          description: 待查询地区
          required: false
          example: 雨花台
          schema:
            type: string
        - name: days
          in: query
          description: 最大支持 8 天
          required: false
          example: '7'
          schema:
            type: string
        - name: encoding
          in: query
          description: 编码方式，支持 text/json/markdown
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      location:
                        type: object
                        properties:
                          name:
                            type: string
                          province:
                            type: string
                          city:
                            type: string
                          county:
                            type: string
                        required:
                          - name
                          - province
                          - city
                          - county
                        x-apifox-orders:
                          - name
                          - province
                          - city
                          - county
                      hourly_forecast:
                        type: array
                        items:
                          type: object
                          properties:
                            datetime:
                              type: string
                            temperature:
                              type: integer
                            condition:
                              type: string
                            condition_code:
                              type: string
                            wind_direction:
                              type: string
                            wind_power:
                              type: string
                            weather_icon:
                              type: string
                          required:
                            - datetime
                            - temperature
                            - condition
                            - condition_code
                            - wind_direction
                            - wind_power
                            - weather_icon
                          x-apifox-orders:
                            - datetime
                            - temperature
                            - condition
                            - condition_code
                            - wind_direction
                            - wind_power
                            - weather_icon
                      daily_forecast:
                        type: array
                        items:
                          type: object
                          properties:
                            date:
                              type: string
                            day_condition:
                              type: string
                            day_condition_code:
                              type: string
                            night_condition:
                              type: string
                            night_condition_code:
                              type: string
                            max_temperature:
                              type: integer
                            min_temperature:
                              type: integer
                            day_wind_direction:
                              type: string
                            day_wind_power:
                              type: string
                            night_wind_direction:
                              type: string
                            night_wind_power:
                              type: string
                            aqi:
                              type: integer
                            aqi_level:
                              type: integer
                            air_quality:
                              type: string
                            day_weather_icon:
                              type: string
                            night_weather_icon:
                              type: string
                          required:
                            - date
                            - day_condition
                            - day_condition_code
                            - night_condition
                            - night_condition_code
                            - max_temperature
                            - min_temperature
                            - day_wind_direction
                            - day_wind_power
                            - night_wind_direction
                            - night_wind_power
                            - aqi
                            - aqi_level
                            - air_quality
                            - day_weather_icon
                            - night_weather_icon
                          x-apifox-orders:
                            - date
                            - day_condition
                            - day_condition_code
                            - night_condition
                            - night_condition_code
                            - max_temperature
                            - min_temperature
                            - day_wind_direction
                            - day_wind_power
                            - night_wind_direction
                            - night_wind_power
                            - aqi
                            - aqi_level
                            - air_quality
                            - day_weather_icon
                            - night_weather_icon
                      sunrise_sunset:
                        type: array
                        items:
                          type: object
                          properties:
                            sunrise:
                              type: string
                            sunrise_at:
                              type: integer
                            sunrise_desc:
                              type: string
                            sunset:
                              type: string
                            sunset_at:
                              type: integer
                            sunset_desc:
                              type: string
                          required:
                            - sunrise
                            - sunrise_at
                            - sunrise_desc
                            - sunset
                            - sunset_at
                            - sunset_desc
                          x-apifox-orders:
                            - sunrise
                            - sunrise_at
                            - sunrise_desc
                            - sunset
                            - sunset_at
                            - sunset_desc
                    required:
                      - location
                      - hourly_forecast
                      - daily_forecast
                      - sunrise_sunset
                    x-apifox-orders:
                      - location
                      - hourly_forecast
                      - daily_forecast
                      - sunrise_sunset
                required:
                  - code
                  - message
                  - data
                x-apifox-orders:
                  - code
                  - message
                  - data
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 🍱 实用功能
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5757303/apis/api-337500335-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://60s.viki.moe
    description: 正式环境
security: []

```
