# 实时天气

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/weather:
    get:
      summary: 实时天气
      deprecated: false
      description: 天气数据来源于腾讯天气
      tags:
        - 🍱 实用功能
      parameters:
        - name: query
          in: query
          description: 待查询地区
          required: false
          example: 雨花台
          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
                      weather:
                        type: object
                        properties:
                          condition:
                            type: string
                          condition_code:
                            type: string
                          temperature:
                            type: integer
                          humidity:
                            type: integer
                          pressure:
                            type: integer
                          precipitation:
                            type: integer
                          wind_direction:
                            type: string
                          wind_power:
                            type: string
                          weather_icon:
                            type: string
                          weather_colors:
                            type: array
                            items:
                              type: string
                          updated:
                            type: string
                          updated_at:
                            type: integer
                        required:
                          - condition
                          - condition_code
                          - temperature
                          - humidity
                          - pressure
                          - precipitation
                          - wind_direction
                          - wind_power
                          - weather_icon
                          - weather_colors
                          - updated
                          - updated_at
                      air_quality:
                        type: object
                        properties:
                          aqi:
                            type: integer
                          level:
                            type: integer
                          quality:
                            type: string
                          pm25:
                            type: integer
                          pm10:
                            type: integer
                          co:
                            type: number
                          no2:
                            type: integer
                          o3:
                            type: integer
                          so2:
                            type: integer
                          rank:
                            type: integer
                          total_cities:
                            type: integer
                          updated:
                            type: string
                          updated_at:
                            type: integer
                        required:
                          - aqi
                          - level
                          - quality
                          - pm25
                          - pm10
                          - co
                          - no2
                          - o3
                          - so2
                          - rank
                          - total_cities
                          - updated
                          - updated_at
                      sunrise:
                        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
                      life_indices:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            name:
                              type: string
                            level:
                              type: string
                            description:
                              type: string
                          required:
                            - key
                            - name
                            - level
                            - description
                      alerts:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            level:
                              type: string
                            level_code:
                              type: string
                            province:
                              type: string
                            city:
                              type: string
                            county:
                              type: string
                            detail:
                              type: string
                            updated:
                              type: string
                            updated_at:
                              type: integer
                    required:
                      - location
                      - weather
                      - air_quality
                      - sunrise
                      - life_indices
                      - alerts
                required:
                  - 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-337491677-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://60s.viki.moe
    description: 正式环境
security: []

```
