Source: https://developers.woosmap.com/api-reference/localities-api/get-localities-details/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Details



# Details

 GET 
https://api.woosmap.com/localities/details

Returns the full details of a suggestion, looked up by its `public_id`.

**Ratelimit:** 50/1s

### Authorization

[`key`](#authorization-localities-publicapikey)
apiKeyquery

Public key of the project usually starts with `woos-`

[`private_key`](#authorization-localities-privateapikey)
apiKeyquery

Private key with or without write permission.

[`X-Api-Key`](#authorization-localities-privateapikeyheader)
apiKeyheader

Private key with or without write permission.

### Header Parameters

[`accept-language`](#header-accept-language)
string

### Query Parameters

[`fields`](#query-fields)
stringDefaults to `geometry|address_components`

Restricts the response to a subset of fields. Use `|` to provide multiple values.

Available options:`geometry`, `address_components`, `shape`

Example:`shape`

[`language`](#query-language)
stringDefaults to `""`

Language code (ISO 639-1, two letters) for the response.

Resolution order:

1. `language` (this parameter)
2. The request's `Accept-Language` header
3. locale default
4. English (when neither is recognised)

Only part of the address components are translated; not required for postal-code requests.

Example:`en`

[`cc_format`](#query-cc-format)
CountryCodeFormat

Format of the country code returned in `address_components`. When unset, mirrors the format used in `components`, or `alpha2` if `components` is not provided.

Available options:`alpha2`, `alpha3`

Example:`alpha3`

[`public_id`](#query-public-id)
stringrequired

Identifier of the place to retrieve details for. Use the `public_id` returned by the [Autocomplete](https://developers.woosmap.com/products/localities/autocomplete/) endpoint.

Example:`cG9zdGFsX2NvZGU6Z2I6OmNDN0N0ZUF2MW9YRi9KLzlnS2cremJndktFaz0=`

### Response

200application/json

Successful Response

[`result`](#resp-200-result)
objectrequired

The Root Node for Localities Details

#Show 10 propertiesHide 10 properties

result.[`public_id`](#resp-200-result-public-id)
stringrequired

Unique identifier for this place.

result.[`types`](#resp-200-result-types)
string[]required

Available localities types.

result.[`formatted_address`](#resp-200-result-formatted-address)
stringrequired

Contains the readable text description of the result.

result.[`name`](#resp-200-result-name)
string | null

The postal code name if result is a postal code.

result.[`administrative_area_label`](#resp-200-result-administrative-area-label)
string | null

Only available for `admin_level` suggestions, this contains the local english name of the administration level ("department" for France or "federal\_state" for Germany).

result.[`status`](#resp-200-result-status)
string | null

This optional field is only available for UK addresses referenced as not yet built by Royal Mail. Only one value yet.

result.[`geometry`](#resp-200-result-geometry)
object | null

The location of the PostalCode, in latitude and longitude, eventually associated with a Viewport and a shape.

Show 4 propertiesHide 4 properties

result.geometry.[`location`](#resp-200-result-geometry-location)
object | null

Show 2 propertiesHide 2 properties

result.geometry.location.[`lat`](#resp-200-result-geometry-location-lat)
numberrequired

result.geometry.location.[`lng`](#resp-200-result-geometry-location-lng)
numberrequired

result.geometry.[`viewport`](#resp-200-result-geometry-viewport)
object | null

Show 2 propertiesHide 2 properties

result.geometry.viewport.[`northeast`](#resp-200-result-geometry-viewport-northeast)
objectrequired

Show 2 propertiesHide 2 properties

result.geometry.viewport.northeast.[`lat`](#resp-200-result-geometry-viewport-northeast-lat)
numberrequired

result.geometry.viewport.northeast.[`lng`](#resp-200-result-geometry-viewport-northeast-lng)
numberrequired

result.geometry.viewport.[`southwest`](#resp-200-result-geometry-viewport-southwest)
objectrequired

Show 2 propertiesHide 2 properties

result.geometry.viewport.southwest.[`lat`](#resp-200-result-geometry-viewport-southwest-lat)
numberrequired

result.geometry.viewport.southwest.[`lng`](#resp-200-result-geometry-viewport-southwest-lng)
numberrequired

result.geometry.[`shape`](#resp-200-result-geometry-shape)
object | null

Show 2 propertiesHide 2 properties

result.geometry.shape.[`type`](#resp-200-result-geometry-shape-type)
stringrequired

Available options:`Polygon`, `MultiPolygon`

result.geometry.shape.[`coordinates`](#resp-200-result-geometry-shape-coordinates)
arrayrequired

result.geometry.[`accuracy`](#resp-200-result-geometry-accuracy)
string | null

This accuracy represents the type of address returned - `DISTRICT` and `POSTAL_CODE` are for UK only.

 Show 6 enum values Hide 6 enum values 

`ROOFTOP`

`APPROXIMATE`

`RANGE_INTERPOLATED`

`GEOMETRIC_CENTER`

`POSTAL_CODE`

`DISTRICT`

result.[`address_components`](#resp-200-result-address-components)
object[] | null

Show 3 propertiesHide 3 properties

result.address\_components.[`types`](#resp-200-result-address-components-types)
string[]required

result.address\_components.[`long_name`](#resp-200-result-address-components-long-name)
string | arrayrequired

result.address\_components.[`short_name`](#resp-200-result-address-components-short-name)
string | arrayrequired

result.[`categories`](#resp-200-result-categories)
string[] | null

result.[`addresses`](#resp-200-result-addresses)
object | null

For the UK only. When a postal code is returned, this field contains a list of addresses associated with this postal code.

Show 2 propertiesHide 2 properties

result.addresses.[`pagination`](#resp-200-result-addresses-pagination)
objectrequireddeprecated

The pagination part of the response is deprecated as all the addresses are now automatically returned in the response. It will be turned off at some point. From now on, the pagination will systematically return `page=1`, `page_count=1`, `addresses_per_page=total addresses count` and `address_count=total addresses count`.

Show 4 propertiesHide 4 properties

result.addresses.pagination.[`page`](#resp-200-result-addresses-pagination-page)
integerrequireddeprecated

the request page

result.addresses.pagination.[`page_count`](#resp-200-result-addresses-pagination-page-count)
integerrequireddeprecated

the number of available pages

result.addresses.pagination.[`addresses_per_page`](#resp-200-result-addresses-pagination-addresses-per-page)
integerrequireddeprecated

the number of available addresses per page

result.addresses.pagination.[`address_count`](#resp-200-result-addresses-pagination-address-count)
integerrequireddeprecated

the number of available addresses

result.addresses.[`list`](#resp-200-result-addresses-list)
object[]required

List of addresses

Show 2 propertiesHide 2 properties

result.addresses.list.[`public_id`](#resp-200-result-addresses-list-public-id)
stringrequired

The public\_id of the address can be used to gather details on that specific address

result.addresses.list.[`description`](#resp-200-result-addresses-list-description)
stringrequired

A human readable description of the address

### Errors

#401

Unable to locate credentials.

 

`application/json`

[`detail`](#err-401-detail)
stringrequired

#402

Out of free quota.

 

`application/json`

[`detail`](#err-402-detail)
stringrequired

#403

Credentials found, but not matching.

 

`application/json`

[`detail`](#err-403-detail)
stringrequired

#422

Validation Error

 

`application/json`

[`detail`](#err-422-detail)
object[]

Show 5 propertiesHide 5 properties

detail.[`loc`](#err-422-detail-loc)
any[]required

detail.[`msg`](#err-422-detail-msg)
stringrequired

detail.[`type`](#err-422-detail-type)
stringrequired

detail.[`input`](#err-422-detail-input)
any

detail.[`ctx`](#err-422-detail-ctx)
object

#429

Rate limit reached

 

`application/json`

[`detail`](#err-429-detail)
stringrequired

```shell
curl -L 'https://api.woosmap.com/localities/details?public_id=TVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPV9fTVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPQ%3D%3D&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
```

```javascript
const requestOptions = {
  method: "GET",
  redirect: "follow"
};

fetch("https://api.woosmap.com/localities/details?public_id=TVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPV9fTVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPQ%3D%3D&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```

```python
import requests

url = "https://api.woosmap.com/localities/details?public_id=TVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPV9fTVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPQ%3D%3D&key=YOUR_PUBLIC_API_KEY"

payload = {}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```json-200-address
{
  "result": {
    "public_id": "TVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPV9fTVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPQ==",
    "types": [
      "address"
    ],
    "formatted_address": "House Of Commons, Houses Of Parliament, London, SW1A 0AA",
    "geometry": {
      "location": {
        "lat": 51.4998415,
        "lng": -0.1246375
      },
      "accuracy": "ROOFTOP"
    },
    "address_components": [
      {
        "types": [
          "country",
          "administrative_area_level_0",
          "division_level_0"
        ],
        "long_name": "United Kingdom",
        "short_name": "GB"
      },
      {
        "types": [
          "state",
          "division_level_1"
        ],
        "long_name": "England",
        "short_name": "England"
      },
      {
        "types": [
          "administrative_area_level_1",
          "county",
          "division_level_2"
        ],
        "long_name": "City of London",
        "short_name": "City of London"
      },
      {
        "types": [
          "district",
          "division_level_3"
        ],
        "long_name": "Westminster",
        "short_name": "Westminster"
      },
      {
        "types": [
          "locality"
        ],
        "long_name": "London",
        "short_name": "London"
      },
      {
        "types": [
          "postal_codes"
        ],
        "long_name": "SW1A 0AA",
        "short_name": "SW1A 0AA"
      },
      {
        "types": [
          "premise"
        ],
        "long_name": "Houses Of Parliament",
        "short_name": "Houses Of Parliament"
      },
      {
        "types": [
          "organisation"
        ],
        "long_name": "House Of Commons",
        "short_name": "House Of Commons"
      }
    ]
  }
}
```

```json-200-postalcode
{
  "result": {
    "public_id": "cG9zdGFsX2NvZGU6Z2I6OmNDN0N0ZUF2MW9YRi9KLzlnS2cremJndktFaz0=",
    "types": [
      "postal_code"
    ],
    "formatted_address": "SW1A 0AA, City of London",
    "name": "SW1A 0AA",
    "geometry": {
      "location": {
        "lat": 51.499842,
        "lng": -0.124638
      },
      "accuracy": "GEOMETRIC_CENTER"
    },
    "address_components": [
      {
        "types": [
          "country",
          "administrative_area_level_0",
          "division_level_0"
        ],
        "long_name": "United Kingdom",
        "short_name": "GB"
      },
      {
        "types": [
          "state",
          "division_level_1"
        ],
        "long_name": "England",
        "short_name": "England"
      },
      {
        "types": [
          "administrative_area_level_1",
          "county",
          "division_level_2"
        ],
        "long_name": "City of London",
        "short_name": "City of London"
      },
      {
        "types": [
          "district",
          "division_level_3"
        ],
        "long_name": "Westminster",
        "short_name": "Westminster"
      },
      {
        "types": [
          "postal_codes"
        ],
        "long_name": "SW1A 0AA",
        "short_name": "SW1A 0AA"
      }
    ],
    "addresses": {
      "pagination": {
        "page": 1,
        "page_count": 1,
        "addresses_per_page": 1,
        "address_count": 1
      },
      "list": [
        {
          "public_id": "TVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPV9fTVZaV0JmR1pRbkFRbjlKdEU5Q0paamdlQjRRPQ==",
          "description": "House Of Commons, Houses Of Parliament London, SW1A 0AA"
        }
      ]
    }
  }
}
```
