AI
产品服务
解决方案
文档与支持
定价
更新时间: 2026/03/20 16:09
海外天气查询
下载开发文档
接口说明

用户可通过行政区划代码查询实时天气信息及未来7天天气预报。

API服务地址

https://api.map.baidu.com/weather_abroad/v1/?district_id=JPN10041030001&data_type=all&ak=你的ak
//GET请求

请求参数
参数名数据类型必选默认值描述信息

district_id

string

海外城市行政区划编码海外城市行政区划编码为自定义,只支持海外天气查询服务使用),和location二选一

location

double

经纬度,经度在前纬度在后,逗号分隔。支持类型:bd09mc/bd09ll/wgs84/gcj02。

ak

string

开发者密钥,可在API控制台申请获得

data_type

string

请求数据类型。数据类型有:now/fc/index/alert/fc_hour/all,控制返回内容

output

string

json

返回格式,目前支持json/xml

language

string

cn

语言类型。语言类型有: cn/en,分别表示中文和英文, 默认中文。目前仅支持行政区划显示英文。

coordtype

string

wgs84

支持类型:wgs84/bd09ll/bd09mc/gcj02

注意:如果district_id和location同时传,默认以district_id为准;

返回参数
参数名参数类型描述信息返回条件异常值

address

Object

地理位置信息

-

-

country

String

国家名称

始终返回

-

province

String

省份名称

始终返回

-

city

String

城市名称

始终返回

-

name

String

区县名称

始终返回

-

id

String

区县id

始终返回

-

now

Object

实况数据

-

-

temp

Int

温度(℃)

始终返回

999999

feels_like

Int

体感温度(℃)

data_type=now/all

999999

rh

Int

相对湿度(%)

data_type=now/all

999999

wind_class

String

风力等级

data_type=now/all

暂无

wind_dir

String

风向描述

data_type=now/all

暂无

text

String

天气现象

data_type=now/all

暂无

prec_1h

Double

1小时累计降水量(mm)

data_type=now/all

999999

clouds

Int

云量(%)

data_type=now/all

999999

vis

Int

能见度(m)

data_type=now/all

999999

uptime

String

数据更新时间,当地时间

data_type=now/all

-

forecasts

ObjectArray

预报数据

-

-

date

String

日期,当地时间

data_type=fc/all

-

week

String

星期,当地时间

data_type=fc/all

-

high

Int

最高温度(℃)

data_type=fc/all

999999

low

Int

最低温度(℃)

data_type=fc/all

999999

wc_day

String

白天风力

data_type=fc/all

"暂无"

wc_night

String

晚上风力

data_type=fc/all

"暂无"

wd_day

String

白天风向

data_type=fc/all

"暂无"

wd_night

String

晚上风向

data_type=fc/all

"暂无"

text_day

String

白天天气现象

data_type=fc/all

"暂无"

text_night

String

晚上天气现象

data_type=fc/all

"暂无"

wind_angle

Int

风向角度(°)

data_type=now/all 且 user_type=vip

999999

uvi

Int

紫外线指数

data_type=now/all 且 user_type=vip

999999

pressure

Int

气压(hPa)

data_type=now/all 且 user_type=vip

999999

dpt

Int

露点温度(℃)

data_type=now/all 且 user_type=vip

999999

未来24小时逐小时预报返回参数

参数名参数类型描述信息返回条件异常值

forecast_hours

Object Array

预报数据

-

-

text

String

天气现象

data_type=fc_hour/all

"暂无"

temp_fc

Int

温度(℃)

data_type=fc_hour/all

999999

wind_class

String

风力等级

data_type=fc_hour/all

"暂无"

wind_dir

String

风向描述

data_type=fc_hour/all

"暂无"

rh

Int

相对湿度

data_type=fc_hour/all

999999

prec_1h

Double

1小时累计降水量(mm)

data_type=fc_hour/all

999999

clouds

Int

云量(%)

data_type=fc_hour/all

999999

data_time

String

数据时间

data_type=fc_hour/all

999999

wind_angle

Int

风向角度(°)

data_type=fc_hour/all 且 user_type=vip

999999

pop

Int

降水概率(%)

data_type=fc_hour/all 且 user_type=vip

999999

uvi

Int

紫外线指数

data_type=fc_hour/all 且 user_type=vip

999999

pressure

Int

气压(hPa)

data_type=fc_hour/all 且 user_type=vip

999999

dpt

Int

露点温度(℃)

data_type=fc_hour/all 且 user_type=vip

999999

服务状态码
返回码定义常见原因

200

返回成功

服务请求正常召回

400

请求失败

请求参数不合法,请按照返回提示修改参数

401

未鉴权

ak不合法或者账号未开通相应权限

403

禁止

未开通白名单,请前往反馈工单联系我们。

503

服务不可用

服务异常,请前往反馈工单联系我们。

500

内部服务错误

服务异常,请前往反馈工单联系我们。

上一篇

国内天气查询

下一篇

国内经纬度天气查询

本篇文章对您是否有帮助?