# Resolve Place

**GET** `/v1/places/{place}`

Returns the full place for a place ID taken from a `/places` suggestion.

On top of the fields carried by the suggestion, the response adds coordinates, language and the underlying dataset record.

Each request decrements your lookup balance. An unknown ID returns `404`.

## Example request

**URL**

```http
https://api.addresszen.com/v1/places/geonames_5353?api_key=ak_test
```

**curl**

```bash
curl -G 'https://api.addresszen.com/v1/places/geonames_5353' \
  -d 'api_key=ak_test'
```

**JavaScript**

```javascript
const response = await fetch(
  'https://api.addresszen.com/v1/places/geonames_5353?' +
  new URLSearchParams({
    api_key: 'ak_test',
  })
);

const { result } = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    "https://api.addresszen.com/v1/places/geonames_5353",
    params={
        "api_key": "ak_test",
    },
)
result = response.json()["result"]
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.addresszen.com/v1/places/geonames_5353")
uri.query = URI.encode_www_form(api_key: "ak_test")
result = JSON.parse(Net::HTTP.get(uri))["result"]
```

**PHP**

```php
<?php
$response = file_get_contents(
  "https://api.addresszen.com/v1/places/geonames_5353?" .
  http_build_query([
    "api_key" => "ak_test",
  ])
);
$result = json_decode($response, true)["result"];
```

## Example response

**200 OK**

```json
{
  "result": {
    "id": "geonames_2643743",
    "dataset": "geonames",
    "name": "London",
    "descriptive_name": "London, Greater London, England",
    "language": "en",
    "longitude": -0.12574,
    "latitude": 51.50853,
    "country_iso": "GBR",
    "native": {
      "admin1_code": "ENG",
      "admin2_name": "Greater London",
      "geonameid": 2643743,
      "timezone": "Europe/London",
      "latitude": 51.50853,
      "language": "en",
      "dem": 25,
      "admin4_code": "",
      "admin1_geonameid": 6269131,
      "alternatenames": [
        "ILondon",
        "LON",
        "Lakana",
        "Landan",
        "Landen",
        "Ljondan",
        "Llundain",
        "Lodoni",
        "Londain",
        "Londan",
        "Londar",
        "Londe",
        "Londen",
        "Londin",
        "Londinium",
        "Londino",
        "Londn",
        "London",
        "London osh",
        "Londona",
        "Londonas",
        "Londoni",
        "Londono",
        "Londons",
        "Londonu",
        "Londra",
        "Londres",
        "Londrez",
        "Londri",
        "Londro",
        "Londye",
        "Londyn",
        "Londýn",
        "Lonn",
        "Lontoo",
        "Loundres",
        "Luan GJon",
        "Lun-tun",
        "Lunden",
        "Lundra",
        "Lundun",
        "Lundunir",
        "Lundúnir",
        "Lung-dung",
        "Lunnainn",
        "Lunnin",
        "Lunnon",
        "Luân Đôn",
        "Lùn-tûn",
        "Lùng-dŭng",
        "Lûn-tun",
        "Lākana",
        "Lůndůn",
        "Lọndọnu",
        "Ranana",
        "Rānana",
        "ilantan",
        "ladana",
        "landan",
        "landana",
        "leondeon",
        "lndn",
        "london",
        "londoni",
        "lun dui",
        "lun dun",
        "lwndwn",
        "lxndxn",
        "rondon",
        "Łondra",
        "Λονδίνο",
        "Лондан",
        "Лондон",
        "Лондон ош",
        "Лондонъ",
        "Лёндан",
        "Լոնդոն",
        "לאנדאן",
        "לונדון",
        "لأندأن",
        "لندن",
        "لوندون",
        "لەندەن",
        "ܠܘܢܕܘܢ",
        "लंडन",
        "लंदन",
        "लण्डन",
        "लन्डन्",
        "लन्दन",
        "লন্ডন",
        "ਲੰਡਨ",
        "લંડન",
        "ଲ୍ଡନ",
        "இலண்டன்",
        "లండన్",
        "ಲಂಡನ್",
        "ലണ്ടൻ",
        "ලන්ඩන්",
        "ลอนดอน",
        "ລອນດອນ",
        "ལོན་ཊོན།",
        "လန်ဒန်မြို့",
        "ლონდონი",
        "ለንደን",
        "ᎫᎴ ᏗᏍᎪᏂᎯᏱ",
        "ロンドン",
        "伦敦",
        "倫敦",
        "런던"
      ],
      "cc2": [],
      "admin2_code": "GLA",
      "modification_date": "2022-03-09T00:00:00.000Z",
      "asciiname": "London",
      "id": "geonames_2643743",
      "feature_code": "PPLC",
      "country_iso": "GBR",
      "longitude": -0.12574,
      "elevation": null,
      "admin2_geonameid": 2648110,
      "admin1_name": "England",
      "population": "8961989",
      "country_code": "GB",
      "feature_class": "P",
      "name": "London",
      "admin3_code": "",
      "dataset": "geonames"
    }
  },
  "code": 2000,
  "message": "Success"
}
```

**404 Not Found**

response.json

```json
{
  "code": 4040,
  "message": "Place not found"
}
```

## Path parameters

* `place` string

  ID of place suggestion

## Query parameters

* `api_key` string optional

  **API Key**

  Your unique identifier that allows access to our APIs.

  Begins `ak_`. Available from your dashboard.

  Example: `ak_test`

* `tags` string optional

  **Tags**

  A comma separated list of tags to query over.

  Useful if you want to specify the circumstances in which the request was made.

  If you specify multiple tags, the response comprises only requests that satisfy all of them. Searching `"foo,bar"` queries only requests tagged both `"foo"` and `"bar"`.

  Example: `foo,bar`

## Response

The `result` contains the full place record, including coordinates, timezone, country codes, and a `native` object with complete GeoNames metadata (admin levels, alternate names, population, elevation, etc.).

* `result` Place

  A geographical place: an administrative division, capital or seat of administration city drawn from GeoNames. `GET /places` returns a suggestion for each match and `GET /places/{place}` resolves a suggestion id to the full place. `native` holds the underlying GeoNames record.

  * `id` string

    Global unique internally generated identifier for a place

  * `dataset` string

    Indicates the provenance of a place.

    Values: "geonames"

  * `name` string

    Place name

    Example: `Strumpshaw`

  * `descriptive_name` string

    Longer form description of the place.

    Example: `Strumpshaw, Norfolk, England`

  * `country_iso` string

    3 letter country code (ISO 3166-1)

    Example: `GBR`

  * `language` string

    Language represented by 2 letter ISO Code (639-1)

    Values: 64 possible values

  * `longitude` Longitude

    The longitude of the address or postcode (WGS84).

    Can be a positive or negative decimal. E.g. -0.1283983

    Returns an empty string if no location data is available.

    * string
    * number

  * `latitude` Latitude

    The latitude of the address or postcode (WGS84).

    Can be a positive or negative decimal. E.g. `51.5083983`.

    Returns an empty string if no location data is available.

    * string
    * number

  * `native` one of

    Native representation of a place

    * GeoNames Place [Full guide](/docs/data/geonames.md)

The `result` sits inside the standard `{ result, code, message }` envelope — see the [API reference](/docs/api/api-reference.md) for the wrapper format.
