Weather - Get Daily Forecast

Use to get a daily detailed weather forecast for the next 1, 5, 10, 15, 25, or 45 days.

The Get Daily Forecast API is an HTTP GET request that returns detailed weather forecast such as temperature and wind by day for the next 1, 5, 10, 15, 25, or 45 days for a given coordinate location. The response includes details such as temperature, wind, precipitation, air quality, and UV index. For more information, see Request daily weather forecast data.

If you are using the Gen1 S0 pricing tier, you can request daily forecast for the next 1, 5, 10, and 15 days. If you are using Gen1 S1 or Gen2 pricing tier, you can also request daily forecast for the next 25 days, and 45 days.

GET https://atlas.microsoft.com/weather/forecast/daily/json?api-version=1.1&query={query}
GET https://atlas.microsoft.com/weather/forecast/daily/json?api-version=1.1&query={query}&unit={unit}&duration={duration}&language={language}

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.

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

Specifies for how many days the daily forecast responses are returned. Available values are

  • 1 - Return forecast data for the next day. Returned by default.
  • 5 - Return forecast data for the next 5 days.
  • 10 - Return forecast data for the next 10 days.
  • 25 - Return forecast data for the next 25 days. Only available in S1 SKU.
  • 45 - Return forecast data for the next 45 days. Only available in S1 SKU.
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.

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

DailyForecastResult

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

Successfully retrieve detailed daily weather forecast for a given coordinate location

Sample request

GET https://atlas.microsoft.com/weather/forecast/daily/json?api-version=1.1&query=62.6490341,30.0734812&duration=5

Sample response

{
  "summary": {
    "startDate": "2019-11-17T09:00:00-08:00",
    "endDate": "2019-11-17T15:00:00-08:00",
    "severity": 5,
    "phrase": "Rain Sunday evening",
    "category": "rain"
  },
  "forecasts": [
    {
      "date": "2019-11-13T21:00:00-08:00",
      "temperature": {
        "minimum": {
          "value": 0.8,
          "unit": "C",
          "unitType": 17
        },
        "maximum": {
          "value": 5.3,
          "unit": "C",
          "unitType": 17
        }
      },
      "realFeelTemperature": {
        "minimum": {
          "value": -3.4,
          "unit": "C",
          "unitType": 17
        },
        "maximum": {
          "value": 1.3,
          "unit": "C",
          "unitType": 17
        }
      },
      "realFeelTemperatureShade": {
        "minimum": {
          "value": -3.4,
          "unit": "C",
          "unitType": 17
        },
        "maximum": {
          "value": 1.6,
          "unit": "C",
          "unitType": 17
        }
      },
      "hoursOfSun": 1.1,
      "degreeDaySummary": {
        "heating": {
          "value": 15,
          "unit": "C",
          "unitType": 17
        },
        "cooling": {
          "value": 0,
          "unit": "C",
          "unitType": 17
        }
      },
      "airAndPollen": [
        {
          "name": "AirQuality",
          "value": 0,
          "category": "Good",
          "categoryValue": 1,
          "type": "Ozone"
        },
        {
          "name": "Grass",
          "value": 0,
          "category": "Low",
          "categoryValue": 1
        },
        {
          "name": "Mold",
          "value": 0,
          "category": "Low",
          "categoryValue": 1
        },
        {
          "name": "Ragweed",
          "value": 0,
          "category": "Low",
          "categoryValue": 1
        },
        {
          "name": "Tree",
          "value": 0,
          "category": "Low",
          "categoryValue": 1
        },
        {
          "name": "UVIndex",
          "value": 0,
          "category": "Low",
          "categoryValue": 1
        }
      ],
      "day": {
        "iconCode": 12,
        "iconPhrase": "Showers",
        "hasPrecipitation": true,
        "precipitationType": "Rain",
        "precipitationIntensity": "Light",
        "shortPhrase": "Cloudy with a few showers",
        "longPhrase": "Cloudy with a couple of showers, mainly later",
        "precipitationProbability": 75,
        "thunderstormProbability": 20,
        "rainProbability": 75,
        "snowProbability": 40,
        "iceProbability": 0,
        "wind": {
          "direction": {
            "degrees": 160,
            "localizedDescription": "SSE"
          },
          "speed": {
            "value": 16.7,
            "unit": "km/h",
            "unitType": 7
          }
        },
        "windGust": {
          "direction": {
            "degrees": 160,
            "localizedDescription": "SSE"
          },
          "speed": {
            "value": 48.2,
            "unit": "km/h",
            "unitType": 7
          }
        },
        "totalLiquid": {
          "value": 6.1,
          "unit": "mm",
          "unitType": 3
        },
        "rain": {
          "value": 6.1,
          "unit": "mm",
          "unitType": 3
        },
        "snow": {
          "value": 0,
          "unit": "cm",
          "unitType": 4
        },
        "ice": {
          "value": 0,
          "unit": "mm",
          "unitType": 3
        },
        "hoursOfPrecipitation": 3.5,
        "hoursOfRain": 3.5,
        "hoursOfSnow": 0,
        "hoursOfIce": 0,
        "cloudCover": 100
      },
      "night": {
        "iconCode": 12,
        "iconPhrase": "Showers",
        "hasPrecipitation": true,
        "precipitationType": "Rain",
        "precipitationIntensity": "Light",
        "shortPhrase": "Breezy early; cloudy",
        "longPhrase": "Breezy this evening; otherwise, low clouds",
        "precipitationProbability": 65,
        "thunderstormProbability": 0,
        "rainProbability": 64,
        "snowProbability": 40,
        "iceProbability": 0,
        "wind": {
          "direction": {
            "degrees": 181,
            "localizedDescription": "S"
          },
          "speed": {
            "value": 20.4,
            "unit": "km/h",
            "unitType": 7
          }
        },
        "windGust": {
          "direction": {
            "degrees": 170,
            "localizedDescription": "S"
          },
          "speed": {
            "value": 42.6,
            "unit": "km/h",
            "unitType": 7
          }
        },
        "totalLiquid": {
          "value": 4,
          "unit": "mm",
          "unitType": 3
        },
        "rain": {
          "value": 4,
          "unit": "mm",
          "unitType": 3
        },
        "snow": {
          "value": 0,
          "unit": "cm",
          "unitType": 4
        },
        "ice": {
          "value": 0,
          "unit": "mm",
          "unitType": 3
        },
        "hoursOfPrecipitation": 2.5,
        "hoursOfRain": 2.5,
        "hoursOfSnow": 0,
        "hoursOfIce": 0,
        "cloudCover": 98
      },
      "sources": [
        "AccuWeather"
      ]
    }
  ]
}

