How do I get partial zip code typeahead matches in Azure Maps Address Search?

Parker Ben - Nashville 0 Reputation points
2024-06-28T14:27:47.4533333+00:00

I'm new to Azure Maps, and I'm trying to find documentation around the options with typeahead address search.

My use case is this - I want to provide a partial zip code (example: "372") and get zip code results only (screenshot below).

User's image

Google's Places API allows you to optionally pass "postal_codes" as a "types" parameter to only serve zip code results. Is there similar functionality in Azure Maps?

Thanks!

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. rbrundritt 18,671 Reputation points Microsoft Employee
    2024-06-28T15:26:38.8566667+00:00

    For this scenario I recommend using the Search Address (V1 search service). With that you can add &entityType=PostalCodeArea to limit the results to postal/zip codes. You can add &typeahead=true to tell it the request is part of an autocomplete scenario and it will be more forgiving on what it would normally consider "garbage" input. Pass your input into the query parameter. Optionally you can use the countrySet parameter to limit the results to a set of countries. https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address?view=rest-maps-1.0&tabs=HTTP


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.