Update
This commit is contained in:
123
qweather.yml
123
qweather.yml
@@ -4,6 +4,7 @@ info:
|
|||||||
version: '1'
|
version: '1'
|
||||||
servers:
|
servers:
|
||||||
- url: https://devapi.qweather.com
|
- url: https://devapi.qweather.com
|
||||||
|
- url: https://geoapi.qweather.com
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
apiKey:
|
apiKey:
|
||||||
@@ -13,6 +14,121 @@ components:
|
|||||||
security:
|
security:
|
||||||
- apiKey: []
|
- apiKey: []
|
||||||
paths:
|
paths:
|
||||||
|
/v2/city/lookup:
|
||||||
|
get:
|
||||||
|
operationId: lookupCity
|
||||||
|
summary: 城市搜索
|
||||||
|
servers:
|
||||||
|
- url: https://geoapi.qweather.com
|
||||||
|
parameters:
|
||||||
|
- name: location
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
description: >
|
||||||
|
需要查询地区的名称,支持文字、以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位)、LocationID或Adcode(仅限中国城市)。
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
examples:
|
||||||
|
- 北京
|
||||||
|
- 116.41,39.92
|
||||||
|
- name: adm
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
description: 城市的上级行政区划,可设定只在某个行政区划范围内进行搜索,用于排除重名城市或对结果进行过滤。
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: beijing
|
||||||
|
- name: range
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
description: 搜索范围,可设定只在某个国家或地区范围内进行搜索,国家和地区名称需使用ISO 3166 所定义的国家代码。如果不设置此参数,搜索范围将在所有城市。
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: cn
|
||||||
|
- name: number
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
description: 返回结果的数量,取值范围1-20,默认返回10个结果。
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
default: 10
|
||||||
|
- name: lang
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
description: >
|
||||||
|
多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: zh
|
||||||
|
enum: ['zh', 'zh-hans', 'zh-hant']
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: 结果
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: string
|
||||||
|
example: '200'
|
||||||
|
location:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
example: '北京'
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
example: '101010100'
|
||||||
|
lat:
|
||||||
|
type: string
|
||||||
|
example: '39.90499'
|
||||||
|
lon:
|
||||||
|
type: string
|
||||||
|
example: '116.40529'
|
||||||
|
adm2:
|
||||||
|
type: string
|
||||||
|
example: '北京'
|
||||||
|
adm1:
|
||||||
|
type: string
|
||||||
|
example: '北京市'
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
example: '中国'
|
||||||
|
tz:
|
||||||
|
type: string
|
||||||
|
example: 'Asia/Shanghai'
|
||||||
|
utcOffset:
|
||||||
|
type: string
|
||||||
|
example: '+08:00'
|
||||||
|
isDst:
|
||||||
|
type: string
|
||||||
|
example: '0'
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
example: 'city'
|
||||||
|
rank:
|
||||||
|
type: string
|
||||||
|
example: '10'
|
||||||
|
fxLink:
|
||||||
|
type: string
|
||||||
|
example: 'https://www.qweather.com/weather/beijing-101010100.html'
|
||||||
|
refer:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
sources:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
example: 'QWeather'
|
||||||
|
license:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
example: 'QWeather Developers License'
|
||||||
/v7/weather/now:
|
/v7/weather/now:
|
||||||
get:
|
get:
|
||||||
operationId: getWeatherNow
|
operationId: getWeatherNow
|
||||||
@@ -25,9 +141,12 @@ paths:
|
|||||||
required: true
|
required: true
|
||||||
description: >
|
description: >
|
||||||
需要查询地区的LocationID或以英文逗号分隔的经度, 纬度坐标(十进制,最多支持小数点后两位)。
|
需要查询地区的LocationID或以英文逗号分隔的经度, 纬度坐标(十进制,最多支持小数点后两位)。
|
||||||
LocationID可通过GeoAPI获取。例如:location=101010100 或 location=116.41,39.92
|
LocationID可通过GeoAPI获取(即城市搜索)。
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
examples:
|
||||||
|
- 北京
|
||||||
|
- 116.41,39.92
|
||||||
- name: lang
|
- name: lang
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
@@ -35,6 +154,8 @@ paths:
|
|||||||
多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
|
多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
default: zh
|
||||||
|
enum: ['zh', 'zh-hans', 'zh-hant']
|
||||||
- name: unit
|
- name: unit
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
Reference in New Issue
Block a user