Search - Get Search POI

Get POI by Name

Applies to: S0 and S1 pricing tiers.

Points of Interest (POI) Search allows you to request POI results by name. Search supports additional query parameters such as language and filtering results by area of interest driven by country or bounding box. Endpoint will return only POI results matching the query string. Response includes POI details such as address, coordinate location and category.

GET https://atlas.microsoft.com/search/poi/{format}?api-version=1.0&query={query}
GET https://atlas.microsoft.com/search/poi/{format}?subscription-key={subscription-key}&api-version=1.0&query={query}&typeahead={typeahead}&limit={limit}&ofs={ofs}&countrySet={countrySet}&lat={lat}&lon={lon}&radius={radius}&topLeft={topLeft}&btmRight={btmRight}&language={language}&extendedPostalCodesFor={extendedPostalCodesFor}

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 POI name to search for (e.g., "statue of liberty", "starbucks"), must be properly URL encoded.

typeahead
query
  • boolean

Boolean. If the typeahead flag is set, the query will be interpreted as a partial input and the search will enter predictive mode

limit
query
  • integer

Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100

ofs
query
  • integer

Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900

countrySet
query
  • array

Comma separated string of country codes, e.g. FR, ES. This will limit the search to the specified countries

lat
query
  • number

Latitude where results should be biased. E.g. 37.337

lon
query
  • number

Longitude where results should be biased. E.g. -121.89

radius
query
  • number

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

topLeft
query
  • string

Top left position of the bounding box. E.g. 37.553,-122.453

btmRight
query
  • string

Bottom right position of the bounding box. E.g. 37.553,-122.453

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.

extendedPostalCodesFor
query
  • string

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

Available indexes are:

POI = Points of Interest

Value should be POI or None to disable extended postal codes.

By default extended postal codes are included.

Usage examples:

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

Search for juice bars within 5 miles of Seattle Downtown and limit the response to 5 results

Sample Request

GET https://atlas.microsoft.com/search/poi/json?subscription-key=[subscription-key]&api-version=1.0&query=juice bars&limit=5&lat=47.606038&lon=-122.333345&radius=8046

Sample Response

