Weather - Get Daily Historical Records

Use to get climatology data such as past daily record temperatures, precipitation and snowfall at a given location.

The Get Daily Historical Records API is an HTTP GET request that returns climatology data such as past daily record temperatures, precipitation and snowfall at a given coordinate location. Availability of records data will vary by location. Generally, historical data may be available as far back as the last 5 to 40+ years, depending on the location.

GET https://atlas.microsoft.com/weather/historical/records/daily/json?api-version=1.1&query={query}&startDate={startDate}&endDate={endDate}
GET https://atlas.microsoft.com/weather/historical/records/daily/json?api-version=1.1&query={query}&startDate={startDate}&endDate={endDate}&unit={unit}

URI Parameters

Name In Required Type Description
format
path True

JsonFormat

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

api-version
query True

string

Version number of Azure Maps API.

endDate
query True

string

date

End date in ISO 8601 format, for example, 2019-10-28. The date range supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31).

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".

startDate
query True

string

date

Start date in ISO 8601 format, for example, 2019-10-27. The date range supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31).

unit
query

WeatherDataUnit

Specifies to return the data in either metric units or imperial units. Default value is metric.

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

DailyHistoricalRecordsResult

OK

Other Status Codes

ErrorResponse

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.

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

Successful Daily Historical Records Request

Sample request

GET https://atlas.microsoft.com/weather/historical/records/daily/json?api-version=1.1&query=39.952583,-75.165222&startDate=2012-01-20&endDate=2012-01-22

Sample response

{
  "results": [
    {
      "date": "2012-01-20T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 18.3,
          "unit": "C",
          "unitType": 17,
          "year": 1951
        },
        "minimum": {
          "value": -19.4,
          "unit": "C",
          "unitType": 17,
          "year": 1984
        },
        "average": {
          "value": -0.6,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "maximum": {
          "value": 48,
          "unit": "mm",
          "unitType": 3,
          "year": 1978
        }
      },
      "snowfall": {
        "maximum": {
          "value": 12.19,
          "unit": "cm",
          "unitType": 4,
          "year": 1978
        }
      }
    },
    {
      "date": "2012-01-21T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 16.7,
          "unit": "C",
          "unitType": 17,
          "year": 1959
        },
        "minimum": {
          "value": -21.1,
          "unit": "C",
          "unitType": 17,
          "year": 1985
        },
        "average": {
          "value": -2.2,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "maximum": {
          "value": 33.5,
          "unit": "mm",
          "unitType": 3,
          "year": 1979
        }
      },
      "snowfall": {
        "maximum": {
          "value": 34.29,
          "unit": "cm",
          "unitType": 4,
          "year": 2014
        }
      }
    },
    {
      "date": "2012-01-22T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 21.1,
          "unit": "C",
          "unitType": 17,
          "year": 1906
        },
        "minimum": {
          "value": -21.7,
          "unit": "C",
          "unitType": 17,
          "year": 1984
        },
        "average": {
          "value": -0.3,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "maximum": {
          "value": 26.2,
          "unit": "mm",
          "unitType": 3,
          "year": 1987
        }
      },
      "snowfall": {
        "maximum": {
          "value": 22.35,
          "unit": "cm",
          "unitType": 4,
          "year": 1987
        }
      }
    }
  ]
}

Definitions

Name Description
DailyHistoricalRecords
DailyHistoricalRecordsResult
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.

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.

WeatherDataUnit

Specifies to return the data in either metric units or imperial units. Default value is metric.

WeatherUnit

Specific value of a given unit related to weather.

WeatherUnitYear
WeatherUnitYearMax

Returned temperature values.

WeatherUnitYearMaxMinAvg

Returned temperature values.

DailyHistoricalRecords

Name Type Description
date

string

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

precipitation

WeatherUnitYearMax

Maximum amount of precipitation (liquid equivalent) that has fallen.

snowfall

WeatherUnitYearMax

Maximum snowfall.

temperature

WeatherUnitYearMaxMinAvg

Temperature value.

DailyHistoricalRecordsResult

Name Type Description
nextLink

string

The is the link to the next page of the features returned. If it's the last page, no this field.

results

DailyHistoricalRecords[]

Historical records for each requested day.

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

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

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

WeatherDataUnit

Specifies to return the data in either metric units or imperial units. Default value is metric.

Name Type Description
imperial

string

Return data in imperial units. Some example units of imperial system are Fahrenheit and mile.

metric

string

Return data in metric units. Some example units of metric system are Celsius and kilometer.

WeatherUnit

Specific value of a given unit related to weather.

Name Type Description
unit

string

Type of unit for the returned value.

unitType

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.

WeatherUnitYear

Name Type Description
unit

string

Type of unit for the returned value.

unitType

integer

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.

year

integer

Year the value occurred.

WeatherUnitYearMax

Returned temperature values.

Name Type Description
maximum

WeatherUnitYear

Maximum temperature for the time period.

WeatherUnitYearMaxMinAvg

Returned temperature values.

Name Type Description
average

WeatherUnit

Average temperature for the time period.

maximum

WeatherUnitYear

Maximum temperature for the time period.

minimum

WeatherUnitYear

Minimum temperature for the time period.