@azure-rest/maps-search package

Interfaces

AddressAdminDistrictsItemOutput
AddressCountryRegionOutput
AddressOutput

The address of the result

BoundaryOutput

GeoJSON GeocodingFeature object that describe the boundaries of a geographical area. Geometry of the feature is described with GeoJSON GeometryCollection.

Please note, the service typically returns a GeometryCollection with Polygon or MultiPolygon sub-types.

BoundaryPropertiesOutput

Properties of a Boundary object.

ErrorAdditionalInfoOutput

The resource management error additional info.

ErrorDetailOutput

The error detail.

ErrorResponseOutput

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

FeaturesItemOutput
FeaturesItemPropertiesOutput
GeoJsonFeatureCollectionDataOutput
GeoJsonFeatureCollectionOutput

A valid GeoJSON FeatureCollection object type. Please refer to RFC 7946 for details.

GeoJsonFeatureDataOutput
GeoJsonFeatureOutputParent

A valid GeoJSON Feature object type. Please refer to RFC 7946 for details.

GeoJsonGeometryCollectionDataOutput
GeoJsonGeometryCollectionOutput

A valid GeoJSON GeometryCollection object type. Please refer to RFC 7946 for details.

GeoJsonGeometryOutputParent

A valid GeoJSON geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to RFC 7946 for details.

GeoJsonLineStringDataOutput
GeoJsonLineStringOutput

A valid GeoJSON LineString geometry type. Please refer to RFC 7946 for details.

GeoJsonMultiLineStringDataOutput
GeoJsonMultiLineStringOutput

A valid GeoJSON MultiLineString geometry type. Please refer to RFC 7946 for details.

GeoJsonMultiPointDataOutput

Data contained by a GeoJson MultiPoint.

GeoJsonMultiPointOutput

A valid GeoJSON MultiPoint geometry type. Please refer to RFC 7946 for details.

GeoJsonMultiPolygonDataOutput
GeoJsonMultiPolygonOutput

A valid GeoJSON MultiPolygon object type. Please refer to RFC 7946 for details.

GeoJsonObjectOutputParent

A valid GeoJSON object. Please refer to RFC 7946 for details.

GeoJsonPointDataOutput

Data contained by a GeoJson Point.

GeoJsonPointOutput

A valid GeoJSON Point geometry type. Please refer to RFC 7946 for details.

GeoJsonPolygonDataOutput
GeoJsonPolygonOutput

A valid GeoJSON Polygon geometry type. Please refer to RFC 7946 for details.

GeocodePointsItemOutput
GeocodingBatchRequestBody

The list of address geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query.

GeocodingBatchRequestItem

Batch Query object

GeocodingBatchResponseItemOutput
GeocodingBatchResponseOutput

This object is returned from a successful Geocoding Batch service call.

GeocodingBatchResponseSummaryOutput

Summary for the batch request

GeocodingResponseOutput

This object is returned from a successful Geocoding call

GeometryCopyrightOutput

Copyright information of a geometry of a Boundary object.

GetGeocoding
GetGeocodingBatch
GetPolygon
GetReverseGeocoding
GetReverseGeocodingBatch
IntersectionOutput

The address of the result.

ReverseGeocodingBatchRequestBody

The list of reverse geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query.

ReverseGeocodingBatchRequestItem

Batch Query object

Routes
SearchGetGeocoding200Headers
SearchGetGeocoding200Response

Geocoding

Applies to: see pricing tiers.

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, states etc.

SearchGetGeocodingBatch200Response

Geocoding Batch API

Applies to: see pricing tiers.

The Geocoding Batch API sends batches of queries to Geocoding API using just a single API call. The API allows caller to batch up to 100 queries.

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.

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 - If the query completed successfully.

  • Error - If the query failed. The response will contain a code and a message in this case.

SearchGetGeocodingBatchBodyParam
SearchGetGeocodingBatchDefaultResponse

Geocoding Batch API

Applies to: see pricing tiers.

The Geocoding Batch API sends batches of queries to Geocoding API using just a single API call. The API allows caller to batch up to 100 queries.

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.

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 - If the query completed successfully.

  • Error - If the query failed. The response will contain a code and a message in this case.

SearchGetGeocodingBatchMediaTypesParam
SearchGetGeocodingDefaultResponse

Geocoding

Applies to: see pricing tiers.

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, states etc.

SearchGetGeocodingQueryParam
SearchGetGeocodingQueryParamProperties
SearchGetPolygon200Response

Get Polygon

Applies to: see pricing tiers.

Supplies polygon data of a geographical area outline such as a city or a country region.

SearchGetPolygonDefaultResponse

Get Polygon

Applies to: see pricing tiers.

Supplies polygon data of a geographical area outline such as a city or a country region.

SearchGetPolygonQueryParam
SearchGetPolygonQueryParamProperties
SearchGetReverseGeocoding200Response

Reverse Geocoding

Applies to: see pricing tiers.

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.

SearchGetReverseGeocodingBatch200Response

Reverse Geocoding Batch API

Applies to: see pricing tiers.

The Reverse Geocoding Batch API sends batches of queries to Reverse Geocoding API using just a single API call. The API allows caller to batch up to 100 queries.

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.

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 - If the query completed successfully.

  • Error - If the query failed. The response will contain a code and a message in this case.

