here-apihere-autocomplete

Use common city instead of postal city in AutoComplete results


Is it possible to return the common (geographic) city name results for AutoComplete instead of or in addition to the post office city?

For example, there are 37 cities served by the Minneapolis, MN Post Office. All of them will return results using Minneapolis as the city, instead of the geographic city.

I guess I could do a reverse geocode based on the first result and insert them into the AutoComplete results. But checking if something is built-in. Thanks.

Edit: I guess the reverse-geocode returns the same Postal City, not the Geographic City.

Here is example address: 10611 Baltimore St NE Ste 100 Blaine, MN 55449


Solution

  • Solution is to not use here.com and instead use ArcGIS findAddressCandidates API endpoint.

    The URL Request parameter preferredLabelValues can be set to localCity instead of postalCity

    https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm