Weather - Get Current Conditions

Get Current Conditions

Applies to: see pricing tiers.

Get Current Conditions service returns detailed current weather conditions such as precipitation, temperature and wind for a given coordinate location. Also, observations from the past 6 or 24 hours for a particular location can be retrieved. The basic information returned with the response include details such as observation date and time, brief description of the weather conditions, weather icon, precipitation indicator flags, and temperature. Additional details such as RealFeelâ„¢ Temperature and UV index are also returned.

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

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

details
query
  • string

Return full details for the current conditions. Available values are

  • true - Returns full details. By default all details are returned.
  • false - Returns a truncated version of the current condition data, which includes observation date time, weather phrase, icon code, precipitation indicator flag, and temperature.
duration
query
  • integer

Time frame of the returned weather conditions. By default, the most current weather conditions will be returned. Default value is 0. Supported values are:

  • 0 - Return the most current weather conditions.
  • 6 - Return weather conditions from past 6 hours.
  • 24 - Return weather conditions from past 24 hours.
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

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 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 detailed current weather conditions for a given coordinate location

Sample Request

GET https://atlas.microsoft.com/weather/currentConditions/json?api-version=1.1&query=47.641268,-122.125679

Sample Response

{
  "results": [
    {
      "dateTime": "2019-11-14T15:08:00-08:00",
      "phrase": "Cloudy",
      "iconCode": 7,
      "hasPrecipitation": false,
      "isDayTime": true,
      "temperature": {
        "value": 13.7,
        "unit": "C",
        "unitType": 17
      },
      "realFeelTemperature": {
        "value": 13.6,
        "unit": "C",
        "unitType": 17
      },
      "realFeelTemperatureShade": {
        "value": 13.6,
        "unit": "C",
        "unitType": 17
      },
      "relativeHumidity": 75,
      "dewPoint": {
        "value": 9.2,
        "unit": "C",
        "unitType": 17
      },
      "wind": {
        "direction": {
          "degrees": 315,
          "localizedDescription": "NW"
        },
        "speed": {
          "value": 3.6,
          "unit": "km/h",
          "unitType": 7
        }
      },
      "windGust": {
        "speed": {
          "value": 4.9,
          "unit": "km/h",
          "unitType": 7
        }
      },
      "uvIndex": 0,
      "uvIndexPhrase": "Low",
      "visibility": {
        "value": 8,
        "unit": "km",
        "unitType": 6
      },
      "obstructionsToVisibility": "",
      "cloudCover": 95,
      "ceiling": {
        "value": 4359,
        "unit": "m",
        "unitType": 5
      },
      "pressure": {
        "value": 1014.9,
        "unit": "mb",
        "unitType": 14
      },
      "pressureTendency": {
        "localizedDescription": "Steady",
        "code": "S"
      },
      "pastTwentyFourHourTemperatureDeparture": {
        "value": 1.8,
        "unit": "C",
        "unitType": 17
      },
      "apparentTemperature": {
        "value": 16.1,
        "unit": "C",
        "unitType": 17
      },
      "windChillTemperature": {
        "value": 13.9,
        "unit": "C",
        "unitType": 17
      },
      "wetBulbTemperature": {
        "value": 11.4,
        "unit": "C",
        "unitType": 17
      },
      "precipitationSummary": {
        "pastHour": {
          "value": 0.5,
          "unit": "mm",
          "unitType": 3
        },
        "pastThreeHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        },
        "pastSixHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        },
        "pastNineHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        },
        "pastTwelveHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        },
        "pastEighteenHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        },
        "pastTwentyFourHours": {
          "value": 0.8,
          "unit": "mm",
          "unitType": 3
        }
      },
      "temperatureSummary": {
        "pastSixHours": {
          "minimum": {
            "value": 8.3,
            "unit": "C",
            "unitType": 17
          },
          "maximum": {
            "value": 13.7,
            "unit": "C",
            "unitType": 17
          }
        },
        "pastTwelveHours": {
          "minimum": {
            "value": 5.9,
            "unit": "C",
            "unitType": 17
          },
          "maximum": {
            "value": 13.7,
            "unit": "C",
            "unitType": 17
          }
        },
        "pastTwentyFourHours": {
          "minimum": {
            "value": 5.9,
            "unit": "C",
            "unitType": 17
          },
          "maximum": {
            "value": 13.7,
            "unit": "C",
            "unitType": 17
          }
        }
      }
    }
  ]
}

Definitions

CurrentConditions
CurrentConditionsResult
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 Service Concepts for details.