{
  "summary": {
    "query": "juice bars",
    "queryType": "NON_NEAR",
    "queryTime": 43,
    "numResults": 5,
    "offset": 0,
    "totalResults": 10,
    "fuzzyLevel": 1,
    "geoBias": {
      "lat": 47.606038,
      "lon": -122.333345
    }
  },
  "results": [
    {
      "type": "POI",
      "id": "US/POI/p1/6816234",
      "score": 8.464,
      "dist": 1131.743149955716,
      "info": "search:ta:840539001043192-US",
      "poi": {
        "name": "Assembly Hall Juice & Coffee",
        "phone": "+(1)-(206)-8128413",
        "url": "www.assemblyhallseattle.com",
        "categories": [
          "café/pub",
          "coffee shop"
        ],
        "classifications": [
          {
            "code": "CAFE_PUB",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "coffee shop"
              },
              {
                "nameLocale": "en-US",
                "name": "café/pub"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "2121",
        "streetName": "6th Ave",
        "municipalitySubdivision": "Seattle, Belltown",
        "municipality": "Seattle",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle",
        "countrySubdivision": "WA",
        "postalCode": "98121",
        "extendedPostalCode": "981212867",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "2121 6th Ave, Seattle, WA 98121",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.61512,
        "lon": -122.34016
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.61602,
          "lon": -122.34149
        },
        "btmRightPoint": {
          "lat": 47.61422,
          "lon": -122.33883
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.61531,
            "lon": -122.33992
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p1/3816873",
      "score": 8.455,
      "dist": 1420.6447561782316,
      "info": "search:ta:840539001412283-US",
      "poi": {
        "name": "Fresh Fruit Juice LLC",
        "phone": "+(1)-(206)-3295979",
        "categories": [
          "café/pub",
          "tea house"
        ],
        "classifications": [
          {
            "code": "CAFE_PUB",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "café/pub"
              },
              {
                "nameLocale": "en-US",
                "name": "tea house"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "1043",
        "streetName": "S Jackson St",
        "municipalitySubdivision": "Yesler Terrace, Seattle, International District",
        "municipality": "Pioneer Square, International, Seattle",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle",
        "countrySubdivision": "WA",
        "postalCode": "98104",
        "extendedPostalCode": "981043029",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "1043 S Jackson St, Seattle, WA 98104",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.59891,
        "lon": -122.31762
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.59981,
          "lon": -122.31895
        },
        "btmRightPoint": {
          "lat": 47.59801,
          "lon": -122.31629
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.59921,
            "lon": -122.31762
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p1/6829423",
      "score": 8.453,
      "dist": 1486.5584783997256,
      "info": "search:ta:840539000834455-US",
      "poi": {
        "name": "Juice Bar LLC",
        "phone": "+(1)-(206)-9098879",
        "url": "www.larcheusa.org",
        "categories": [
          "shop",
          "specialty foods"
        ],
        "classifications": [
          {
            "code": "SHOP",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "specialty foods"
              },
              {
                "nameLocale": "en-US",
                "name": "shop"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "103",
        "streetName": "Bellevue Ave E",
        "municipalitySubdivision": "Seattle, Broadway",
        "municipality": "Capitol Hill, Broadway, Seattle",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle",
        "countrySubdivision": "WA",
        "postalCode": "98102",
        "extendedPostalCode": "981025594",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "103 Bellevue Ave E, Seattle, WA 98102",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.61872,
        "lon": -122.32707
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.61962,
          "lon": -122.3284
        },
        "btmRightPoint": {
          "lat": 47.61782,
          "lon": -122.32574
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.6187,
            "lon": -122.32676
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p1/6819120",
      "score": 8.308,
      "dist": 6235.7984817582947,
      "info": "search:ta:840531000416784-US",
      "poi": {
        "name": "Jamba Juice",
        "phone": "+(1)-(206)-6322060",
        "url": "www.jambajuice.com",
        "categories": [
          "restaurant",
          "yogurt/juice bar"
        ],
        "classifications": [
          {
            "code": "RESTAURANT",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "yogurt/juice bar"
              },
              {
                "nameLocale": "en-US",
                "name": "restaurant"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "4555",
        "streetName": "Stone Way N",
        "municipalitySubdivision": "Wallingford, Seattle",
        "municipality": "Wallingford, Greenwood, Seattle",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle",
        "countrySubdivision": "WA",
        "postalCode": "98103",
        "extendedPostalCode": "981036647",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "4555 Stone Way N, Seattle, WA 98103",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.66179,
        "lon": -122.34233
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.66269,
          "lon": -122.34367
        },
        "btmRightPoint": {
          "lat": 47.66089,
          "lon": -122.34099
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.66188,
            "lon": -122.34211
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p1/6731878",
      "score": 8.286,
      "dist": 6980.5798207982534,
      "info": "search:ta:840539000817372-US",
      "poi": {
        "name": "Jujubeet Juice Bar",
        "phone": "+(1)-(206)-9851000",
        "url": "www.jujubeet.com",
        "categories": [
          "bar",
          "nightlife"
        ],
        "classifications": [
          {
            "code": "NIGHTLIFE",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "bar"
              },
              {
                "nameLocale": "en-US",
                "name": "nightlife"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "4915",
        "streetName": "25th Ave NE",
        "municipalitySubdivision": "University District, Seattle, Ravenna",
        "municipality": "University, Seattle",
        "countrySecondarySubdivision": "King",
        "countryTertiarySubdivision": "Seattle",
        "countrySubdivision": "WA",
        "postalCode": "98105",
        "extendedPostalCode": "981055671",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "4915 25th Ave NE, Seattle, WA 98105",
        "countrySubdivisionName": "Washington"
      },
      "position": {
        "lat": 47.66511,
        "lon": -122.30181
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 47.66601,
          "lon": -122.30315
        },
        "btmRightPoint": {
          "lat": 47.66421,
          "lon": -122.30047
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 47.66489,
            "lon": -122.30083
          }
        }
      ]
    }
  ]
}
{
  "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

SearchPoiResponse

This object is returned from a successful Search POI call

SearchPoiResult
SearchPoiSummary

Summary object for a Search POI response

SearchResultAddress

The address of the result

SearchResultEntryPoint

The entry point for the POI being returned.

SearchResultPoi

Details of the poi including the name, phone, url, and categories.

SearchResultPoiClassification

The classification for the POI being returned

SearchResultPoiClassificationName

Name for the classification

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

SearchPoiResponse

This object is returned from a successful Search POI call

Name Type Description
results

Results array

summary

Summary object for a Search POI response

SearchPoiResult

Name Type Description
address

The address of the result

dist
  • number

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

entityType
  • string

Entity Type property

entryPoints

Entry Points array

id
  • string

Id property

info
  • string

Info property

poi

Details of the poi including the name, phone, url, and categories.

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.

SearchPoiSummary

Summary object for a Search POI 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.

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

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.

SearchResultPoi

Details of the poi including the name, phone, url, and categories.

Name Type Description
categories
  • string[]

[Deprecated] Use classifications instead. Categories array

classifications

Classification array

name
  • string

Name property

phone
  • string

Phone property

url
  • string

URL property

SearchResultPoiClassification

The classification for the POI being returned

Name Type Description
code
  • string

Code property

names

Names array

SearchResultPoiClassificationName

Name for the classification

Name Type Description
name
  • string

Name property

nameLocale
  • string

Name Locale property

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