Search - Get Search POI Category

Get POI by Category

If your search use case only requires POI results filtered by category, you may use the category endpoint. This endpoint will only return POI results which are categorized as specified.

List of available categories can be found here.

GET https://atlas.microsoft.com/search/poi/category/{format}?subscription-key={subscription-key}&api-version=1.0&query={query}
GET https://atlas.microsoft.com/search/poi/category/{format}?subscription-key={subscription-key}&api-version=1.0&query={query}&typeahead={typeahead}&limit={limit}&multiplier={multiplier}&routingTimeout={routingTimeout}&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 True
  • string

Azure Maps subscription key

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

query
query True
  • string

The POI category to search for (e.g., "AIRPORT", "BEACH"), 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

multiplier
query
  • integer

Multiplies the limit by this value to gather more candidate POIs, which will then be sorted by drive distance, returning only the top candidates according to the limit.

routingTimeout
query
  • integer

Number of milliseconds routing engine can take to give the results.

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:

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.

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. Make sure to provide a valid key for an active subscription.

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

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"

Examples

Search for atm's within 2 miles of Times Square NY and return the top 3 results

Sample Request

GET https://atlas.microsoft.com/search/poi/category/json?subscription-key=[subscription-key]&api-version=1.0&query=atm&limit=3&lat=40.758953&lon=-73.985263&radius=3200

Sample Response

{
  "summary": {
    "query": "atm",
    "queryType": "NON_NEAR",
    "queryTime": 49,
    "numResults": 3,
    "offset": 0,
    "totalResults": 3512,
    "fuzzyLevel": 1,
    "geoBias": {
      "lat": 40.758953,
      "lon": -73.985263
    }
  },
  "results": [
    {
      "type": "POI",
      "id": "US/POI/p1/2132991",
      "score": 5,
      "dist": 10.743802093311858,
      "info": "search:ta:840369001846523-US",
      "poi": {
        "name": "FISERV MASTERMONEY",
        "categories": [
          "cash dispenser"
        ],
        "classifications": [
          {
            "code": "CASH_DISPENSER",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "cash dispenser"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "1560",
        "streetName": "Broadway",
        "municipalitySubdivision": "New York City, NYC, Times Square, New York, Midtown",
        "municipality": "New York City, NYC, NY City, NY, Manhattan, New York",
        "countrySecondarySubdivision": "New York",
        "countryTertiarySubdivision": "Manhattan",
        "countrySubdivision": "NY",
        "postalCode": "10036",
        "extendedPostalCode": "100361517",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "1560 Broadway, New York, NY 10036",
        "countrySubdivisionName": "New York"
      },
      "position": {
        "lat": 40.75901,
        "lon": -73.98516
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 40.75991,
          "lon": -73.98635
        },
        "btmRightPoint": {
          "lat": 40.75811,
          "lon": -73.98397
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 40.75902,
            "lon": -73.98522
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p1/2135024",
      "score": 4.998,
      "dist": 55.009653221373966,
      "info": "search:ta:840369001359393-US",
      "poi": {
        "name": "ATM",
        "categories": [
          "cash dispenser"
        ],
        "classifications": [
          {
            "code": "CASH_DISPENSER",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "cash dispenser"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "1552",
        "streetName": "Broadway",
        "municipalitySubdivision": "New York City, NYC, Times Square, New York, Midtown",
        "municipality": "New York City, NYC, NY City, NY, Manhattan, New York",
        "countrySecondarySubdivision": "New York",
        "countryTertiarySubdivision": "Manhattan",
        "countrySubdivision": "NY",
        "postalCode": "10036",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "1552 Broadway, New York, NY 10036",
        "countrySubdivisionName": "New York"
      },
      "position": {
        "lat": 40.75873,
        "lon": -73.98468
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 40.75963,
          "lon": -73.98587
        },
        "btmRightPoint": {
          "lat": 40.75783,
          "lon": -73.98349
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 40.7588,
            "lon": -73.98492
          }
        }
      ]
    },
    {
      "type": "POI",
      "id": "US/POI/p0/2421307",
      "score": 4.998,
      "dist": 58.681073545012559,
      "info": "search:ta:840369003262975-US",
      "poi": {
        "name": "Metabank",
        "categories": [
          "cash dispenser"
        ],
        "classifications": [
          {
            "code": "CASH_DISPENSER",
            "names": [
              {
                "nameLocale": "en-US",
                "name": "cash dispenser"
              }
            ]
          }
        ]
      },
      "address": {
        "streetNumber": "1567",
        "streetName": "Broadway",
        "municipalitySubdivision": "New York City, NYC, Times Square, New York, Midtown",
        "municipality": "New York City, NYC, NY City, NY, Manhattan, New York",
        "countrySecondarySubdivision": "New York",
        "countryTertiarySubdivision": "Manhattan",
        "countrySubdivision": "NY",
        "postalCode": "10036",
        "extendedPostalCode": "100361517",
        "countryCode": "US",
        "country": "United States Of America",
        "countryCodeISO3": "USA",
        "freeformAddress": "1567 Broadway, New York, NY 10036",
        "countrySubdivisionName": "New York"
      },
      "position": {
        "lat": 40.75937,
        "lon": -73.98569
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 40.76027,
          "lon": -73.98688
        },
        "btmRightPoint": {
          "lat": 40.75847,
          "lon": -73.9845
        }
      },
      "entryPoints": [
        {
          "type": "main",
          "position": {
            "lat": 40.75924,
            "lon": -73.98513
          }
        }
      ]
    }
  ]
}
{
  "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

SearchPoiCategoryResponse

This object is returned from a successful Search POI Category call

SearchPoiCategoryResult
SearchPoiCategorySummary

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

SearchPoiCategoryResponse

This object is returned from a successful Search POI Category call

Name Type Description
results

Results array

summary

Summary object for a Search POI Category response

SearchPoiCategoryResult

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.

SearchPoiCategorySummary

Summary object for a Search POI Category 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[]

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