SearchGetReverseGeocodingBatchBodyParam
SearchGetReverseGeocodingBatchDefaultResponse

Reverse Geocoding Batch API

Applies to: see pricing tiers.

The Reverse Geocoding Batch API sends batches of queries to Reverse Geocoding API using just a single API call. The API allows caller to batch up to 100 queries.

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.

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 - If the query completed successfully.

  • Error - If the query failed. The response will contain a code and a message in this case.

SearchGetReverseGeocodingBatchMediaTypesParam
SearchGetReverseGeocodingDefaultResponse

Reverse Geocoding

Applies to: see pricing tiers.

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.

SearchGetReverseGeocodingQueryParam
SearchGetReverseGeocodingQueryParamProperties

Type Aliases

GeoJsonFeatureOutput

A valid GeoJSON Feature object type. Please refer to RFC 7946 for details.

GeoJsonGeometryOutput

A valid GeoJSON geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to RFC 7946 for details.

GeoJsonObjectOutput

A valid GeoJSON object. Please refer to RFC 7946 for details.

MapsSearchClient
SearchGetGeocodingBatchParameters
SearchGetGeocodingParameters
SearchGetPolygonParameters
SearchGetReverseGeocodingBatchParameters
SearchGetReverseGeocodingParameters

Functions

default(AzureKeyCredential, ClientOptions)

Creates an instance of MapsSearchClient from a subscription key.

Example

import MapsSearch from "@azure-rest/maps-search";
import { AzureKeyCredential } from "@azure/core-auth";

const credential = new AzureKeyCredential("<subscription-key>");
const client = MapsSearch(credential);
default(TokenCredential, string, ClientOptions)

Creates an instance of MapsSearch from an Azure Identity TokenCredential.

Example

import MapsSearch from "@azure-rest/maps-search";
import { DefaultAzureCredential } from "@azure/identity";

const credential = new DefaultAzureCredential();
const client = MapsSearch(credential, "<maps-account-client-id>");
default(AzureSASCredential, ClientOptions)

Creates an instance of MapsSearch from an Azure Identity AzureSASCredential.

Example

import MapsSearch from "@azure-rest/maps-search";
import { AzureSASCredential } from "@azure/core-auth";

const credential = new AzureSASCredential("<SAS Token>");
const client = MapsSearch(credential);
isUnexpected(SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse)
isUnexpected(SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse)
isUnexpected(SearchGetPolygon200Response | SearchGetPolygonDefaultResponse)
isUnexpected(SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse)
isUnexpected(SearchGetReverseGeocodingBatch200Response | SearchGetReverseGeocodingBatchDefaultResponse)

Function Details

default(AzureKeyCredential, ClientOptions)

Creates an instance of MapsSearchClient from a subscription key.

Example

import MapsSearch from "@azure-rest/maps-search";
import { AzureKeyCredential } from "@azure/core-auth";

const credential = new AzureKeyCredential("<subscription-key>");
const client = MapsSearch(credential);
function default(credential: AzureKeyCredential, options?: ClientOptions): MapsSearchClient

Parameters

credential
AzureKeyCredential

An AzureKeyCredential instance used to authenticate requests to the service

options
ClientOptions

Options used to configure the Search Client

Returns

default(TokenCredential, string, ClientOptions)

Creates an instance of MapsSearch from an Azure Identity TokenCredential.

Example

import MapsSearch from "@azure-rest/maps-search";
import { DefaultAzureCredential } from "@azure/identity";

const credential = new DefaultAzureCredential();
const client = MapsSearch(credential, "<maps-account-client-id>");
function default(credential: TokenCredential, mapsAccountClientId: string, options?: ClientOptions): MapsSearchClient

Parameters

credential
TokenCredential

An TokenCredential instance used to authenticate requests to the service

mapsAccountClientId

string

The Azure Maps client id of a specific map resource

options
ClientOptions

Options used to configure the Search Client

Returns

default(AzureSASCredential, ClientOptions)

Creates an instance of MapsSearch from an Azure Identity AzureSASCredential.

Example

import MapsSearch from "@azure-rest/maps-search";
import { AzureSASCredential } from "@azure/core-auth";

const credential = new AzureSASCredential("<SAS Token>");
const client = MapsSearch(credential);
function default(credential: AzureSASCredential, options?: ClientOptions): MapsSearchClient

Parameters

credential
AzureSASCredential

An AzureSASCredential instance used to authenticate requests to the service

options
ClientOptions

Options used to configure the Search Client

Returns

isUnexpected(SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse)

function isUnexpected(response: SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse): response

Parameters

Returns

response

isUnexpected(SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse)

function isUnexpected(response: SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse): response

Parameters

Returns

response

isUnexpected(SearchGetPolygon200Response | SearchGetPolygonDefaultResponse)

function isUnexpected(response: SearchGetPolygon200Response | SearchGetPolygonDefaultResponse): response

Parameters

Returns

response

isUnexpected(SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse)

function isUnexpected(response: SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse): response

Parameters

Returns

response

isUnexpected(SearchGetReverseGeocodingBatch200Response | SearchGetReverseGeocodingBatchDefaultResponse)

function isUnexpected(response: SearchGetReverseGeocodingBatch200Response | SearchGetReverseGeocodingBatchDefaultResponse): response

Parameters

Returns

response