Search - Get Search Address Reverse

Reverse Geocode to an Address

Applies to: S0 and S1 pricing tiers.

There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.

GET https://atlas.microsoft.com/search/address/reverse/{format}?api-version=1.0&query={query}
GET https://atlas.microsoft.com/search/address/reverse/{format}?subscription-key={subscription-key}&api-version=1.0&query={query}&language={language}&returnSpeedLimit={returnSpeedLimit}&heading={heading}&radius={radius}&number={number}&returnRoadUse={returnRoadUse}&roadUse={roadUse}&allowFreeformNewline={allowFreeformNewline}&dateTime={dateTime}&returnMatchType={returnMatchType}

URI Parameters

Name In Required Type Description
format
path True

Desired format of the response. Value can be either json or xml.

subscription-key
query
  • string

One of the Azure Maps keys provided from an Azure Map Account. Refer to the subscription-key security definition.

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

query
query True
  • string

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

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.

returnSpeedLimit
query
  • boolean

Boolean. To enable return of the posted speedlimit

heading
query
  • number

The directional heading of the vehicle in degrees, for travel along a segment of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can include upto one decimal place

radius
query
  • number

The radius in meters to for the results to be constrained to the defined area

number
query
  • string

If a number is sent in along with the request, the response may include the side of the street (Left/Right) and also an offset position for that number

returnRoadUse
query
  • boolean

Boolean. To enable return of the road use array for reversegeocodes at street level

roadUse
query
  • string

To restrict reversegeocodes to a certain type of roaduse. The road use array for reversegeocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary, LocalStreet

allowFreeformNewline
query
  • boolean

Format of newlines in the formatted address.

If true, the address will contain newlines. If false, newlines will be converted to commas.

dateTime
query
  • string
date-time

The date and time to return time zone information for. It allows the service to decide whether Daylight Saving Time time zone should be used or not. It must conform to RFC-3339.

Examples:

  • 2017-12-19T16:39:57
  • 2017-12-19T16:39:57-08:00
returnMatchType
query
  • boolean

Include information on the type of match the geocoder achieved in the response.

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

Media Types: "application/json", "application/xml"

400 Bad Request

Bad request: one or more parameters were incorrectly specified or are mutually exclusive.

Media Types: "application/json", "application/xml"

401 Unauthorized

Access denied due to invalid subscription key or invalid Azure Active Directory bearer token. Make sure to provide a valid key for an active Azure subscription and Maps resource. Otherwise, verify the WWW-Authenticate header for error code and description of the provided AAD bearer token.

Media Types: "application/json", "application/xml"

Headers

  • WWW-Authenticate: string
403 Forbidden

Permission, capacity, or authentication issues.

Media Types: "application/json", "application/xml"

404 Not Found

Not Found: the requested resource could not be found, but it may be available again in the future.

Media Types: "application/json", "application/xml"

500 Internal Server Error

An error occurred while processing the request. Please try again later.

Media Types: "application/json", "application/xml"

Security

azure_auth

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.

Note

  • 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 tokens are supported.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

subscription-key

This is a shared key which is provisioned when creating an Azure Maps resource through the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs. With this key, any application is authorized to access all REST APIs. In other words, these can currently be treated as master keys to the account which they are issued for. For publicly exposed applications our recommendation is to use server to server access of Azure Maps REST APIs where this key can be securely stored.

Type: apiKey
In: query

Examples

GetSearchAddressReverse

Sample Request

GET https://atlas.microsoft.com/search/address/reverse/json?subscription-key=[subscription-key]&api-version=1.0&query=37.337,-121.89

Sample Response

{
  "summary": {
    "queryTime": 5,
    "numResults": 1
  },
  "addresses": [
    {
      "address": {
        "buildingNumber": "31",
        "streetNumber": "31",
        "routeNumbers": [],
        "street": "N 2nd St",
        "streetName": "N 2nd St",
        "streetNameAndNumber": "31 N 2nd St",
        "countryCode": "US",
        "countrySubdivision": "CA",
        "countrySubdivisionName": "California",
        "municipality": "San Jose",
        "postalCode": "95113",
        "country": "United States of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "31 N 2nd St, San Jose CA 95113",
        "extendedPostalCode": "951131217"
      },
      "position": "37.337090,-121.889820"
    }
  ]
}
{
  "error": {
    "code": "400 BadRequest",
    "message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
  }
}
{
  "error": {
    "code": "401 Unauthorized",
    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
  }
}
{
  "error": {
    "code": "403 Forbidden",
    "message": "Permission, capacity, or authentication issues."
  }
}
{
  "error": {
    "code": "404 NotFound",
    "message": "Not Found: the requested resource could not be found, but it may be available again in the future."
  }
}
{
  "error": {
    "code": "500 InternalServerError",
    "message": "An error occurred while processing the request. Please try again later."
  }
}

Definitions

Error

This object is returned when an error occurs in the Maps API

ErrorResponse

This response object is returned when an error occurs in the Maps API

SearchAddressReverseResponse

This object is returned from a successful Search Address Reverse call

SearchAddressReverseResult
SearchAddressReverseSummary

Summary object for a Search Address Reverse response

SearchResultAddress

The address of the result

TextFormat

Desired format of the response. Value can be either json or xml.

Error

This object is returned when an error occurs in the Maps API

Name Type Description
code
  • string

The HTTP status code.

message
  • string

If available, a human readable description of the error.

ErrorResponse

This response object is returned when an error occurs in the Maps API

Name Type Description
error

This object is returned when an error occurs in the Maps API

SearchAddressReverseResponse

This object is returned from a successful Search Address Reverse call

Name Type Description
addresses

Addresses array

summary

Summary object for a Search Address Reverse response

SearchAddressReverseResult

Name Type Description
address

The address of the result

position
  • string

Position property in the form of "{latitude},{longitude}"

SearchAddressReverseSummary

Summary object for a Search Address Reverse response

Name Type Description
numResults
  • integer

NumResults property

queryTime
  • integer

QueryTime property

SearchResultAddress

The address of the result

Name Type Description
buildingNumber
  • string

Building Number property

country
  • string

Country property

countryCode
  • string

Country Code property

countryCodeISO3
  • string

Country Code ISO3 property

countrySecondarySubdivision
  • string

Country Secondary Subdivision property

countrySubdivision
  • string

Country Subdivision property

countrySubdivisionName
  • string

Country Subdividion Name property

countryTertiarySubdivision
  • string

Country Tertiary Subdivision property

crossStreet
  • string

Cross Street property

extendedPostalCode
  • string

Extended Postal Code property

freeformAddress
  • string

Free form Address property

municipality
  • string

Municipality property

municipalitySubdivision
  • string

Municipality Subdivision property

postalCode
  • string

Postal Code property

routeNumbers
  • integer[]

number of routes

street
  • string

Street property

streetName
  • string

Street Name property

streetNameAndNumber
  • string

Street Name and Number property

streetNumber
  • string

Street Number property

TextFormat

Desired format of the response. Value can be either json or xml.

Name Type Description
json
  • string

The JavaScript Object Notation Data Interchange Format

xml
  • string

The Extensible Markup Language