Get GB Postcode Data

Get GB Postcode Data API will return all the available data for the supplied UK postcode.

Please read API Overview first

API Endpoint

The Get GB Postcode Data API endpoint won't change. It can be set as a constant.

N.B. This EndPoint URL resolves to a dynamic IP address, please be aware of this when making DNS and Firewall decisions.


To get the data for a UK postcode, a simple  GET request from your desired language is all that is needed.

  • cURL
curl -v "
  • jQuery
   type: "GET",
   dataType: "jsonp",
   url: "",
data : {
key: "YOUR_KEY",
postcode: "YOUR_UK_POSTCODE"
success: function(data){
//do something with data
  • Angular JS
   params: {
      key: "YOUR_KEY",
      postcode: "YOUR_UK_POSTCODE"
   //do something with data
  • Ruby
require 'json'
require 'net/http'

uri = URI.parse("")
http =, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
response = http.get(uri.request_uri)
result = JSON.parse(response.body)
  • Python
import json
import urllib2
Response = urllib2.urlopen ("")
jsonResult = json.load(Response)
  • C#
using System.IO;
using System.Net;

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("");
request.Method = WebRequestMethods.Http.Get;
request.Accept = "application/json";

using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
   var result = new StreamReader(response.GetResponseStream()).ReadToEnd();


The following is a sample JSON response returned for a Get GB Postcode Data API request.

  "result": {
    "code": 100,
    "text": "PostcodeValid"
  "postcode": "BT1 2AA",
  "spatialInfo": {
    "wgs84": {
      "location": {
        "longitude": -5.92653,
        "latitude": 54.599535
  "input": {
    "key": "YOUR_KEY",
    "txn": "c2b62e9d-0213-4462-963e-b2787816a27d",
    "postcode": "BT1 2AA"
  "links": [
      "rel": "self",
      "href": ""

Input Fields

Name Type Default Description
key* string Licence key
IMPORTANT: The key parameter name must be all lower case.
postcode* string UK postcode

* Required Field

Output Fields

Name Type Description
result enum Result of the search
  • Unknown,
  • PostcodeValid = 100,
  • PostcodeInvalid = 200
postcode string UK postcode
spatialInfo object This object contains spatial information which is outlined below
input object Input object with request input fields.
links link [ ] An array of Link objects (described below).
spatialInfo Object
Name Type Description
wgs84 object WGS 84 latitude and longitude
Link Object
Name Type Description
rel string API response usually includes an array of HATEOAS links. This allows interaction with the API solely through the hyperlinks we provide you. You no longer need to hardcode logic into your client in order to use our API.
href string The hyperlink the client should follow is stored in the value of “href” property. That value can have some internal parameters, so the client should not parse it or modify it in any way.