GET
/
api
/
v1
/
address
/
details
Address details
curl --request GET \
  --url https://api.example.com/api/v1/address/details
import requests

url = "https://api.example.com/api/v1/address/details"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/api/v1/address/details', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/address/details",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/v1/address/details"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/address/details")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/address/details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Overview

Resolves a single address id — a UK PAF UDPRN taken from an autocomplete item — into its flat-level details: latitude, longitude, a formatted one-line address, the postcode, and the first address line. Call this once the user selects a suggestion, to prefill the address form (including a map pin from lat/lng). The server proxies the Ideal Postcodes UK PAF API; the provider key stays server-side.

Authentication

Bearer <accessToken> required. Scope: user.

Path parameters

None.

Query parameters

ParamTypeRequiredNotesExample
idstringyesThe provider address id (UK PAF UDPRN) from an autocomplete item. Min length 1.17683155

Request body

None.

Response — 200 OK

FieldTypeNotesExample
latnumberLatitude (WGS84).51.5539
lngnumberLongitude (WGS84).-0.1658
formattedAddressstringNon-empty address lines + post town, comma-joined.Flat 118, Waxham, Mansfield Road, London
postcodestringUK postcode, provider-normalized.NW3 2JL
line1stringFirst address line.Flat 118

Example response

{
  "lat": 51.5539,
  "lng": -0.1658,
  "formattedAddress": "Flat 118, Waxham, Mansfield Road, London",
  "postcode": "NW3 2JL",
  "line1": "Flat 118"
}

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDid is missing or empty.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDNo address exists for the given id.
502UPSTREAM_FAILUREThe address provider failed or returned an unexpected response.
503ADDRESS_LOOKUP_NOT_CONFIGUREDThe server has no API key configured for the selected ADDRESS_PROVIDER (LOQATE_API_KEY by default, or IDEAL_POSTCODES_API_KEY).

Side effects

None — this is a pure read that proxies a third-party lookup.

See also

curl

# Resolve a selected address id to coordinates + full address
curl -X GET "https://api.swappr.co.uk/api/v1/address/details?id=17683155" \
  -H "Authorization: Bearer $ACCESS_TOKEN"