GET /v1/location

HTTP Method: GET

Path: /v1/location

Authentication: API Key required

Description: Fetch details of a location by  supplying its unique identifier.

Parameters:

parameter type description required
location_id string The unqiue identifier of thelocation  to fetch e.g. GBN33RD  yes

Sample Response:

 

{
  "success": true,
  "msg": "ok",
  "data": {
    "_id": "GBN33RD",
    "_rev": "2-e039b1fbff704d784ccebd0df4bb4718",
    "name": "N3 3RD",
    "formal_name": "N3 3RD",
    "latitude": 51.59379959106445,
    "longitude": -0.1938209980726242,
    "resolution": "postalcode",
    "country": "gb",
    "population": 0,
    "description": "",
    "timezone": "Europe/London",
    "parent_town": [
      "GB14648"
    ],
    "parent_county": [],
    "parent_province": [
      "GB41673"
    ],
    "parent_neighbourhood": [
      "GB12332"
    ],
    "parent_region": [
      "GB13660"
    ],
    "parent_district": [
      "GB41717"
    ],
    "postalcode": [],
    "language": "en",
    "type": "postal"
  }
}

If the API had been asked to fetch a non-existent location, then you will see this response:

{
  "success": false,
  "msg": "Unable to return some requested documents",
  "data": {
    "missing": true,
    "errors": [
      "location_id GB33RD is missing"
    ]
  }
}

Docs Navigation