JsonFormat

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

PastHoursTemperature

Summary of temperature fluctuations over the number of past hours.

PrecipitationSummary
PressureTendency
TemperatureSummary
UnitType

Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather Service Concepts 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.

WindDetails

Wind details being returned including speed and direction.

WindDirection

Wind direction

CurrentConditions

Name Type Description
apparentTemperature

Perceived outdoor temperature caused by the combination of air temperature, relative humidity, and wind speed in specified unit.

ceiling

Cloud ceiling in specified unit. The ceiling is a measurement of the height of the base of the lowest clouds.

cloudCover
  • integer

Percent representing cloud cover.

dateTime
  • string

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

dewPoint

The dewpoint temperature in specified unit. The dewpoint temperature is the temperature that the air must be cooled to in order to reach saturation.

hasPrecipitation
  • boolean

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

iconCode

Numeric value representing an image that displays the iconPhrase. Please refer to Weather Service Concepts for details.

isDayTime
  • boolean

Indicates the time of the day. True indicates 'day',', false indicates 'night.

obstructionsToVisibility
  • string

Cause of limited visibility.

pastTwentyFourHourTemperatureDeparture

Departure from the temperature observed 24 hours ago in specified unit.

phrase
  • string

Phrase description of the current weather condition. Displayed in specified language.

precipitationSummary

Summary of precipitation amounts over the past 24 hours.

pressure

Atmospheric pressure in specified unit.

pressureTendency

Atmospheric pressure change.

realFeelTemperature

RealFeelâ„¢ Temperature being returned.

realFeelTemperatureShade

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

relativeHumidity
  • integer

Relative humidity is the amount of water vapor present in air expressed as a percentage of the amount needed for saturation at the same temperature.

temperature

Temperature being returned.

temperatureSummary

Summary of temperature fluctuations over the past 6, 12, and 24 hours.

uvIndex
  • integer

Measure of the strength of the ultraviolet radiation from the sun. Supported values are:

  • 0-2 - Low danger from the sun's UV rays or the average person.
  • 3-5 - Moderate risk of harm from unprotected sun exposure.
  • 6-7 - High risk of harm from unprotected sun exposure.
  • 8-10 - Very high risk of harm from unprotected sun exposure.
  • 11+ - Extreme risk of harm from unprotected sun exposure.
uvIndexPhrase
  • string

Phrase associated with the uvIndex.

visibility

Visibility in specified unit. A measure of the distance at which an object or light can be clearly discerned.

wetBulbTemperature

The temperature to which air may be cooled by evaporating water into it at constant pressure until it reaches saturation.

wind

Wind details being returned including speed and direction.

windChillTemperature

Perceived air temperature on exposed skin due to wind.

windGust

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

CurrentConditionsResult

Name Type Description
results

Detailed current weather conditions.

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.

IconCode

Numeric value representing an image that displays the iconPhrase. Please refer to Weather Service Concepts 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

PastHoursTemperature

Summary of temperature fluctuations over the number of past hours.

Name Type Description
maximum

maximum

minimum

minimum

PrecipitationSummary

Name Type Description
pastEighteenHours

The amount of precipitation (liquid equivalent) that has fallen in the past 18 hours.

pastHour

The amount of precipitation (liquid equivalent) that has fallen in the past hour.

pastNineHours

The amount of precipitation (liquid equivalent) that has fallen in the past nine hours.

pastSixHours

The amount of precipitation (liquid equivalent) that has fallen in the past six hours. Contains Metric and Imperial Values.

pastThreeHours

The amount of precipitation (liquid equivalent) that has fallen in the past three hours.

pastTwelveHours

The amount of precipitation (liquid equivalent) that has fallen in the past 12 hours.

pastTwentyFourHours

The amount of precipitation (liquid equivalent) that has fallen in the past 24 hours.

PressureTendency

Name Type Description
code
  • string

Pressure tendency code regardless of language. One of F=Falling, S=Steady, R=Rising.

localizedDescription
  • string

Description of the pressure tendency in specified language

TemperatureSummary

Name Type Description
pastSixHours

Summary of temperature fluctuations over the past 6 hours.

pastTwelveHours

Summary of temperature fluctuations over the past 12 hours.

pastTwentyFourHours

Summary of temperature fluctuations over the past 24 hours.

UnitType

Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather Service Concepts 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

Numeric ID value associated with the type of unit being displayed. Can be used for unit translation. Please refer to Weather Service Concepts for details.

value
  • number

Rounded value.

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.