0

When submitting get requests to HERE geocoding for Canadian locations, I am receiving a 3 character postal code instead of a 6 character code.

https://geocode.search.hereapi.com/v1/geocode?q=VICTORIA%2C+BC&limit=1&apiKey=xxxxx

Submitted Location

  • City = Victoria
  • State = BC

Postal Code Output

  • V8W

In this case I am expecting the 6 character code to be returned as something like V8W 2L9. Is there anyway I can express this format in the get request?

Raw Output b'{"items":[{"title":"Victoria, BC, Canada","id":"here:cm:namedplace:21160111","resultType":"locality","localityType":"city","address":{"label":"Victoria, BC, Canada","countryCode":"CAN","countryName":"Canada","stateCode":"BC","state":"British Columbia","county":"Capital","city":"Victoria","postalCode":"V8W"},"position":{"lat":48.42855,"lng":-123.36445},"mapView":{"west":-123.39443,"south":48.40302,"east":-123.32237,"north":48.45036},"scoring":{"queryScore":1.0,"fieldScore":{"country":1.0,"state":1.0,"city":1.0}}}]}'

1 Answers1

0

The address input need to be more specific. Then you will retrieve also the six digit postal codes in Canada. Here and example:

https://geocode.search.hereapi.com/v1/geocode?q=86%20Irving%20Ave,%20Ottawa&limit=1&apikey=

{

"items": [
    {
        "title": "86 Irving Ave, Ottawa, ON K1Y 1Z4, Canada",
        "id": "here:af:streetsection:KcoGTVJ7ADcsOiFrsy.DoC:CggIBCD3-YLRAhABGgI4Ng",
        "resultType": "houseNumber",
        "houseNumberType": "PA",
        "address": {
            "label": "86 Irving Ave, Ottawa, ON K1Y 1Z4, Canada",
            "countryCode": "CAN",
            "countryName": "Canada",
            "stateCode": "ON",
            "state": "Ontario",
            "county": "Ottawa",
            "city": "Ottawa",
            "district": "Hintonburg-Mechanicsville",
            "street": "Irving Ave",
            "postalCode": "K1Y 1Z4",
            "houseNumber": "86"
        },
        "position": {
            "lat": 45.40361,
            "lng": -75.72205
        },
        "access": [
            {
                "lat": 45.40364,
                "lng": -75.72191
            }
        ],
        "mapView": {
            "west": -75.72333,
            "south": 45.40271,
            "east": -75.72077,
            "north": 45.40451
        },
        "scoring": {
            "queryScore": 1.0,
            "fieldScore": {
                "city": 1.0,
                "streets": [
                    1.0
                ],
                "houseNumber": 1.0
            }
        }
    }
]

}