Definitions

Name Description
AirAndPollen
DailyForecast
DailyForecastResult
DailyForecastSummary

Summary for the main conditions for the requested time period. Notice that summary can cover only part of the time period.

DayOrNight
DegreeDaySummary
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

IconCode

Numeric value representing an image that displays the iconPhrase. Please refer to Weather services in Azure Maps for details.

JsonFormat

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

LocalSource

Local weather data provider information.

PrecipitationType

Specifies the type of precipitation ("Rain" "Snow" "Ice" or "Mix"). If dbz is zero, precipitationType is not present in the response.

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.

WeatherUnitRange

Returned temperature values.

WindDetails

Wind details being returned including speed and direction.

WindDirection

Wind direction

AirAndPollen

Name Type Description
category

string

Category of the air quality or pollution type. For example, low, high, good, moderate, unhealthy, hazardous.

categoryValue

integer

Value associated with the air quality or pollution category. These values range from 1 to 6. 1 implying good conditions, 6 implying hazardous conditions.

name

string

Name of the pollen or pollutant. For example, grass, mold, weed, air quality, tree and UV index.

type

string

Only exists for air quality. Examples include ozone and particle pollution.

value

integer

Value of the given type above. Values associated with mold, grass, weed and tree are in units of parts per cubic meter. Both air quality and UV are indices, so they are unitless.

DailyForecast

Name Type Description
airAndPollen

AirAndPollen[]

Air quality

date

string

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

day

DayOrNight

Day forecast detail

degreeDaySummary

DegreeDaySummary

Summary for mean temperature of Heating Degree Day or Cooling Degree Day information

hoursOfSun

number

Hours of sun.

night

DayOrNight

Night forecast detail

realFeelTemperature

WeatherUnitRange

RealFeelâ„¢ Temperature being returned.

realFeelTemperatureShade

WeatherUnitRange

RealFeelâ„¢ Temperature being returned. Describes what the temperature really feels like in the shade.

