你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Weather - Get Quarter Day Forecast
使用 获取未来 1 天、5 天、10 天或 15 天的 Quarter-Day 预测。
API Get Quarter-Day Forecast
是一个 HTTP GET
请求,用于返回给定位置未来 1、5、10 或 15 天的四分之一天的详细天气预报。 响应数据按一天中的季度(上午、下午、晚上和夜间)显示。 返回温度、湿度、风、降水和紫外线指数等详细信息。
GET https://atlas.microsoft.com/weather/forecast/quarterDay/json?api-version=1.1&query={query}
GET https://atlas.microsoft.com/weather/forecast/quarterDay/json?api-version=1.1&query={query}&unit={unit}&duration={duration}&language={language}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
format
|
path | True |
响应的所需格式。 仅支持 |
|
api-version
|
query | True |
string |
Azure Maps API 的版本号。 |
query
|
query | True |
number[] |
指定为逗号分隔字符串的适用查询,该字符串由纬度后跟经度组成,例如“47.641268,-122.125679”。 |
duration
|
query |
integer |
指定返回 quester-day 预测响应的天数。 支持的值是:
|
|
language
|
query |
string |
返回搜索结果时应采用的语言。 应是受支持的 IETF 语言标记之一,不区分大小写。 当指定语言的数据不适用于特定字段时,将使用默认语言。 有关详细信息,请参阅 支持的语言 。 |
|
unit
|
query |
指定以公制单位或英制单位返回数据。 默认值为 metric。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
x-ms-client-id |
string |
指定要与Microsoft Entra ID安全模型一起使用的帐户。 它表示Azure Maps帐户的唯一 ID,可以从Azure Maps管理平面帐户 API 检索。 若要在 Azure Maps 中使用Microsoft Entra ID安全性,请参阅以下文章以获取指导。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
确定 |
|
Other Status Codes |
发生了意外错误。 |
安全性
AADToken
这些是 OAuth 2.0 流Microsoft Entra。 与 Azure 基于角色的访问控制配对后,它可用于控制对 Azure Maps REST API 的访问。 Azure 基于角色的访问控制用于指定对一个或多个Azure Maps资源帐户或子资源的访问权限。 可以通过内置角色或由一个或多个权限组成的自定义角色授予任何用户、组或服务主体访问权限,以Azure Maps REST API。
若要实现方案,建议查看 身份验证概念。 总之,此安全定义提供了一个解决方案,用于通过能够对特定 API 和作用域进行访问控制的对象对应用程序 () 建模。
备注
- 此安全定义需要使用
x-ms-client-id
标头来指示应用程序请求访问哪个Azure Maps资源。 这可以从 地图管理 API 获取。
Authorization URL
特定于 Azure 公有云实例。 主权云具有唯一的授权 URL 和Microsoft Entra ID配置。
* Azure 基于角色的访问控制是通过 Azure 门户、PowerShell、CLI、Azure SDK 或 REST API 从 Azure 管理平面配置的。
* 使用 Azure Maps Web SDK 允许针对多个用例对应用程序进行基于配置的设置。
- 有关Microsoft 标识平台的详细信息,请参阅Microsoft 标识平台概述。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
https://atlas.microsoft.com/.default | https://atlas.microsoft.com/.default |
subscription-key
这是在Azure 门户中使用 PowerShell、CLI、Azure SDK 或 REST API Create Azure Maps 帐户时预配的共享密钥。
使用此密钥,任何应用程序都可以访问所有 REST API。 换句话说,此密钥可用作颁发密钥的帐户中的主密钥。
对于公开的应用程序,我们建议使用机密客户端应用程序方法来访问Azure Maps REST API,以便安全地存储密钥。
Type:
apiKey
In:
query
SAS Token
这是一个共享访问签名令牌,通过 Azure 门户、PowerShell、CLI、Azure SDK 或 REST API,通过 Azure 管理平面在Azure Maps资源上列出 SAS 操作创建。
使用此令牌,任何应用程序都有权使用 Azure 基于角色的访问控制进行访问,并精细控制特定令牌的过期、速率和区域 () 。 换句话说,SAS 令牌可用于允许应用程序以比共享密钥更安全的方式控制访问。
对于公开的应用程序,我们建议在 Map 帐户资源 上配置允许的来源的特定列表,以限制呈现滥用,并定期续订 SAS 令牌。
Type:
apiKey
In:
header
示例
Successfully retrieve detailed weather forecast by a given location
Sample Request
GET https://atlas.microsoft.com/weather/forecast/quarterDay/json?api-version=1.1&query=47.632346,-122.138874&duration=1
Sample Response
{
"forecasts": [
{
"date": "2019-11-14T00:00:00-08:00",
"effectiveDate": "2019-11-14T07:00:00-08:00",
"quarter": 0,
"iconCode": 12,
"iconPhrase": "Showers",
"phrase": "Mostly cloudy with a shower in spots",
"temperature": {
"minimum": {
"value": 6.9,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 11.1,
"unit": "C",
"unitType": 17
}
},
"realFeelTemperature": {
"minimum": {
"value": 7.9,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 11.2,
"unit": "C",
"unitType": 17
}
},
"dewPoint": {
"value": 7.5,
"unit": "C",
"unitType": 17
},
"relativeHumidity": 90,
"wind": {
"direction": {
"degrees": 206,
"localizedDescription": "SSW"
},
"speed": {
"value": 3.7,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"direction": {
"degrees": 192,
"localizedDescription": "SSW"
},
"speed": {
"value": 9.3,
"unit": "km/h",
"unitType": 7
}
},
"visibility": {
"value": 2,
"unit": "km",
"unitType": 6
},
"cloudCover": 99,
"hasPrecipitation": true,
"precipitationType": "Rain",
"precipitationIntensity": "Light",
"precipitationProbability": 55,
"thunderstormProbability": 20,
"totalLiquid": {
"value": 0.6,
"unit": "mm",
"unitType": 3
},
"rain": {
"value": 0.6,
"unit": "mm",
"unitType": 3
},
"snow": {
"value": 0,
"unit": "cm",
"unitType": 4
},
"ice": {
"value": 0,
"unit": "mm",
"unitType": 3
}
},
{
"date": "2019-11-14T00:00:00-08:00",
"effectiveDate": "2019-11-14T13:00:00-08:00",
"quarter": 1,
"iconCode": 12,
"iconPhrase": "Showers",
"phrase": "Mostly cloudy with a shower in spots",
"temperature": {
"minimum": {
"value": 11.3,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 13.7,
"unit": "C",
"unitType": 17
}
},
"realFeelTemperature": {
"minimum": {
"value": 11.3,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 14.7,
"unit": "C",
"unitType": 17
}
},
"dewPoint": {
"value": 8.4,
"unit": "C",
"unitType": 17
},
"relativeHumidity": 76,
"wind": {
"direction": {
"degrees": 296,
"localizedDescription": "WNW"
},
"speed": {
"value": 3.7,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"direction": {
"degrees": 206,
"localizedDescription": "SSW"
},
"speed": {
"value": 9.3,
"unit": "km/h",
"unitType": 7
}
},
"visibility": {
"value": 8,
"unit": "km",
"unitType": 6
},
"cloudCover": 96,
"hasPrecipitation": true,
"precipitationType": "Rain",
"precipitationIntensity": "Light",
"precipitationProbability": 50,
"thunderstormProbability": 20,
"totalLiquid": {
"value": 0.3,
"unit": "mm",
"unitType": 3
},
"rain": {
"value": 0.3,
"unit": "mm",
"unitType": 3
},
"snow": {
"value": 0,
"unit": "cm",
"unitType": 4
},
"ice": {
"value": 0,
"unit": "mm",
"unitType": 3
}
},
{
"date": "2019-11-14T00:00:00-08:00",
"effectiveDate": "2019-11-14T19:00:00-08:00",
"quarter": 2,
"iconCode": 7,
"iconPhrase": "Cloudy",
"phrase": "Cloudy",
"temperature": {
"minimum": {
"value": 9.8,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 10.4,
"unit": "C",
"unitType": 17
}
},
"realFeelTemperature": {
"minimum": {
"value": 8.5,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 9.8,
"unit": "C",
"unitType": 17
}
},
"dewPoint": {
"value": 7,
"unit": "C",
"unitType": 17
},
"relativeHumidity": 81,
"wind": {
"direction": {
"degrees": 172,
"localizedDescription": "S"
},
"speed": {
"value": 9.3,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"direction": {
"degrees": 174,
"localizedDescription": "S"
},
"speed": {
"value": 13,
"unit": "km/h",
"unitType": 7
}
},
"visibility": {
"value": 10,
"unit": "km",
"unitType": 6
},
"cloudCover": 93,
"hasPrecipitation": false,
"precipitationProbability": 25,
"thunderstormProbability": 0,
"totalLiquid": {
"value": 0,
"unit": "mm",
"unitType": 3
},
"rain": {
"value": 0,
"unit": "mm",
"unitType": 3
},
"snow": {
"value": 0,
"unit": "cm",
"unitType": 4
},
"ice": {
"value": 0,
"unit": "mm",
"unitType": 3
}
},
{
"date": "2019-11-14T00:00:00-08:00",
"effectiveDate": "2019-11-15T01:00:00-08:00",
"quarter": 3,
"iconCode": 12,
"iconPhrase": "Showers",
"phrase": "Cloudy with a little rain",
"temperature": {
"minimum": {
"value": 8.9,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 9.9,
"unit": "C",
"unitType": 17
}
},
"realFeelTemperature": {
"minimum": {
"value": 6.2,
"unit": "C",
"unitType": 17
},
"maximum": {
"value": 8.6,
"unit": "C",
"unitType": 17
}
},
"dewPoint": {
"value": 6.9,
"unit": "C",
"unitType": 17
},
"relativeHumidity": 84,
"wind": {
"direction": {
"degrees": 164,
"localizedDescription": "SSE"
},
"speed": {
"value": 9.3,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"direction": {
"degrees": 165,
"localizedDescription": "SSE"
},
"speed": {
"value": 14.8,
"unit": "km/h",
"unitType": 7
}
},
"visibility": {
"value": 9,
"unit": "km",
"unitType": 6
},
"cloudCover": 99,
"hasPrecipitation": true,
"precipitationType": "Rain",
"precipitationIntensity": "Light",
"precipitationProbability": 59,
"thunderstormProbability": 0,
"totalLiquid": {
"value": 1.4,
"unit": "mm",
"unitType": 3
},
"rain": {
"value": 1.4,
"unit": "mm",
"unitType": 3
},
"snow": {
"value": 0,
"unit": "cm",
"unitType": 4
},
"ice": {
"value": 0,
"unit": "mm",
"unitType": 3
}
}
]
}
定义
名称 | 说明 |
---|---|
Day |
一天中的四分之一。 |
Error |
资源管理错误附加信息。 |
Error |
错误详细信息。 |
Error |
错误响应 |
Icon |
表示显示 的图像的 |
Json |
响应的所需格式。 仅支持 |
Precipitation |
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。 |
Quarter |
|
Quarter |
|
Unit |
与显示的单位类型关联的数值 ID 值。 可用于单元翻译。 有关详细信息,请参阅 Azure Maps 中的天气服务。 |
Weather |
指定以公制单位或英制单位返回数据。 默认值为 metric。 |
Weather |
与天气相关的给定单位的特定值。 |
Weather |
返回的温度值。 |
Wind |
返回的风力详细信息,包括速度和方向。 |
Wind |
风向 |
DayQuarter
一天中的四分之一。
名称 | 类型 | 说明 |
---|---|---|
0 |
Integer |
|
1 |
Integer |
|
2 |
Integer |
|
3 |
Integer |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
错误详细信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorResponse
错误响应
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
IconCode
表示显示 的图像的 iconPhrase
数值。 有关详细信息,请参阅 Azure Maps 中的天气服务。
名称 | 类型 | 说明 |
---|---|---|
1 |
Integer |
|
10 |
Integer |
|
11 |
Integer |
|
12 |
Integer |
|
13 |
Integer |
|
14 |
Integer |
|
15 |
Integer |
|
16 |
Integer |
|
17 |
Integer |
|
18 |
Integer |
|
19 |
Integer |
|
2 |
Integer |
|
20 |
Integer |
|
21 |
Integer |
|
22 |
Integer |
|
23 |
Integer |
|
24 |
Integer |
|
25 |
Integer |
|
26 |
Integer |
|
27 |
Integer |
|
28 |
Integer |
|
29 |
Integer |
|
3 |
Integer |
|
30 |
Integer |
|
31 |
Integer |
|
32 |
Integer |
|
33 |
Integer |
|
34 |
Integer |
|
35 |
Integer |
|
36 |
Integer |
|
37 |
Integer |
|
38 |
Integer |
|
39 |
Integer |
|
4 |
Integer |
|
40 |
Integer |
|
41 |
Integer |
|
42 |
Integer |
|
43 |
Integer |
|
44 |
Integer |
|
5 |
Integer |
|
6 |
Integer |
|
7 |
Integer |
|
8 |
Integer |
|
9 |
Integer |
JsonFormat
响应的所需格式。 仅支持 json
格式。
名称 | 类型 | 说明 |
---|---|---|
json |
string |
PrecipitationType
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。
名称 | 类型 | 说明 |
---|---|---|
Ice |
string |
Ice |
Mix |
string |
组合 |
Rain |
string |
雨 |
Snow |
string |
雪 |
QuarterDayForecast
名称 | 类型 | 说明 |
---|---|---|
cloudCover |
integer |
表示云覆盖率的百分比。 |
date |
string |
预测日期(例如),2019-10-27T00:00:00 |
dewPoint |
以指定单位为单位的露点温度。 露点温度是空气必须冷却到达到饱和度的温度。 |
|
effectiveDate |
string |
以 ISO 8601 格式显示的预测季度开始日期和时间,例如 2019-10-27T19:39:57-08:00。 |
hasPrecipitation |
boolean |
指示是否存在降水。 True 表示存在降水,false 表示没有降水。 |
ice |
Ice |
|
iconCode |
表示显示 的图像的 |
|
iconPhrase |
string |
图标的短语说明。 以指定语言显示。 例如,“Sunny”。 |
phrase |
string |
季度的简短摘要短语摘要。 |
precipitationIntensity |
string |
强度的说明。 |
precipitationProbability |
integer |
表示降水概率的百分比。 例如,“20”。 |
precipitationType |
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。 |
|
quarter |
一天中的四分之一。 |
|
rain |
雨 |
|
realFeelTemperature |
季度的 RealFeel™ 温度值。 |
|
relativeHumidity |
integer |
相对湿度是空气中存在的水蒸汽量,以相同温度下饱和所需量的百分比表示。 |
snow |
雪 |
|
temperature |
季度的温度值。 |
|
thunderstormProbability |
integer |
表示雷雨概率的百分比。 例如,“10”。 |
totalLiquid |
预报期间降水的液体当量总量。 |
|
visibility |
指定单位中的可见性。 对象或光可以清晰识别的距离的度量值。 |
|
wind |
返回的风力详细信息,包括速度和方向。 |
|
windGust |
阵风。 阵风是一个突然的,短暂的风速增加。 |
QuarterDayForecastResult
名称 | 类型 | 说明 |
---|---|---|
forecasts |
预测响应中每个季度的数据。 |
UnitType
与显示的单位类型关联的数值 ID 值。 可用于单元翻译。 有关详细信息,请参阅 Azure Maps 中的天气服务。
名称 | 类型 | 说明 |
---|---|---|
0 |
Integer |
|
1 |
Integer |
|
10 |
Integer |
|
11 |
Integer |
|
12 |
Integer |
|
13 |
Integer |
|
14 |
Integer |
|
15 |
Integer |
|
16 |
Integer |
|
17 |
Integer |
|
18 |
Integer |
|
19 |
Integer |
|
2 |
Integer |
|
20 |
Integer |
|
21 |
Integer |
|
22 |
Integer |
|
3 |
Integer |
|
31 |
Integer |
|
4 |
Integer |
|
5 |
Integer |
|
6 |
Integer |
|
7 |
Integer |
|
8 |
Integer |
|
9 |
Integer |
WeatherDataUnit
指定以公制单位或英制单位返回数据。 默认值为 metric。
名称 | 类型 | 说明 |
---|---|---|
imperial |
string |
以英制单位返回数据。 帝国体系的一些示例单位是华氏度和英里。 |
metric |
string |
以指标单位返回数据。 指标系统的一些示例单位为摄氏度和公里。 |
WeatherUnit
与天气相关的给定单位的特定值。
名称 | 类型 | 说明 |
---|---|---|
unit |
string |
返回值的单位类型。 |
unitType |
与显示的单位类型关联的数值 ID 值。 可用于单元翻译。 有关详细信息,请参阅 Azure Maps 中的天气服务。 |
|
value |
number |
舍入值。 |
WeatherUnitRange
返回的温度值。
名称 | 类型 | 说明 |
---|---|---|
maximum |
时间段内的最高温度 |
|
minimum |
时间段的最低温度。 |
WindDetails
返回的风力详细信息,包括速度和方向。
名称 | 类型 | 说明 |
---|---|---|
direction |
风向 |
|
speed |
以指定单位为单位的风速。 |
WindDirection
风向
名称 | 类型 | 说明 |
---|---|---|
degrees |
integer |
方位角风向,从真正北端开始,沿顺时针方向继续。 北为0度,东为90度,南为180度,西为270度。 可能的值 0-359。 |
localizedDescription |
string |
指定语言的方向缩写。 |