Skip to content
GET /v1/random

A random postcode

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/postcode-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/postcode-api/v1/random" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/postcode-api/v1/random", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/postcode-api/v1/random");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/postcode-api/v1/random",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "postcode": {
            "ccg": "NHS Devon",
            "lsoa": "Plymouth 027E",
            "msoa": "Plymouth 027",
            "nuts": "Plymouth",
            "incode": "1EP",
            "parish": "Plymouth, unparished area",
            "region": "South West",
            "country": "England",
            "outcode": "PL1",
            "quality": 1,
            "eastings": 247578,
            "latitude": 50.370653,
            "postcode": "PL1 1EP",
            "longitude": -4.144743,
            "northings": 54507,
            "admin_ward": "St Peter and the Waterfront",
            "admin_county": null,
            "admin_district": "Plymouth",
            "primary_care_trust": "Plymouth Teaching",
            "nhs_health_authority": "South West",
            "european_electoral_region": "South West",
            "parliamentary_constituency": "Plymouth Sutton and Devonport"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:43.616Z",
        "request_id": "10f4dd4f-1472-4fab-be3a-0131cad9d533"
    },
    "status": "ok",
    "message": "Random postcode retrieved successfully",
    "success": true
}