Weather - Get Weather Along Route
Use to get a locationally precise, up-to-the-minute forecast that includes weather hazard assessments and notifications along a route.
The Get Weather Along Route
API is an HTTP GET
request that returns hyper local (one kilometer or less), up-to-the-minute weather nowcasts, weather hazard assessments, and notifications along a route described as a sequence of waypoints.
This includes a list of weather hazards affecting the waypoint or route, and the aggregated hazard index for each waypoint might be used to paint each portion of a route according to how safe it is for the driver. When submitting the waypoints, it is recommended to stay within, or close to, the distance that can be traveled within 120-mins or shortly after. Data is updated every five minutes.
The service supplements Azure Maps Route Service that allows you to first request a route between an origin and a destination and use that as an input for Weather Along Route endpoint.
In addition, the service supports scenarios to generate weather notifications for waypoints that experience an increase in intensity of a weather hazard. For example, if the vehicle is expected to begin experiencing heavy rain as it reaches a waypoint, a weather notification for heavy rain will be generated for that waypoint allowing the end product to display a heavy rain notification before the driver reaches that waypoint. The trigger for when to display the notification for a waypoint could be based, for example, on a geofence, or selectable distance to the waypoint.
The API covers all regions of the planet except latitudes above Greenland and Antarctica.
GET https://atlas.microsoft.com/weather/route/json?api-version=1.1&query={query}
GET https://atlas.microsoft.com/weather/route/json?api-version=1.1&query={query}&language={language}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
format
|
path | True |
Desired format of the response. Only |
|
api-version
|
query | True |
string |
Version number of Azure Maps API. |
query
|
query | True |
string |
Coordinates through which the route is calculated, separated by colon (:) and entered in chronological order. A minimum of two waypoints is required. A single API call may contain up to 60 waypoints. A waypoint indicates location, ETA, and optional heading: latitude,longitude,ETA,heading, where
It is recommended to stay within, or close to, the distance that can be traveled within 120-mins or shortly after. This way a more accurate assessment can be provided for the trip and prevent isolated events not being captured between waypoints. Information can and should be updated along the route (especially for trips greater than 2 hours) to continuously pull new waypoints moving forward, but also to ensure that forecast information for content such as precipitation type and intensity is accurate as storms develop and dissipate over time. |
language
|
query |
string |
Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used. Please refer to Supported Languages for details. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-client-id |
string |
Specifies which account is intended for usage in conjunction with the Microsoft Entra ID security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Microsoft Entra ID security in Azure Maps see the following articles for guidance. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
An unexpected error occurred. |
Security
AADToken
These are the Microsoft Entra OAuth 2.0 Flows. When paired with Azure role-based access control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.
To implement scenarios, we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.
Notes
- This security definition requires the use of the
x-ms-client-id
header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
The Authorization URL
is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations.
*
The Azure role-based access control is configured from the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.
*
Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
- For more information on Microsoft identity platform, see Microsoft identity platform overview.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
https://atlas.microsoft.com/.default | https://atlas.microsoft.com/.default |
subscription-key
This is a shared key that is provisioned when you Create an Azure Maps account in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.
With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.
For publicly exposed applications, our recommendation is to use the confidential client applications approach to access Azure Maps REST APIs so your key can be securely stored.
Type:
apiKey
In:
query
SAS Token
This is a shared access signature token is created from the List SAS operation on the Azure Maps resource through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.
With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.
For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the Map account resource to limit rendering abuse and regularly renew the SAS Token.
Type:
apiKey
In:
header
Examples
Successfully retrieve detailed weather casts along a route described as a sequence of waypoints
Sample request
GET https://atlas.microsoft.com/weather/route/json?api-version=1.1&query=38.907,-77.037,0:38.907,-77.009,10:38.926,-76.928,20:39.033,-76.852,30:39.168,-76.732,40:39.269,-76.634,50:39.287,-76.612,60
Sample response
{
"summary": {
"iconCode": 35,
"hazards": {
"maxHazardIndex": 0
}
},
"waypoints": [
{
"iconCode": 38,
"shortPhrase": "Mostly cloudy",
"isDayTime": false,
"cloudCover": 70,
"temperature": {
"value": 3.4,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 142
},
"speed": {
"value": 2,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 3,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 90,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 38,
"shortPhrase": "Mostly cloudy",
"isDayTime": false,
"cloudCover": 65,
"temperature": {
"value": 3.4,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 166
},
"speed": {
"value": 1,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 2,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 77,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 35,
"shortPhrase": "Partly cloudy",
"isDayTime": false,
"cloudCover": 43,
"temperature": {
"value": 3.2,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 163
},
"speed": {
"value": 2,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 2,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 44,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 35,
"shortPhrase": "Partly cloudy",
"isDayTime": false,
"cloudCover": 34,
"temperature": {
"value": 1.6,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 189
},
"speed": {
"value": 2,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 4,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 32,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 38,
"shortPhrase": "Mostly cloudy",
"isDayTime": false,
"cloudCover": 54,
"temperature": {
"value": 0.5,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 202
},
"speed": {
"value": 4,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 5,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 36,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 35,
"shortPhrase": "Partly cloudy",
"isDayTime": false,
"cloudCover": 46,
"temperature": {
"value": 2.4,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 222
},
"speed": {
"value": 4,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 5,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 38,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
},
{
"iconCode": 35,
"shortPhrase": "Partly cloudy",
"isDayTime": false,
"cloudCover": 39,
"temperature": {
"value": 2.3,
"unit": "C",
"unitType": 17
},
"wind": {
"direction": {
"degrees": 231
},
"speed": {
"value": 4,
"unit": "km/h",
"unitType": 7
}
},
"windGust": {
"speed": {
"value": 5,
"unit": "km/h",
"unitType": 7
}
},
"precipitation": {
"dbz": 0,
"type": "SNOW"
},
"lightningCount": 0,
"sunGlare": {
"calculatedVehicleHeading": 43,
"glareIndex": 0
},
"hazards": {
"maxHazardIndex": 0
},
"notifications": []
}
]
}
Definitions
Name | Description |
---|---|
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Hazard |
|
Hazard |
A severity/hazard index.
|
Icon |
Numeric value representing an image that displays the |
Json |
Desired format of the response. Only |
Sun |
A rating that indicates how blinding the sun is for the driver. |
Unit |
Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather services in Azure Maps for details. |
Weather |
Precipitation forecast of the weather along the route. |
Weather |
This object is returned from a successful Weather Along Route. |
Weather |
Short summary of the weather along the route. |
Weather |
Description of the weather hazard affecting the trip. |
Weather |
|
Weather |
Specific value of a given unit related to weather. |
Weather |
|
Wind |
Wind details being returned including speed and direction. |
Wind |
Wind direction |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
HazardDetail
Name | Type | Description |
---|---|---|
hazardCode |
string |
A unique identifier (non-displayable) for each type of hazard: LightRain, ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, TornadoWarning, TsunamiWarning, SevereThunderstormWarning. |
hazardIndex |
A severity/hazard index.
|
|
shortPhrase |
string |
A displayable short phrase describing the forecasted conditions and precipitation intensity/type. |
HazardIndex
A severity/hazard index.
0
- No hazard.1
- Be informed, be aware.2
- Pay attention, be prepared.3
- Take action.4
- Life threatening, emergency.
Name | Type | Description |
---|---|---|
0 |
Integer |
|
1 |
Integer |
|
2 |
Integer |
|
3 |
Integer |
|
4 |
Integer |
IconCode
Numeric value representing an image that displays the iconPhrase
. Please refer to Weather services in Azure Maps for details.
Name | Type | Description |
---|---|---|
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
Desired format of the response. Only json
format is supported.
Name | Type | Description |
---|---|---|
json |
string |
SunGlare
A rating that indicates how blinding the sun is for the driver.
Name | Type | Description |
---|---|---|
calculatedVehicleHeading |
integer |
If the vehicle heading value is not provided for a waypoint, then the service will calculate a heading based upon the location of neighboring waypoints if provided. |
glareIndex |
integer |
An index from 0 to 100 indicating sun glare intensity for a driver. A value of 50 and above can be considered a hazard for some drivers and a value of 100 signifies the driver is driving straight into the sun and atmospheric conditions are clear allowing for the full intensity of the sun to blind the driver. |
UnitType
Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather services in Azure Maps for details.
Name | Type | Description |
---|---|---|
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 |
WeatherAlongRoutePrecipitation
Precipitation forecast of the weather along the route.
Name | Type | Description |
---|---|---|
dbz |
number |
The forecasted precipitation intensity in dBZ (decibels relative to Z) from 0.0 to 100.0. |
type |
string |
Precipitation type. If precipitation should occur, the type that it will be: "RAIN," "HAIL," "SNOW," "ICE," or "MIX." |
WeatherAlongRouteResult
This object is returned from a successful Weather Along Route.
Name | Type | Description |
---|---|---|
summary |
Short summary of the weather along the route. |
|
waypoints |
Data for each waypoint returned in the same order as specified in the request. |
WeatherAlongRouteSummary
Short summary of the weather along the route.
Name | Type | Description |
---|---|---|
hazards |
Description of the weather hazard affecting the trip. |
|
iconCode |
Numeric value representing an image that displays the |
WeatherHazards
Description of the weather hazard affecting the trip.
Name | Type | Description |
---|---|---|
hazardDetails |
Details of the weather hazards affecting the trip. |
|
maxHazardIndex |
A severity/hazard index.
|
WeatherNotification
Name | Type | Description |
---|---|---|
hazardCode |
string |
A unique identifier (non-displayable) for each type of hazard: LightRain, ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, TornadoWarning, TsunamiWarning, SevereThunderstormWarning. |
hazardIndex |
A severity/hazard index.
|
|
shortPhrase |
string |
A displayable short phrase describing the forecasted conditions and precipitation intensity/type. |
type |
string |
A type of notification generated to warn drivers of the onset of a hazard, or increase in intensity of a hazard. |
WeatherUnit
Specific value of a given unit related to weather.
Name | Type | Description |
---|---|---|
unit |
string |
Type of unit for the returned value. |
unitType |
Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather services in Azure Maps for details. |
|
value |
number |
Rounded value. |
WeatherWaypoint
Name | Type | Description |
---|---|---|
cloudCover |
integer |
Percent representing cloud cover. |
hazards |
Description of the weather hazard affecting the trip. |
|
iconCode |
Numeric value representing an image that displays the |
|
isDayTime |
boolean |
Indicates the time of the day. True indicates 'day',', false indicates 'night. |
lightningCount |
integer |
Estimation of thunderstorm intensity on an open scale. A value of 0 means there is no thunderstorm; values of 1 and higher mean there is a thunderstorm in increasing intensity. |
notifications |
List of weather hazard notifications. |
|
precipitation |
Precipitation forecast of the weather along the route. |
|
shortPhrase |
string |
A displayable short phrase describing the forecasted conditions and precipitation intensity/type. |
sunGlare |
A rating that indicates how blinding the sun is for the driver. |
|
temperature |
Specific value of a given unit related to weather. |
|
wind |
Wind details being returned including speed and direction. |
|
windGust |
Wind details being returned including speed and direction. |
WindDetails
Wind details being returned including speed and direction.
Name | Type | Description |
---|---|---|
direction |
Wind direction |
|
speed |
Speed of the wind in specified unit. |
WindDirection
Wind direction
Name | Type | Description |
---|---|---|
degrees |
integer |
Wind direction in Azimuth degrees, starting at true North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 degrees. Possible values 0-359. |
localizedDescription |
string |
Direction abbreviation in the specified language. |