Developer Documentation

Complete API integration guide for REST and SOAP services. Real-time UK address lookup, postcode search, and geocoding.

Choose Your Integration Method

ePostcode offers two robust API integration methods to suit your development needs

REST API

Recommended

Modern, high-speed JSON API with simple HTTP requests. Perfect for web applications, mobile apps, and microservices.

  • JSON responses
  • RESTful architecture
  • Easy integration
  • High performance
  • Modern authentication
View REST Documentation

SOAP API

Legacy Support

XML-based SOAP web service for enterprise systems and legacy applications requiring WSDL integration.

  • XML responses
  • WSDL support
  • Enterprise compatible
  • .NET friendly
  • Legacy system support
View SOAP Documentation

Quick Start Guide

  1. Get an API Key: Sign up at portal.epostcode.com and generate your API key in the "Manage Keys" area.
  2. Choose Your Method: Select REST API (recommended) or SOAP API based on your technical requirements.
  3. Make Your First Request: Use the examples below to perform your first address lookup.
  4. Test & Deploy: Test thoroughly in your development environment before going live.
  5. Monitor Usage: Track your API usage and credits in the ePostcode Portal.

REST API Documentation

Modern JSON API for high-speed UK address lookups

Base URL: https://wsp.epostcode.com/uk/v1/

Authentication

All REST API endpoints require authentication via an API key passed as a URL parameter:

URL Parameter
?key=YOUR_API_KEY_HERE

Get your API key from the ePostcode Portal → Manage Keys section.

GET /Search

Search for UK Addresses

Search for premises by building name, street, town, business name, or postcode.

Query Parameters:
Parameter Type Required Description
key string Required Your API key (obtain from ePostcode Portal)
query string Required Search term (postcode, street name, business name, or building)
maxresults integer Optional Maximum number of results to return (default: 100)
Example Request:
cURL
curl -X GET "https://wsp.epostcode.com/uk/v1/Search?key=YOUR_API_KEY_HERE&query=SW1A%201AA"
JavaScript (Fetch)
fetch('https://wsp.epostcode.com/uk/v1/Search?key=YOUR_API_KEY_HERE&query=SW1A 1AA')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Python
import requests

url = "https://wsp.epostcode.com/uk/v1/Search"
params = {
    "key": "YOUR_API_KEY_HERE",
    "query": "SW1A 1AA"
}

response = requests.get(url, params=params)
data = response.json()
print(data)
Example Response:
JSON Response
{
  "results": [
    {
      "id": "12345678",
      "address": "10 Downing Street, Westminster, London, SW1A 2AA",
      "buildingName": "",
      "buildingNumber": "10",
      "street": "Downing Street",
      "locality": "Westminster",
      "town": "London",
      "county": "Greater London",
      "postcode": "SW1A 2AA",
      "country": "England"
    }
  ],
  "totalResults": 1
}
GET /GetPremise

Retrieve Detailed Premise Data

Get complete address details for a specific premise by ID.

Query Parameters:
Parameter Type Required Description
key string Required Your API key (obtain from ePostcode Portal)
id string Required Premise ID from Search results
Example Request:
cURL
curl -X GET "https://wsp.epostcode.com/uk/v1/GetPremise?key=YOUR_API_KEY_HERE&id=12345678"
Example Response:
JSON Response
{
  "premise": {
    "id": "12345678",
    "uprn": "10001234567",
    "buildingName": "",
    "buildingNumber": "10",
    "subBuildingName": "",
    "dependentStreet": "",
    "street": "Downing Street",
    "doubleDependentLocality": "",
    "dependentLocality": "",
    "locality": "Westminster",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA",
    "postcodeInward": "2AA",
    "postcodeOutward": "SW1A",
    "country": "England",
    "latitude": 51.503396,
    "longitude": -0.127764,
    "eastings": 530047,
    "northings": 179951
  }
}
Included FREE: Latitude and Longitude coordinates are included at no extra cost! UPRN data requires +1 additional credit per lookup.
GET /GetPremiseGeoData

Retrieve Geodata for Premise

Get geographic coordinates and grid references for a specific premise.

Query Parameters:
Parameter Type Required Description
key string Required Your API key (obtain from ePostcode Portal)
id string Required Premise ID from Search results
Example Response:
JSON Response
{
  "geoData": {
    "premiseId": "12345678",
    "latitude": 51.503396,
    "longitude": -0.127764,
    "eastings": 530047,
    "northings": 179951,
    "gridReference": "TQ 300 799"
  }
}
GET /GetCredits

Check Remaining API Credits

Monitor your available API credits in real-time.

Example Request:
cURL
curl -X GET "https://wsp.epostcode.com/uk/v1/GetCredits?key=YOUR_API_KEY_HERE"
Example Response:
JSON Response
{
  "credits": {
    "remaining": 9850,
    "used": 150,
    "total": 10000,
    "expiryDate": "2026-12-31"
  }
}

SOAP API Documentation

XML-based web service for enterprise and legacy systems

Legacy Service: The SOAP API is maintained for backward compatibility. We recommend new integrations use the REST API for better performance and easier integration.
WSDL URL: https://ws.epostcode.com/uk/postcodeservices19.asmx?WSDL

WSDL Integration

The SOAP API uses WSDL (Web Services Description Language) for service definition. Most enterprise development tools can automatically generate client code from the WSDL.

Common SOAP Operations:

  • PostcodeLookup - Search for addresses by postcode
  • AddressLookup - Search by building name or street
  • GetAddressDetails - Retrieve full address details
  • ValidateAddress - Validate and standardize addresses
  • GetCredits - Check remaining API credits

Example SOAP Request:

SOAP XML Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <PostcodeLookup xmlns="http://ws.epostcode.com/">
      <ApiKey>YOUR_API_KEY_HERE</ApiKey>
      <Postcode>SW1A 1AA</Postcode>
    </PostcodeLookup>
  </soap:Body>
</soap:Envelope>

Example SOAP Response:

SOAP XML Response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <PostcodeLookupResponse xmlns="http://ws.epostcode.com/">
      <PostcodeLookupResult>
        <Address>
          <BuildingNumber>10</BuildingNumber>
          <Street>Downing Street</Street>
          <Locality>Westminster</Locality>
          <Town>London</Town>
          <County>Greater London</County>
          <Postcode>SW1A 2AA</Postcode>
          <Latitude>51.503396</Latitude>
          <Longitude>-0.127764</Longitude>
        </Address>
      </PostcodeLookupResult>
    </PostcodeLookupResponse>
  </soap:Body>
</soap:Envelope>

.NET C# Example:

C# with Service Reference
// Add Service Reference to: https://ws.epostcode.com/uk/postcodeservices19.asmx

using PostcodeServiceReference;

var client = new PostcodeServices19SoapClient();
var result = await client.PostcodeLookupAsync("YOUR_API_KEY", "SW1A 1AA");

foreach (var address in result.Addresses)
{
    Console.WriteLine($"{address.BuildingNumber} {address.Street}");
    Console.WriteLine($"{address.Town}, {address.Postcode}");
}
Full WSDL Documentation: Visit https://ws.epostcode.com/uk/postcodeservices19.asmx for complete WSDL documentation and test console.

Need Help with Integration?

Our technical support team is here to help you integrate ePostcode into your application.