Weather - Get Daily Indices

Get Daily Indices

Applies to: see pricing tiers.

There may be times when you want to know if the weather conditions are optimal for a specific activity, for example, for outdoor construction, indoor activities, running or farming including soil moisture information. Azure Maps Indices API returns index values that will guide end users to plan future activities. For example, a health mobile application can notify users that today is good weather for running or for other outdoors activities like for playing golf, and 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 https://atlas.microsoft.com/weather/indices/daily/json?api-version=1.1&query={query}
GET https://atlas.microsoft.com/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
format
path True

Desired format of the response. Only json format is supported.

api-version
query True
  • string

Version number of Azure Maps API.

query
query True
  • array

The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. "47.641268,-122.125679".

duration
query
  • integer

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

  • 1 - Return daily index data for the current day. Default value.
  • 5 - Return 5 days of daily index data starting from the current day.
  • 10 - Return 10 days of daily index data starting from the current day.
  • 15 - Return 15 days of daily index data starting from the current day.
indexGroupId
query
  • integer

Numeric index group identifier that can be used for restricting returned results to the corresponding subset of indices (index group). Cannot be paired with indexId. Please refer to Weather Service Concepts for details and to see the supported index groups.

indexId
query
  • integer

Numeric index identifier that can be used for restricting returned results to the corresponding index type. Cannot be paired with indexGroupId. Please refer to Weather Service Concepts for details and to see the supported indices.

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 Azure AD 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 Azure AD 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 Azure Active Directory OAuth2 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 Azure Active directory 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.

  • Currently, Azure Active Directory v1.0 or v2.0 supports Work, School, and Guests but does not support Personal accounts.

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 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": [
    {
      "indexName": "Running Forecast",
      "indexId": 1,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.2,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is an excellent day for outdoor running!"
    },
    {
      "indexName": "Jogging Forecast",
      "indexId": 2,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.4,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "Conditions are excellent for jogging outdoors!"
    },
    {
      "indexName": "Hiking Forecast",
      "indexId": 3,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.8,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "Conditions are excellent for hiking!"
    },
    {
      "indexName": "Bicycling Forecast",
      "indexId": 4,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.9,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "Conditions are excellent for bicycling outdoors!"
    },
    {
      "indexName": "Golf Weather Forecast",
      "indexId": 5,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 10,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is a great day for golf."
    },
    {
      "indexName": "Tennis Forecast",
      "indexId": 6,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.2,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is an excellent day for playing tennis!"
    },
    {
      "indexName": "Skateboarding Forecast",
      "indexId": 7,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.9,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is an excellent day for skateboarding!"
    },
    {
      "indexName": "Outdoor Concert Forecast",
      "indexId": 8,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.7,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "Conditions are excellent for attending an outdoor concert!"
    },
    {
      "indexName": "Kite Flying Forecast",
      "indexId": 9,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 8.5,
      "category": "Very Good",
      "categoryValue": 4,
      "ascending": true,
      "description": "Conditions are very good today for kite-flying."
    },
    {
      "indexName": "Beach & Pool Forecast",
      "indexId": 10,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 8.6,
      "category": "Very Good",
      "categoryValue": 4,
      "ascending": true,
      "description": "Conditons will be very good for a visit to the beach or pool."
    },
    {
      "indexName": "Sailing Forecast",
      "indexId": 11,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 8.3,
      "category": "Very Good",
      "categoryValue": 4,
      "ascending": true,
      "description": "Conditions will be very good for sailing."
    },
    {
      "indexName": "Stargazing Forecast",
      "indexId": 12,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.5,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is a great night to be stargazing!"
    },
    {
      "indexName": "Fishing Forecast",
      "indexId": 13,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 3.5,
      "category": "Fair",
      "categoryValue": 2,
      "ascending": true,
      "description": "Expect only fair conditions for fishing."
    },
    {
      "indexName": "Ski Weather Forecast",
      "indexId": 15,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 0,
      "category": "Poor",
      "categoryValue": 1,
      "ascending": true,
      "description": "Expect poor conditions for skiing."
    },
    {
      "indexName": "Mosquito Activity Forecast",
      "indexId": 17,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 7,
      "category": "Very High",
      "categoryValue": 4,
      "ascending": true,
      "description": "The weather is favorable for a very high level of mosquito activity. Plan activities and insect repellents accordingly."
    },
    {
      "indexName": "Hunting Forecast",
      "indexId": 20,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 4.5,
      "category": "Fair",
      "categoryValue": 2,
      "ascending": true,
      "description": "Expect only fair conditions for hunting."
    },
    {
      "indexName": "Outdoor Barbecue",
      "indexId": 24,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.8,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is a great day for an outdoor barbecue!"
    },
    {
      "indexName": "Lawn Mowing Forecast",
      "indexId": 28,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 9.6,
      "category": "Excellent",
      "categoryValue": 5,
      "ascending": true,
      "description": "This is a great day for lawn mowing!"
    },
    {
      "indexName": "Outdoor Activity Forecast",
      "indexId": 29,
      "dateTime": "2020-07-14T07:00:00-04:00",
      "value": 8.7,
      "category": "Very Good",
      "categoryValue": 4,
      "ascending": true,
      "description": "Conditions will be very good for outdoor activities."
    }
  ]
}

Definitions

DailyIndex

Information about a daily index.

DailyIndicesResult

This object is returned from a successful Get Daily Indices call.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

JsonFormat

Desired format of the response. Only json format is supported.

DailyIndex

Information about a daily index.

Name Type Description
ascending
  • boolean

Describes the direction of the value and categoryValue. For example, when set to true, the poorest index value is 0 and the best index value is 10. When set to true, the poorest index value is 10 and the best index value is 0.

category
  • string

Textual description for categoryValue corresponding to the level that the index value falls under, for example "Very Good".

categoryValue
  • integer

Level that the index value falls under, represented by an integer. This value can be 1 through 5 and should be used in combination with the ascending flag because it can differ among indices. For example, the following values apply for Mosquito Activity: Low=1, Moderate=2, High=3, Very High=4, and Extreme=5.

dateTime
  • string

Date and time of the current observation displayed in ISO 8601 format, for example, 2019-10-27T19:39:57-08:00.

description
  • string

A textual explanation that can be used for display purposes to summarize the index value and category. For example, when the index value for Flight Delays is very good, the description will be "Conditions are excellent for flying!".

indexId
  • integer

Numeric ID used to identify the specific index. Please refer to Weather Service Concepts for details and to see the supported index IDs. For example, the index ID can support UI visualization scenarios.

indexName
  • string

Name of the index, for example, "Construction", "Outdoor Activity", "Flight Delays".

value
  • number

Index value. Ranges from 0.0 to 10.0. Please refer to Weather Service Concepts for details and to see the supported ranges.

DailyIndicesResult

This object is returned from a successful Get Daily Indices call.

Name Type Description
results

A list of all daily indices for the queried location.

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.

JsonFormat

Desired format of the response. Only json format is supported.

Name Type Description
json
  • string

The JavaScript Object Notation Data Interchange Format