Get Details for an Autocomplete Suggestion

Get Addresses details associated to a specific UK Postal Code
  1. Localities Details Requests
  2. Postal Code Details
  3. Addresses Details
  4. Sample

The Details endpoint of Localities API is subject to a specific pricing which is different from an autocomplete request. Get in touch with you Customer Care contact to learn how to estimate you license accordingly.

On the specific territory of United Kingdom, Localities autocomplete request can return the additional attribute has_addresses for a postal code, which indicates if a postal code bears addresses. When has_addresses is true, it is possible to display a list of the available addresses by requesting details with the Localities public_id. To get the structured address with location information such as geographic coordinates you will need to request again /details endpoint passing in the dedicated address public_id.

Localities Details Requests

This endpoint only concerns addresses in the United Kingdom. There is no need to request it for localities which are not of type postal_code or address and located outside the UK.

A Localities Details request is an HTTP URL of the following form:

https://api.woosmap.com/localities/details?key={YOUR_API_KEY}&public_id={LOCALITES_PUBLIC_ID}

Postal Code Details

https://api.woosmap.com/localities/details?key=[YOUR_API_KEY]&public_id=QaCU+fBtigK65ztSrqHqUoUDw

Localities Details provides a JSON response containing one root element, result which contains an array of addresses, with the associated description contained into the postal code.

{
  "result": {
    "formatted_address": "SW1A 0AA, City of London",
    "types": [
      "postal_code"
    ],
    "public_id": "QaCU+fBtigK65ztSrqHqUoUDwZw=",
    "name": "SW1A 0AA",
    "geometry": {
      "location": {
        "lat": 51.49984,
        "lng": -0.124663
      }
    },
    "address_components": [
      {
        "types": [
          "country",
          "administrative_area_level_0"
        ],
        "long_name": "United Kingdom",
        "short_name": "GB"
      },
      {
        "types": [
          "administrative_area_level_1"
        ],
        "long_name": "City of London",
        "short_name": "City of London"
      }
    ],
    "addresses": {
      "pagination": {
        "page": 1,
        "page_count": 1,
        "addresses_per_page": 20,
        "address_count": 5
      },
      "list": [
        {
          "description": "Postmasters Redirection Service, House Of Commons Palace Of Westminster, Parliament Square, London, SW1A 0AA",
          "public_id": "DuxKg3/i5t1AuSt1qvwaiSgd+gI="
        },
        {
          "description": "The Speakers House, 1 Parliament Square, London, SW1A 0AA",
          "public_id": "J9y6c0VHd8L5djgVKAmUZir1D74="
        },
        {
          "description": "Speakers Housekeepers Apartment, House Of Commons Palace Of Westminster, Parliament Square, London, SW1A 0AA",
          "public_id": "K13iP+XIfYK2h+6NFqVVX2q0NQ8="
        },
        {
          "description": "House Of Commons, House Of Commons Palace Of Westminster, Parliament Square, London, SW1A 0AA",
          "public_id": "MVZWBfGZQnAQn9JtE9CJZjgeB4Q="
        },
        {
          "description": "Lord Chancellors Residence, House Of Commons Palace Of Westminster, Parliament Square, London, SW1A 0AA",
          "public_id": "i5WqCPd+qTTnZtiXnKzV8KoIpT8="
        }
      ]
    }
  }
}

Addresses Details

Once the end user chooses an address in the list, another request should be fired to the API to retrieve detailed information about the selected address. See an example below:

https://api.woosmap.com/localities/details?key=[YOUR_API_KEY]&public_id=MVZWBfGZQnAQn9JtE9CJZjgeB4Q=

The API responses contains attributes as follows:

{
  "result": {
    "formatted_address": "House Of Commons, House Of Commons Palace Of Westminster, Parliament Square, London, SW1A 0AA",
    "types": [
      "address"
    ],
    "public_id": "MVZWBfGZQnAQn9JtE9CJZjgeB4Q=",
    "geometry": {
      "location": {
        "lat": 51.49984,
        "lng": -0.1246375
      },
      "accuracy": "ROOFTOP"
    },
    "address_components": [
      {
        "types": [
          "country",
          "administrative_area_level_0"
        ],
        "long_name": "Royaume-Uni",
        "short_name": "GB"
      },
      {
        "types": [
          "administrative_area_level_1"
        ],
        "long_name": "City of London",
        "short_name": "City of London"
      },
      {
        "types": [
          "premise"
        ],
        "long_name": "House Of Commons Palace Of Westminster",
        "short_name": "House Of Commons Palace Of Westminster"
      },
      {
        "types": [
          "locality"
        ],
        "long_name": "London",
        "short_name": "London"
      },
      {
        "types": [
          "postal_codes"
        ],
        "long_name": "SW1A 0AA",
        "short_name": "SW1A 0AA"
      },
      {
        "types": [
          "organisation"
        ],
        "long_name": "House Of Commons",
        "short_name": "House Of Commons"
      },
      {
        "types": [
          "route"
        ],
        "long_name": "Parliament Square",
        "short_name": "Parliament Square"
      }
    ]
  }
}

Sample

Was this article helpful?
Have more questions? Submit a request