Search - Get Search Address Structured

Structured Address Geocoding

Applies to: S0 and S1 pricing tiers.

Azure Address Geocoding can also be accessed for structured address look up exclusively. The geocoding search index will be queried for everything above the street level data. No POIs will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. It will also handle everything from exact street addresses or street or intersections as well as higher level geographies such as city centers, counties, states etc.

GET https://atlas.microsoft.com/search/address/structured/{format}?api-version=1.0&countryCode={countryCode}
GET https://atlas.microsoft.com/search/address/structured/{format}?subscription-key={subscription-key}&api-version=1.0&language={language}&countryCode={countryCode}&limit={limit}&ofs={ofs}&streetNumber={streetNumber}&streetName={streetName}&crossStreet={crossStreet}&municipality={municipality}&municipalitySubdivision={municipalitySubdivision}&countryTertiarySubdivision={countryTertiarySubdivision}&countrySecondarySubdivision={countrySecondarySubdivision}&countrySubdivision={countrySubdivision}&postalCode={postalCode}&extendedPostalCodesFor={extendedPostalCodesFor}

URI Parameters

Name In Required Type Description
format
path True

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

countrySubdivision
query
  • string

The country subdividion portion of an address

countrySecondarySubdivision
query
  • string

The county for the structured address

countryTertiarySubdivision
query
  • string

The named area for the structured address

municipalitySubdivision
query
  • string

The municipality subdivision (sub/super city) for the structured address

municipality
query
  • string

The municipality portion of an address

crossStreet
query
  • string

The cross street name for the structured address

postalCode
query
  • string

The postal code portion of an address

streetName
query
  • string

The street name portion of an address

ofs
query
  • integer

Starting offset of the returned results within the full result set

limit
query
  • integer

Maximum number of responses that will be returned

countryCode
query True
  • string

The 2 or 3 letter ISO3166-1 country code portion of an address. E.g. US.

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.

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

subscription-key
query
  • string

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

streetNumber
query
  • string

The street number portion of an address

extendedPostalCodesFor
query
  • string

Indexes for which extended postal codes should be included in the results.

Available indexes are:

Addr = Address ranges

Geo = Geographies

PAD = Point Addresses

POI = Points of Interest

Str = Streets

XStr = Cross Streets (intersections)

Value should be a comma separated list of index types (in any order) or None for no indexes.

By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.

Usage examples:

extendedPostalCodesFor=POI

extendedPostalCodesFor=PAD,Addr,POI

extendedPostalCodesFor=None

Extended postal code is returned as an extendedPostalCode property of an address. Availability is region-dependent.

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

GetSearchAddressStructured

Sample Request

GET https://atlas.microsoft.com/search/address/structured/json?subscription-key=[subscription-key]&api-version=1.0&countryCode=US&streetNumber=15127&streetName=NE%2024th%20Street&municipality=Redmond&countrySubdivision=WA&postalCode=98052

Sample Response

{
  "summary": {
    "query": "15127 98052 ne redmond wa",
    "queryType": "NON_NEAR",
    "queryTime": 57,
    "numResults": 1,
    "offset": 0,
    "totalResults": 34,
    "fuzzyLevel": 1,
    "geoBias": {
      "lat": 47.301293179130347,
      "lon": -120.88247999999997
    }
  },
  "results": [
    {
      "type": "Point Address",
      "id": "US/PAD/p0/37974392",
      "score": 8.074,
      "dist": 101274.64693865852,
      "address": {
        "streetNumber": "15127",
        "streetName": "NE 24th St",
        "municipalitySubdivision": "Redmond",
        "municipality": "Redmond, Earlmount, Avondale, Ames Lake, Adelaide",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle East",
        "countrySubdivision": "WA",
        "postalCode": "98052",
        "extendedPostalCode": "980525544",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "15127 NE 24th St, Redmond, WA 98052",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.6308,
        "lon": -122.1385
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.6317,
          "lon": -122.13983
        },
        "btmRightPoint": {
          "lat": 47.6299,
          "lon": -122.13717
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.6315,
            "lon": -122.13852
          }
        }
      ]
    }
  ]
}
{
  "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

CoordinateAbbreviated

A location represented as a latitude and longitude.

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

SearchAddressStructuredResponse

This object is returned from a successful Search Address Structured call

SearchAddressStructuredResult
SearchAddressStructuredSummary

Summary object for a Search Address Structured response

SearchResultAddress

The address of the result

SearchResultAddressRanges

Describes the address range on both sides of the street for a search result. Coordinates for the start and end locations of the address range are included.

SearchResultEntryPoint

The entry point for the POI being returned.

SearchResultViewport

The viewport that covers the result represented by the top-left and bottom-right coordinates of the viewport.

SearchSummaryGeoBias

Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal.

TextFormat

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

CoordinateAbbreviated

A location represented as a latitude and longitude.

Name Type Description
lat
  • number

Latitude property

lon
  • number

Longitude property

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

SearchAddressStructuredResponse

This object is returned from a successful Search Address Structured call

Name Type Description
results

Results array

summary

Summary object for a Search Address Structured response

SearchAddressStructuredResult

Name Type Description
address

The address of the result

addressRanges

Describes the address range on both sides of the street for a search result. Coordinates for the start and end locations of the address range are included.

dist
  • number

Straight line distance between the result and geobias location in meters.

entryPoints

Entry Points array

id
  • string

Id property

position

A location represented as a latitude and longitude.

score
  • number

The value within a result set to indicate the relative matching score between results. You can use this to determine that result x is twice as likely to be as relevant as result y if the value of x is 2x the value of y. The values vary between queries and is only meant as a relative value for one result set.

type
  • string

Type property

viewport

The viewport that covers the result represented by the top-left and bottom-right coordinates of the viewport.

SearchAddressStructuredSummary

Summary object for a Search Address Structured response

Name Type Description
fuzzyLevel
  • integer

FuzzyLevel property

geoBias

Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal.

limit
  • integer

Maximum number of responses that will be returned

numResults
  • integer

NumResults property

offset
  • integer

Offset property

query
  • string

Query property

queryTime
  • integer

QueryTime property

queryType
  • string

QueryType property

totalResults
  • integer

TotalResults 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

SearchResultAddressRanges

Describes the address range on both sides of the street for a search result. Coordinates for the start and end locations of the address range are included.

Name Type Description
from

A location represented as a latitude and longitude.

rangeLeft
  • string
rangeRight
  • string
to

A location represented as a latitude and longitude.

SearchResultEntryPoint

The entry point for the POI being returned.

Name Type Description
position

A location represented as a latitude and longitude.

type enum:
  • main
  • minor

The type of entry point. Value can be either main or minor.

SearchResultViewport

The viewport that covers the result represented by the top-left and bottom-right coordinates of the viewport.

Name Type Description
btmRightPoint

A location represented as a latitude and longitude.

topLeftPoint

A location represented as a latitude and longitude.

SearchSummaryGeoBias

Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal.

Name Type Description
lat
  • number

Latitude property

lon
  • number

Longitude 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