sources

string[]

Source(s) of the forecast data.

temperature

WeatherUnitRange

Temperature values for the day.

DailyForecastResult

Name Type Description
forecasts

DailyForecast[]

Forecast data for each requested day.

summary

DailyForecastSummary

Summary for the main conditions for the requested time period. Notice that summary can cover only part of the time period.

DailyForecastSummary

Summary for the main conditions for the requested time period. Notice that summary can cover only part of the time period.

Name Type Description
category

string

one or 2 word(s) to summarize the phrase.

endDate

string

Date and time that the summary period ends, displayed in ISO 8601 format, for example, 2019-10-27T19:39:57-08:00.

phrase

string

Summary phrase of the daily forecast. Displayed in specified language.

severity

integer

severity

startDate

string

Date and time that the summary is in effect, displayed in ISO 8601 format, for example, 2019-10-27T19:39:57-08:00.

DayOrNight

Name Type Description
cloudCover

integer

Percent representing cloud cover.

hasPrecipitation

boolean

Indicates the presence or absence of precipitation. True indicates the presence of precipitation, false indicates the absence of precipitation.

hoursOfIce

number

Hours of ice.

hoursOfPrecipitation

number

Hours of precipitation

hoursOfRain

number

Hours of rain.

hoursOfSnow

number

Hours of snow.

ice

WeatherUnit

Ice

iceProbability

integer

Percent representing the probability of ice. For example, '30'.

iconCode

IconCode

Numeric value representing an image that displays the iconPhrase. Please refer to Weather services in Azure Maps for details.

iconPhrase

string

Phrase description of the icon. Displayed in specified language. For example, 'Sunny'.

localSource

LocalSource

Local weather data provider information.

longPhrase

string

Phrase description of the forecast in specified language. Azure Maps attempts to keep this phrase under 100 characters in length, but some languages/weather events may result in a longer phrase length, exceeding 100 characters.

precipitationIntensity

string

Description of the intensity.

precipitationProbability

integer

Percent representing the probability of precipitation. For example, '20'.

precipitationType

PrecipitationType

Specifies the type of precipitation ("Rain" "Snow" "Ice" or "Mix"). If dbz is zero, precipitationType is not present in the response.

rain

WeatherUnit

Rain

rainProbability

integer

Percent representing the probability of rain. For example, '40'.

shortPhrase

string

Phrase description of the forecast in specified language. Azure Maps attempts to keep this phrase under 30 characters in length, but some languages/weather events may result in a longer phrase length, exceeding 30 characters.

snow

WeatherUnit

Snow

snowProbability

integer

Percent representing the probability of snow. For example, '30'.

thunderstormProbability

integer

Percent representing the probability of a thunderstorm. For example, '80'.

totalLiquid

WeatherUnit

Total liquid equivalent of precipitation during the forecast period.

wind

WindDetails

Wind details being returned including speed and direction.

windGust

WindDetails

Wind gust. Wind gust is a sudden, brief increase in speed of the wind.

DegreeDaySummary

Name Type Description
cooling

WeatherUnit

Number of degrees that the mean temperature is above 65 degrees F/ 18 degree C.

heating

WeatherUnit

Number of degrees that the mean temperature is below 65 degrees F/ 18 degree C.

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.

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

The JavaScript Object Notation Data Interchange Format

LocalSource

Local weather data provider information.

Name Type Description
id

integer

Numeric identifier, unique to the local data provider.

name

string

Name of the local data provider. Name is displayed in the language specified by language code in URL, if available. Otherwise, Name is displayed in English or the language in which the name was provided.

weatherCode

string

Weather code provided by the local data provider. This weather code allows the forecast to be matched to icons provided by the local data provider instead of Azure Maps icons.

PrecipitationType

Specifies the type of precipitation ("Rain" "Snow" "Ice" or "Mix"). If dbz is zero, precipitationType is not present in the response.

Name Type Description
Ice

string

Ice

Mix

string

Mix

Rain

string

Rain

Snow

string

Snow

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.

WeatherUnitRange

Returned temperature values.

Name Type Description
maximum

WeatherUnit

Maximum temperature for the time period

minimum

WeatherUnit

Minimum temperature for the time period.

WindDetails

Wind details being returned including speed and direction.

Name Type Description
direction

WindDirection

Wind direction

speed

WeatherUnit

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.