你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Weather - Get Minute Forecast
使用 获取未来 120 分钟(间隔为 1、5 和 15 分钟)的逐分钟预测。
Get Minute Forecast
API 是一个 HTTP GET
请求,用于返回给定位置未来 120 分钟的逐分钟预测。 用户可以 1、5 和 15 分钟的间隔请求天气预测。 响应将包括详细信息,例如降水类型 (包括雨、雪或) 、开始时间和降水强度值 (dBZ) 的混合。 有关详细信息,请参阅 请求逐分钟天气预报数据。
GET https://atlas.microsoft.com/weather/forecast/minute/json?api-version=1.1&query={query}
GET https://atlas.microsoft.com/weather/forecast/minute/json?api-version=1.1&query={query}&interval={interval}&language={language}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
format
|
path | True |
响应的所需格式。 仅支持 |
|
api-version
|
query | True |
string |
Azure Maps API 的版本号。 |
query
|
query | True |
number[] |
指定为由纬度后跟经度组成的逗号分隔字符串的适用查询,例如“47.641268,-122.125679”。 |
interval
|
query |
integer |
指定返回的天气预报的时间间隔(以分钟为单位)。 支持的值为
|
|
language
|
query |
string |
应返回搜索结果的语言。 应该是受支持的 IETF 语言标记之一,不区分大小写。 当指定语言的数据不适用于特定字段时,将使用默认语言。 有关详细信息,请参阅 支持的语言 。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
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 管理平面通过 Azure 门户、PowerShell、CLI、Azure SDK 或 REST API 在Azure Maps资源上列出 SAS 操作创建。
使用此令牌,任何应用程序都有权使用 Azure 基于角色的访问控制进行访问,并精细控制特定令牌的过期、速率和区域 () 。 换句话说,SAS 令牌可用于允许应用程序以比共享密钥更安全的方式控制访问。
对于公开的应用程序,我们建议在 映射帐户资源 上配置允许的来源的特定列表,以限制呈现滥用,并定期续订 SAS 令牌。
Type:
apiKey
In:
header
示例
Successfully retrieve minute-by-minute forecasts for a given location
Sample Request
GET https://atlas.microsoft.com/weather/forecast/minute/json?api-version=1.1&query=47.632346,-122.138874&interval=15
Sample Response
{
"summary": {
"briefPhrase60": "Rain ending in 25 min",
"shortPhrase": "Rain ending in 25 min",
"briefPhrase": "Rain ending in 25 min",
"longPhrase": "Rain ending in 25 min",
"iconCode": 12
},
"intervalSummaries": [
{
"startMinute": 0,
"endMinute": 24,
"totalMinutes": 25,
"shortPhrase": "Rain ending in %minute_value min",
"briefPhrase": "Rain ending in %minute_value min",
"longPhrase": "Rain ending in %minute_value min",
"iconCode": 12
},
{
"startMinute": 25,
"endMinute": 119,
"totalMinutes": 95,
"shortPhrase": "No precip for %MINUTE_VALUE min",
"briefPhrase": "No precipitation for at least %MINUTE_VALUE min",
"longPhrase": "No precipitation for at least %MINUTE_VALUE min",
"iconCode": 7
}
],
"intervals": [
{
"startTime": "2019-11-14T15:18:00-08:00",
"minute": 0,
"dbz": 23,
"shortPhrase": "Light Rain",
"threshold": "LIGHT",
"color": {
"red": 8,
"green": 98,
"blue": 2,
"hex": "#086202"
},
"simplifiedColor": {
"red": 35,
"green": 190,
"blue": 39,
"hex": "#23BE27"
},
"precipitationType": "Rain",
"iconCode": 12,
"cloudCover": 100
},
{
"startTime": "2019-11-14T15:33:00-08:00",
"minute": 15,
"dbz": 18,
"shortPhrase": "Light Rain",
"threshold": "LIGHT",
"color": {
"red": 32,
"green": 133,
"blue": 9,
"hex": "#208509"
},
"simplifiedColor": {
"red": 35,
"green": 190,
"blue": 39,
"hex": "#23BE27"
},
"precipitationType": "Rain",
"iconCode": 12,
"cloudCover": 100
},
{
"startTime": "2019-11-14T15:48:00-08:00",
"minute": 30,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
},
{
"startTime": "2019-11-14T16:03:00-08:00",
"minute": 45,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
},
{
"startTime": "2019-11-14T16:18:00-08:00",
"minute": 60,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
},
{
"startTime": "2019-11-14T16:33:00-08:00",
"minute": 75,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
},
{
"startTime": "2019-11-14T16:48:00-08:00",
"minute": 90,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
},
{
"startTime": "2019-11-14T17:03:00-08:00",
"minute": 105,
"dbz": 0,
"shortPhrase": "No Precipitation",
"iconCode": 7,
"cloudCover": 100
}
]
}
定义
名称 | 说明 |
---|---|
Color |
|
Error |
资源管理错误附加信息。 |
Error |
错误详细信息。 |
Error |
错误响应 |
Forecast |
|
Icon |
表示显示 的图像的 |
Interval |
|
Json |
响应的所需格式。 仅支持 |
Minute |
|
Minute |
整个预测周期的短语摘要。 |
Precipitation |
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。 |
ColorValue
名称 | 类型 | 说明 |
---|---|---|
blue |
integer |
RGB 值的蓝色分量 |
green |
integer |
RGB 值的绿色分量。 |
hex |
string |
十六进制颜色值。 |
red |
integer |
RGB 值的红色分量。 |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
错误详细信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorResponse
错误响应
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
ForecastInterval
名称 | 类型 | 说明 |
---|---|---|
cloudCover |
integer |
表示云覆盖率的百分比。 |
color |
映射到 dBZ 的全光谱颜色 (分贝相对于 Z) 。 如果 dbz 为零,则响应中不存在颜色。 |
|
dbz |
number |
表示预测降水强度的单位。 |
iconCode |
表示显示 的图像的 |
|
minute |
integer |
间隔的第一分钟。 |
precipitationType |
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。 |
|
shortPhrase |
string |
描述间隔的降水条件的简短短语。 |
simplifiedColor |
映射到降水类型和阈值的带色。 如果 dbz 为零,则响应中不存在。 |
|
startTime |
string |
以 ISO 8601 格式开始间隔的日期和时间,例如 2019-10-27T19:39:57-08:00。 |
threshold |
string |
指定阈值的键。 与 precipitationType 一起,可用于确定 simplifiedColor。 如果 dbz 为零,则响应中不存在。 |
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 |
IntervalSummary
名称 | 类型 | 说明 |
---|---|---|
briefPhrase |
string |
简短摘要短语。 短语长度约为 60 个字符。 |
endMinute |
integer |
摘要应用到的最后一分钟。 |
iconCode |
表示显示 的图像的 |
|
longPhrase |
string |
长摘要短语。 短语长度为 60+ 个字符。 |
shortPhrase |
string |
简短摘要短语。 短语长度约为 25 个字符。 |
startMinute |
integer |
摘要应用到的第一分钟。 |
totalMinutes |
integer |
摘要适用的分钟数。 |
JsonFormat
响应的所需格式。 仅支持 json
格式。
名称 | 类型 | 说明 |
---|---|---|
json |
string |
MinuteForecastResult
名称 | 类型 | 说明 |
---|---|---|
intervalSummaries |
预测中每个间隔的摘要信息。 摘要将分解降水开始和停止的每个潜在间隔。 |
|
intervals |
预测中每个间隔的预测数据。 |
|
summary |
整个预测周期的短语摘要。 |
MinuteForecastSummary
整个预测周期的短语摘要。
名称 | 类型 | 说明 |
---|---|---|
briefPhrase |
string |
接下来 120 分钟的摘要短语。 短语长度约为 60 个字符。 |
briefPhrase60 |
string |
接下来 60 分钟的摘要短语。 短语长度约为 60 个字符。 |
iconCode |
表示显示 的图像的 |
|
longPhrase |
string |
接下来 120 分钟的长摘要短语。 短语长度为 60+ 个字符。 |
shortPhrase |
string |
接下来 120 分钟的简短摘要短语。 短语长度约为 25 个字符。 |
PrecipitationType
指定 (“雨”“雪”“冰”或“混合”) 的降水类型。 如果 dbz 为零,则响应中不存在 precipitationType。
名称 | 类型 | 说明 |
---|---|---|
Ice |
string |
Ice |
Mix |
string |
组合 |
Rain |
string |
雨 |
Snow |
string |
雪 |