2

HERE autocomplete API request when made on 9535 returns 5 results which all match on result type street instead of postalCode as they do with Google Maps by default. e.g.

https://autocomplete.geocoder.cit.api.here.com/6.2/suggest.json?app_code=MYAPPID&app_id=MYAPPCODE&country=USA&query=9535

{
  "label": "United States, ID, Elk City, NF-9535",
  "language": "en",
  "countryCode": "USA",
  "locationId": "NT_OA7lb1uPsSru.j2wCzrKCC",
  "address": {
    "country": "United States",
    "state": "ID",
    "county": "Idaho",
    "city": "Elk City",
    "street": "NF-9535",
    "postalCode": "83525"
  },
  "matchLevel": "street"
}

Is there a way to make HERE maps autocomplete API exclude specific result types or on the flip side is there a way to only include specific types?

Currently areas does not work for me since I need as I said 9535 to return result types of postalCode instead of street but I want 2300 Maple to still match street types.

I know we can prefix the 9535 with ca 9535 and then the expected results are returned:

{
  "label": "United States, CA, Stanislaus, 95350, Modesto",
  "language": "en",
  "countryCode": "USA",
  "locationId": "NT_-8QfFb8eUnn6Kb1FGJPYKD",
  "address": {
    "country": "United States",
    "state": "CA",
    "county": "Stanislaus",
    "city": "Modesto",
    "postalCode": "95350"
  },
  "matchLevel": "postalCode"
}

But that is not a very good option since the majority of the users would expect the Google Maps behavior.

Is there a ranking on the result types maybe?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Akrion
  • 18,117
  • 1
  • 34
  • 54

1 Answers1

1

yes there is a brand new beta feature for Autocomplete. Please add the &resultType=postalcode in combination with the country=USA That should help give only postal codes.

E.g.

http://autocomplete.geocoder.api.here.com/6.2/suggest.json?app_id=[add your app_id]&app_code=[add your app_code]&query=9535&language=de&resultType=postalcode&country=USA

We will update the documentation concerning this topic soon.

Akrion
  • 18,117
  • 1
  • 34
  • 54
  • 1
    This is not what I want. Not sure you read the entire question. By doing that next time I type “2300” I will NOT get “2300 Maple Ave” as a suggestion since I only return PostalCodes now. – Akrion Sep 17 '18 at 13:45
  • 1
    I see your point. Then this parameter will not help you here. But I am afraid that there is no further possibility to have an influence on the ranking of the Autocomplete API. –  Sep 19 '18 at 07:35