Azure Maps Search Service (stable:2025-01-01)

2025/01/17 • 5 new methods

Search_GetGeocoding (new)
Description The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched. In many cases, the complete search service might be too much, for instance if you are only interested in traditional geocoding. Search can also be accessed for address look up exclusively. The geocoding is performed by hitting the geocoding endpoint with just the address or partial address in question. The geocoding search index will be queried for everything above the street level data. No Point of Interest (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 and states. The response also returns detailed address properties such as street, postal code, municipality, and country/region information.
Reference Link ¶

⚼ Request

GET:  /geocode
{
api-version: string ,
Accept-Language: string ,
top: integer ,
query: string ,
addressLine: string ,
countryRegion: string ,
bbox: array ,
view: string ,
coordinates: array ,
adminDistrict: string ,
adminDistrict2: string ,
adminDistrict3: string ,
locality: string ,
postalCode: string ,
x-ms-client-id: string ,
}

⚐ Response (200)

{
$headers:
{
x-ms-request-id: string ,
}
,
$schema:
{
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
Search_GetGeocodingBatch (new)
Description The `Get Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to the [Geocoding](/rest/api/maps/search/get-geocoding) API in a single request. ### Submit Synchronous Batch Request The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API. ``` POST https://atlas.microsoft.com/geocode:batch?api-version=2023-06-01 ``` ### POST Body for Batch Request To send the _geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _geocoding_ queries: ``` { "batchItems": [ { "addressLine": "One, Microsoft Way, Redmond, WA 98052", "top": 2 }, { "addressLine": "Pike Pl", "adminDistrict": "WA", "locality": "Seattle", "top": 3 } ] } ``` A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters). The batch should contain at least **1** query. ### Batch Response Model The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully. - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
Reference Link ¶

⚼ Request

POST:  /geocode:batch
{
x-ms-client-id: string ,
api-version: string ,
Accept-Language: string ,
geocodingBatchRequestBody:
{
batchItems:
[
{
optionalId: string ,
top: integer ,
query: string ,
addressLine: string ,
countryRegion: string ,
bbox:
[
number ,
]
,
view: string ,
coordinates:
[
number ,
]
,
adminDistrict: string ,
adminDistrict2: string ,
adminDistrict3: string ,
locality: string ,
postalCode: string ,
}
,
]
,
}
,
}

⚐ Response (200)

{
summary:
{
successfulRequests: integer ,
totalRequests: integer ,
}
,
batchItems:
[
{
optionalId: string ,
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
Search_GetPolygon (new)
Description The `Get Polygon` API is an HTTP `GET` request that supplies polygon data of a geographical area outline such as a city or a country region.
Reference Link ¶

⚼ Request

GET:  /search/polygon
{
x-ms-client-id: string ,
api-version: string ,
Accept-Language: string ,
coordinates: array ,
view: string ,
resultType: string ,
resolution: string ,
}

⚐ Response (200)

{
type: enum ,
geometry: object ,
properties:
{
name: string ,
copyright: string ,
copyrightURL: string ,
geometriesCopyright:
[
{
sourceName: string ,
copyright: string ,
}
,
]
,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
Search_GetReverseGeocoding (new)
Description The `Get Reverse Geocoding` API is an HTTP `GET` request used to translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Useful in tracking applications where you receive a GPS feed from the device or asset and wish to know the address associated with the coordinates. This endpoint will return address information for a given coordinate.
Reference Link ¶

⚼ Request

GET:  /reverseGeocode
{
x-ms-client-id: string ,
api-version: string ,
Accept-Language: string ,
coordinates: array ,
resultTypes: array ,
view: string ,
}

⚐ Response (200)

{
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
Search_GetReverseGeocodingBatch (new)
Description The `Get Reverse Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to [Reverse Geocoding](/rest/api/maps/search/get-reverse-geocoding) API using a single request. ### Submit Synchronous Batch Request The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API. ``` POST https://atlas.microsoft.com/reverseGeocode:batch?api-version=2023-06-01 ``` ### POST Body for Batch Request To send the _reverse geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _reverse geocoding_ queries: ``` { "batchItems": [ { "coordinates": [-122.128275, 47.639429], "resultTypes": ["Address", "PopulatedPlace"] }, { "coordinates": [-122.341979399674, 47.6095253501216] } ] } ``` A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters). The batch should contain at least **1** query. ### Batch Response Model The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types: - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully. - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
Reference Link ¶

⚼ Request

POST:  /reverseGeocode:batch
{
x-ms-client-id: string ,
api-version: string ,
Accept-Language: string ,
reverseGeocodingBatchRequestBody:
{
batchItems:
[
{
optionalId: string ,
coordinates:
[
number ,
]
,
resultTypes:
[
string ,
]
,
view: string ,
}
,
]
,
}
,
}

⚐ Response (200)

{
summary:
{
successfulRequests: integer ,
totalRequests: integer ,
}
,
batchItems:
[
{
optionalId: string ,
type: enum ,
features:
[
{
type: enum ,
id: string ,
properties:
{
type: string ,
confidence: enum ,
matchCodes:
[
string ,
]
,
address:
{
addressLine: string ,
locality: string ,
neighborhood: string ,
adminDistricts:
[
{
name: string ,
shortName: string ,
}
,
]
,
postalCode: string ,
countryRegion:
{
ISO: string ,
name: string ,
}
,
formattedAddress: string ,
streetName: string ,
streetNumber: string ,
intersection:
{
baseStreet: string ,
secondaryStreet1: string ,
secondaryStreet2: string ,
intersectionType: string ,
displayName: string ,
}
,
}
,
geocodePoints:
[
{
geometry: object ,
calculationMethod: enum ,
usageTypes:
[
string ,
]
,
}
,
]
,
}
,
geometry: object ,
bbox:
[
number ,
]
,
}
,
]
,
nextLink: string ,
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}