GuidesAPI Reference
Guides

How to get your coordinates

To get coordinates, you need to call the Geocoding API for each shipment and depot address. The lat/lon coordinates can then be extracted from the property position (see Response below).

For more information on the Geocoding API, see the HERE Geocoding & Search API Developer Guide.

Request

Here is an example with the first shipment from the table on the Tutorials page:

curl "https://geocode.search.hereapi.com/v1/geocode?q=Invalidenstr.+116%2C+10115+Berlin&apiKey={YOUR_API_KEY}"

Response

{
  "items": [
    {
      "title": "Invalidenstraße 116, 10115 Berlin, Deutschland",
      "id": "here:af:streetsection:tVuvjJYhO86yd5jk1cmzNB:CgcIBCCE59BeEAEaAzExNg",
      "resultType": "houseNumber",
      "houseNumberType": "PA",
      "address": {
        "label": "Invalidenstraße 116, 10115 Berlin, Deutschland",
        "countryCode": "DEU",
        "countryName": "Deutschland",
        "stateCode": "BE",
        "state": "Berlin",
        "countyCode": "B",
        "county": "Berlin",
        "city": "Berlin",
        "district": "Mitte",
        "street": "Invalidenstraße",
        "postalCode": "10115",
        "houseNumber": "116"
      },
      "position": {
        "lat": 52.53086,
        "lng": 13.38469
      },
      "access": [
        {
          "lat": 52.531,
          "lng": 13.38461
        }
      ],
      "mapView": {
        "west": 13.38321,
        "south": 52.52996,
        "east": 13.38617,
        "north": 52.53176
      },
      "scoring": {
        "queryScore": 1,
        "fieldScore": {
          "city": 1,
          "streets": [
            1
          ],
          "houseNumber": 1,
          "postalCode": 1
        }
      }
    }
  ]
}