Contents

Search for places that meet specific criteria to autocomplete a place search

Find results that you can use to autocomplete searches.

URL

GET https://maps-api.apple.com/v1/searchAutocomplete

Query Parameters

NameTypeDescription
q Requiredstring

The query to autocomplete. For example, q=eiffel.

excludePoiCategories Optional[PoiCategory]

A comma-separated list of strings that describes the points of interest to exclude from the search results. For example, excludePoiCategories=Restaurant,Cafe.

See PoiCategory for a complete list of possible values.

includePoiCategories Optional[PoiCategory]

A comma-separated list of strings that describes the points of interest to include in the search results. For example, includePoiCategories=Restaurant,Cafe.

See PoiCategory for a complete list of possible values.

lang OptionalLang

The language the server uses when returning the response, specified using a BCP 47 language code. For example, for English, use lang=en-US.

limitToCountries Optional[string]

A comma-separated list of two-letter ISO 3166-1 codes of the countries to limit the results to. For example, limitToCountries=US,CA limits the search to the United States and Canada.

If you specify two or more countries, the results reflect the best available results for some or all of the countries rather than everything related to the query for those countries.

resultTypeFilter Optional[SearchACResultType]

A comma-separated list of strings that describes the kind of result types to include in the response. For example, resultTypeFilter=Poi.

searchLocation OptionalSearchLocation

A location the app defines as a hint. Specify the location as a comma-separated string containing the latitude and longitude. For example, searchLocation=37.78,-122.42.

If you don’t provide a searchLocation, the server uses userLocation and searchRegion as fallback hints.

searchRegion OptionalSearchRegion

A region the app defines as a hint for the search. Specify the region as a comma-separated string that describes the region in the form of a north-latitude, east-longitude, south-latitude, west-longitude string. If you don’t provide searchLocation, the server uses userLocation and searchRegion as fallback hints. For example, searchRegion=38,-122.1,37.5,-122.5.

userLocation OptionalUserLocation

The location of the user, specified as a comma-separated string that contains the latitude and longitude. For example, userLocation=37.78,-122.42.

Certain APIs, such as Search, may opt to use the userLocation, if specified, as a fallback for the searchLocation.

searchRegionPriority Optionalstring

A value that indicates the importance of the configured region.

includeAddressCategories Optional[AddressCategory]

A comma-separated list of strings that describes the addresses to include in the search results. For example, includeAddressCategories=SubLocality,PostalCode. If you use this parameter, you must include address in resultTypeFilter.

See AddressCategory for a complete list of possible values.

excludeAddressCategories Optional[AddressCategory]

A comma-separated list of strings that describes the addresses to exclude in the search results. For example, excludeAddressCategories=Country,AdministrativeArea. If you use this parameter, you must include address in resultTypeFilter.

See AddressCategory for a complete list of possible values.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
SearchAutocompleteResponse

Returns a list of SearchAutocompleteResponse results.

400Bad Request
Content-Type: application/json
ErrorResponse

An ErrorResponse object that contains an error message and an array of strings that contain additional details about the error.

401Unauthorized
Content-Type: application/json
ErrorResponse

An ErrorResponse object that contains an error message that indicates the Maps access token is missing or invalid, and an array of strings that contains additional details about the error.

429
Content-Type: application/json
ErrorResponse

An ErrorResponse object that indicates the call exceeds the daily service call quota for the authorization token. The app can try again later. If your app requires a larger daily quota, submit a quota increase request form.

500Internal Server Error
Content-Type: application/json
ErrorResponse

An ErrorResponse object that contains a server error message and an array of strings that describe additional details about the error.

Discussion

Example

See Also

Searching