Weather - Get Daily Indices
Use when you want to know if the weather conditions are optimal for a specific
activity such as outdoor sporting activities, construction, or farming (results
includes soil moisture information).
The Get Daily Indices API is an HTTP GET request returns index values that
provide guidance to help when planning future activities. For example, a health
mobile application can notify users that today is good weather for running or
for other outdoors activities like playing golf or flying a kite. Retail stores
can optimize their digital marketing campaigns based on predicted index values.
The service returns in daily indices values for current and next 5, 10 and 15
days starting from current day.
GET {endpoint}/weather/indices/daily/json?api-version=1.1&query={query}
GET {endpoint}/weather/indices/daily/json?api-version=1.1&query={query}&language={language}&duration={duration}&indexId={indexId}&indexGroupId={indexGroupId}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The Azure Maps service hostname. Use |
|
format
|
path | True |
Desired format of the response. Only |
|
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
|
query
|
query | True |
number[] |
The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. "47.641268,-122.125679". Weather information is generally available for locations on land, bodies of water surrounded by land, and areas of the ocean that are within approximately 50 nautical miles of a coastline. |
|
duration
|
query |
integer (int32) |
Specifies for how many days the daily indices are returned. By default, the indices data for the current day will be returned. When requesting future indices data, the current day is included in the response as day 1. Available values are
|
|
|
index
|
query |
integer (int32) |
Numeric index group identifier that can be used for restricting returned
results to the corresponding subset of indices (index group). Cannot be paired
with |
|
|
index
|
query |
integer (int32) |
Numeric index identifier that can be used for restricting returned results to
the corresponding index type. Cannot be paired with |
|
|
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 |
Indicates the account intended for use with the Microsoft Entra ID security model. This unique ID for the Azure Maps account can be obtained from the Azure Maps management plane Account API. For more information on using Microsoft Entra ID security in Azure Maps, see Manage authentication in Azure Maps. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The request has succeeded. |
|
| Other Status Codes |
An unexpected error response. |
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.
Note
- This security definition requires the use of the
x-ms-client-idheader to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API. - The
Authorization URLis 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 |
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:
header
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 daily indices values from current day
Sample request
GET https://atlas.microsoft.com/weather/indices/daily/json?api-version=1.1&query=43.84745,-79.37849&indexGroupId=11
Sample response
{
"results": [
{
"description": "This is an excellent day for outdoor running!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 1,
"indexName": "Running Forecast",
"value": 9.2
},
{
"description": "Conditions are excellent for jogging outdoors!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 2,
"indexName": "Jogging Forecast",
"value": 9.4
},
{
"description": "Conditions are excellent for hiking!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 3,
"indexName": "Hiking Forecast",
"value": 9.8
},
{
"description": "Conditions are excellent for bicycling outdoors!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 4,
"indexName": "Bicycling Forecast",
"value": 9.9
},
{
"description": "This is a great day for golf.",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 5,
"indexName": "Golf Weather Forecast",
"value": 10
},
{
"description": "This is an excellent day for playing tennis!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 6,
"indexName": "Tennis Forecast",
"value": 9.2
},
{
"description": "This is an excellent day for skateboarding!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 7,
"indexName": "Skateboarding Forecast",
"value": 9.9
},
{
"description": "Conditions are excellent for attending an outdoor concert!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 8,
"indexName": "Outdoor Concert Forecast",
"value": 9.7
},
{
"description": "Conditions are very good today for kite-flying.",
"ascending": true,
"category": "Very Good",
"categoryValue": 4,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 9,
"indexName": "Kite Flying Forecast",
"value": 8.5
},
{
"description": "Conditons will be very good for a visit to the beach or pool.",
"ascending": true,
"category": "Very Good",
"categoryValue": 4,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 10,
"indexName": "Beach & Pool Forecast",
"value": 8.6
},
{
"description": "Conditions will be very good for sailing.",
"ascending": true,
"category": "Very Good",
"categoryValue": 4,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 11,
"indexName": "Sailing Forecast",
"value": 8.3
},
{
"description": "This is a great night to be stargazing!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 12,
"indexName": "Stargazing Forecast",
"value": 9.5
},
{
"description": "Expect only fair conditions for fishing.",
"ascending": true,
"category": "Fair",
"categoryValue": 2,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 13,
"indexName": "Fishing Forecast",
"value": 3.5
},
{
"description": "Expect poor conditions for skiing.",
"ascending": true,
"category": "Poor",
"categoryValue": 1,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 15,
"indexName": "Ski Weather Forecast",
"value": 0
},
{
"description": "The weather is favorable for a very high level of mosquito activity. Plan activities and insect repellents accordingly.",
"ascending": true,
"category": "Very High",
"categoryValue": 4,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 17,
"indexName": "Mosquito Activity Forecast",
"value": 7
},
{
"description": "Expect only fair conditions for hunting.",
"ascending": true,
"category": "Fair",
"categoryValue": 2,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 20,
"indexName": "Hunting Forecast",
"value": 4.5
},
{
"description": "This is a great day for an outdoor barbecue!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 24,
"indexName": "Outdoor Barbecue",
"value": 9.8
},
{
"description": "This is a great day for lawn mowing!",
"ascending": true,
"category": "Excellent",
"categoryValue": 5,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 28,
"indexName": "Lawn Mowing Forecast",
"value": 9.6
},
{
"description": "Conditions will be very good for outdoor activities.",
"ascending": true,
"category": "Very Good",
"categoryValue": 4,
"dateTime": "2020-07-14T07:00:00-04:00",
"indexId": 29,
"indexName": "Outdoor Activity Forecast",
"value": 8.7
}
]
}
Definitions
| Name | Description |
|---|---|
|
Daily |
A single index rating in the |
|
Daily |
The response returned by the Get Daily Indices operation, providing
activity-suitability ratings for the specified location. The |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
|
Json |
Desired format of the response. Only |
DailyIndex
A single index rating in the DailyIndicesResult.results array, scoring
how well one day's weather conditions are suited to a particular outdoor
activity such as running, golfing, kite flying, or barbecuing. Each
entry includes the activity name (for example, Ski Weather Forecast),
the date it applies to, a numeric value from 0.0 to 10.0, a
matching qualitative category label (for example, Poor), and a
short description of the conditions (for example, Expect poor
conditions for skiing.). A response may contain many entries - one
per day per index - covering each day in the requested duration and
each requested index.
| Name | Type | Description |
|---|---|---|
| ascending |
boolean |
Indicates which end of the 0.0-10.0
Use this flag whenever comparing |
| category |
string |
A short qualitative label describing |
| categoryValue |
integer (int32) |
A 1-5 numeric rating that pairs with
|
| dateTime |
string (date-time) |
The date the index applies to, expressed as midnight local time at
the forecast location in ISO
8601 format
(yyyy-mm-ddThh:mm:ss±hh:mm) - for example,
2020-07-14T07:00:00-04:00. The time component is always 00:00:00 in
the location's local offset; treat this as the calendar day the
|
| description |
string |
A short, human-readable explanation of the rating for this day, suitable for display in a UI - for example, This is an excellent day for outdoor running!, This is a great day for golf., or Conditions are very good today for kite-flying. Returned in the language specified in the request. |
| indexId |
integer (int32) |
The numeric identifier of the index, suitable for stable,
language-independent lookup of the activity that pairs with
|
| indexName |
string |
The display name of the index, identifying the activity or condition it rates - for example, Running Forecast, Golf Weather Forecast, Kite Flying Forecast, or Beach & Pool Forecast. Returned in the language specified in the request. For the full list of supported indices, see Index IDs in the Weather services in Azure Maps concepts article. |
| value |
number (float) |
The numeric suitability score for the activity on this day, from
0.0 to 10.0. By default 10.0 indicates the most favorable
conditions and 0.0 the least favorable, but a few indices invert
the scale - check |
DailyIndicesResult
The response returned by the Get Daily Indices operation, providing
activity-suitability ratings for the specified location. The results
array contains one DailyIndex entry per day per index, each scoring
the day's weather conditions for an outdoor activity such as running,
golfing, kite flying, or barbecuing.
| Name | Type | Description |
|---|---|---|
| results |
The daily index ratings for the queried location, in chronological
order starting with the current day. The array contains one
|
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
maps.weather.getdailyindices |
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
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
JsonFormat
Desired format of the response. Only json format is supported.
| Value | Description |
|---|---|
| json |