Address details
curl --request GET \
--url https://api.example.com/api/v1/address/detailsimport 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_bodyAddress
Address details
Resolve a UK PAF address id into coordinates plus a formatted flat-level address.
GET
/
api
/
v1
/
address
/
details
Address details
curl --request GET \
--url https://api.example.com/api/v1/address/detailsimport 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_bodyOverview
Resolves a single addressid — 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
| Param | Type | Required | Notes | Example |
|---|---|---|---|---|
id | string | yes | The provider address id (UK PAF UDPRN) from an autocomplete item. Min length 1. | 17683155 |
Request body
None.Response — 200 OK
| Field | Type | Notes | Example |
|---|---|---|---|
lat | number | Latitude (WGS84). | 51.5539 |
lng | number | Longitude (WGS84). | -0.1658 |
formattedAddress | string | Non-empty address lines + post town, comma-joined. | Flat 118, Waxham, Mansfield Road, London |
postcode | string | UK postcode, provider-normalized. | NW3 2JL |
line1 | string | First 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
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | id is missing or empty. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 404 | NOT_FOUND | No address exists for the given id. |
| 502 | UPSTREAM_FAILURE | The address provider failed or returned an unexpected response. |
| 503 | ADDRESS_LOOKUP_NOT_CONFIGURED | The 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
- Address autocomplete — obtain an
idto resolve here.
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"