D黑奴背锅 文档中心
公共 OpenAPI天气
GET/openapi/v1/get_weather

根据地点编码或城市名称查询实时天气。

注意事项

  • 推荐先调用地点搜索获取 code,再将 code 作为 location 传入。
  • 也支持城市中文名或英文名。

调用额度

  • 每分钟:60
  • 每日:1000
  • 每月:30000
  • 单次消耗:3

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

location*string

推荐传地点搜索返回的 code,如 440300。

Response Body

application/json

curl -X GET "https://example.com/openapi/v1/get_weather?location=string"
{  "code": 0,  "message": "天气获取成功",  "data": {    "city": "北京",    "text": "晴",    "temperature": "26",    "codeIcon": "https://api.dibinos.cn/resource/WeatherIcon/0@1x.png"  },  "time": 1779502528}