Provero Logo

Address - UK Postcode

This endpoint verifies UK postcodes and returns structured UK address details from postcode data.

To use this service, you must configure your UK postcode provider account, password, and API key in Settings.

It is not a full global address validation service. A broader Address Verification endpoint will be introduced separately.

Endpoint

POST
https://api.provero.io/api/validate/uk-postcode

Headers

Authorization: Bearer REPLACE_WITH_API_TOKEN
Content-Type: application/json
Accept: application/json


Request Body

Field Type Required Description
postcode string Yes Postcode to be validated.
Request Body example (JSON)
{
    "postcode": "string"
}

Code Examples

import requests

postcode = "LS18 5SB"

url = "https://api.provero.io/api/validate/uk-postcode"
payload = {"postcode": postcode}

headers = {
    "Authorization": "Bearer REPLACE_WITH_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json"
}

response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.text)
<?php
$postcode = "LS18 5SB";

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.provero.io/api/validate/uk-postcode",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode([
        "postcode" => $postcode
    ]),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer REPLACE_WITH_API_TOKEN",
        "Content-Type: application/json",
        "Accept: application/json"
    ],
]);

$response = curl_exec($curl);
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
}
curl_close($curl);
echo $response;
const postcode = "LS18 5SB";

fetch("https://api.provero.io/api/validate/uk-postcode", {
    method: "POST",
    headers: {
        "Authorization": "Bearer REPLACE_WITH_API_TOKEN",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    body: JSON.stringify({ postcode })
})
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.error("Error:", error));
postcode="LS18 5SB"

curl -X POST https://api.provero.io/api/validate/uk-postcode \
  -H "Authorization: Bearer REPLACE_WITH_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d "{\"postcode\": \"$postcode\"}"

Response Examples

Success
{
    "valid": true,
    "postcode": "LS18 5SB",
    "address": {
        "Address1": "Brownberrie Lane",
        "Address2": "Horsforth",
        "Address3": "",
        "Address4": "",
        "Town": "Leeds",
        "County": "West Yorkshire",
        "Postcode": "LS18 5SB",
        "PremiseData": "Old Ball||;||2;||4;||6;||8;||10;||12;||14;||16;||18;||20;||22;||24;||26;||28;||30;||32;||34;||36;||38;||40;||42;||44;||46;||48;||50;||52;||54;"
    }
}
Application Error
{
    "requestError": {
        "serviceException": {
            "messageId": "Error message",
            "code": "400"
        }
    }
}
Payment Required - Insufficient Balance
{
    "message": "Insufficient balance for validation request.",
    "service": "address",
    "required_amount": "0.0060000000",
    "current_balance": "0.0000000000"
}
Validation Error - Postcode Not Provided
{
    "message": "The postcode field is required.",
    "errors": {
        "postcode": [
            "The postcode field is required."
        ]
    }
}

Response Body

Success structure

Field Name Type Example Always Present Description
postcode string LS18 5SB Yes The request postcode.
valid boolean true Yes Indicates whether the postcode is valid
address object {"Address1":"Brownberrie Lane","Address2":"Horsforth","Address3":"","Address4":"","Town":"Leeds","County":"West Yorkshire","Postcode": "LS18 5SB","PremiseData": "Old Ball||;||2;||4;||6;||8;||10;||12;||14;||16;||18;||20;||22;||24;||26;||28;||30;||32;||34;||36;||38;||40;||42;||44;||46;||48;||50;||52;||54;"} Yes Breakdown of address into structured parts.

Error structure

Field Name Type Example Always Present Description
message string The postcode field is required. No Top-level error message returned on validation failure, insufficient balance, or other request errors.
errors object {"postcode": ["The postcode field is required."]} No Object containing input validation errors.
requestError object {"serviceException": {"messageId": "Error message", "code": "400"}} No Returned when an internal service exception occurs.
service string address No Service alias returned with a 402 insufficient-balance response.
required_amount string 0.0060000000 No Credit amount required to process the validation request.
current_balance string 0.0000000000 No Current available balance at the time the request was rejected.