{
 "openapi": "3.1.0",
 "info": {
  "title": "ClearPostcode API",
  "version": "1.0.0",
  "description": "UK postcode lookup, validation, autocomplete, reverse geocoding, distances and area data, on the ONS Postcode Directory and OS Open Names. v1 only ever grows: new endpoints and new fields, never a removed or renamed one. Anything breaking would be v2, announced at least 12 months ahead with Deprecation and Sunset headers.\n\nFields: postcode; status; outcode, incode, sector, district, area; introduced, terminated; replaced_by; user_type; location; country, region, county, local_authority, ward, parish; county_electoral_division; constituency; police_force, nhs_region, icb, sub_icb; national_park, built_up_area, travel_to_work_area; lsoa, msoa, output_area; rural_urban; area_classification; deprivation.",
  "contact": {
   "name": "ClearPostcode",
   "url": "https://clearpostcode.co.uk/contact",
   "email": "hello@clearpostcode.co.uk"
  },
  "license": {
   "name": "Data: Open Government Licence v3.0",
   "url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
  }
 },
 "externalDocs": {
  "url": "https://clearpostcode.co.uk/developers/docs"
 },
 "servers": [
  {
   "url": "https://api.clearpostcode.co.uk/v1"
  }
 ],
 "security": [
  {
   "ApiKey": []
  },
  {
   "Bearer": []
  }
 ],
 "tags": [
  {
   "name": "Postcodes"
  },
  {
   "name": "Geography"
  },
  {
   "name": "Places"
  },
  {
   "name": "Addresses"
  },
  {
   "name": "Account"
  }
 ],
 "paths": {
  "/postcodes/{postcode}": {
   "get": {
    "operationId": "getPostcode",
    "tags": [
     "Postcodes"
    ],
    "summary": "Look up a postcode",
    "description": "Everything about one postcode: status (live or terminated), coordinates with positional quality, and every area it sits in (country, region, county, council, ward, parish, constituency, police force, NHS board, census areas), plus rural-urban class and deprivation decile. A terminated postcode answers 200 with status \"terminated\", the month it ended and the nearest live postcode in replaced_by.\n\nBilling: 1 lookup when found; not found is free. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "postcode",
      "in": "path",
      "required": true,
      "description": "Any UK postcode, in any case, with or without the space.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1AA"
     },
     {
      "name": "fields",
      "in": "query",
      "required": false,
      "description": "Comma-separated top-level fields to return (postcode and status always come back). An unknown field answers 400 with the list.",
      "schema": {
       "type": "string"
      },
      "example": "location,local_authority,ward"
     },
     {
      "name": "If-None-Match",
      "in": "header",
      "required": false,
      "description": "An ETag from an earlier answer: unchanged answers are a free 304.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       },
       "ETag": {
        "$ref": "#/components/headers/ETag"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Postcode"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "postcode": "SW1A 1AA",
          "status": "live",
          "outcode": "SW1A",
          "incode": "1AA",
          "sector": "SW1A 1",
          "district": "SW1A",
          "area": "SW",
          "introduced": "1980-01",
          "terminated": null,
          "replaced_by": null,
          "user_type": "large",
          "location": {
           "latitude": 51.50101,
           "longitude": -0.141563,
           "easting": 529090,
           "northing": 179645,
           "positional_quality": 1,
           "positional_quality_label": "Within the building closest to the postcode's centre"
          },
          "country": {
           "code": "E92000001",
           "name": "England"
          },
          "region": {
           "code": "E12000007",
           "name": "London"
          },
          "county": null,
          "county_electoral_division": null,
          "local_authority": {
           "code": "E09000033",
           "name": "Westminster"
          },
          "ward": {
           "code": "E05013806",
           "name": "St James's"
          },
          "parish": {
           "code": "E43000236",
           "name": "Westminster, unparished area"
          },
          "constituency": {
           "code": "E14001172",
           "name": "Cities of London and Westminster"
          },
          "police_force": {
           "code": "E23000001",
           "name": "Metropolitan Police"
          },
          "nhs_region": {
           "code": "E40000003",
           "name": "London"
          },
          "icb": {
           "code": "E54000071",
           "name": "NHS West and North London Integrated Care Board"
          },
          "sub_icb": {
           "code": "E38000256",
           "name": "NHS West and North London ICB - W2U3Z"
          },
          "national_park": null,
          "built_up_area": {
           "code": "E63012036",
           "name": "City of Westminster"
          },
          "travel_to_work_area": {
           "code": "E30000234",
           "name": "London"
          },
          "lsoa": {
           "code": "E01004736",
           "name": "Westminster 018C"
          },
          "msoa": {
           "code": "E02000977",
           "name": "Westminster 018"
          },
          "output_area": "E00023938",
          "rural_urban": {
           "code": "UN1",
           "name": "Urban: Nearer to a major town or city",
           "urban": true
          },
          "area_classification": "3c2",
          "deprivation": {
           "index": "English Indices of Deprivation 2025",
           "rank": 24593,
           "of": 33755,
           "decile": 8
          }
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "304": {
      "description": "Not modified (free)",
      "headers": {
       "ETag": {
        "$ref": "#/components/headers/ETag"
       },
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      }
     },
     "400": {
      "description": "That is not a UK postcode; Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_postcode": {
          "summary": "That is not a UK postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_postcode",
           "title": "That is not a UK postcode",
           "status": 400,
           "detail": "The input isn't in the format of a UK postcode. Free. Show your customer the format: two to four characters, a space, a digit and two letters.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Postcode not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "postcode_not_found": {
          "summary": "Postcode not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#postcode_not_found",
           "title": "Postcode not found",
           "status": 404,
           "detail": "The format is right but the postcode isn't in this edition. Free. New-build postcodes can take up to three months to appear: never block a customer on this alone.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup when found; not found is free"
   }
  },
  "/postcodes/{postcode}/validate": {
   "get": {
    "operationId": "validatePostcode",
    "tags": [
     "Postcodes"
    ],
    "summary": "Validate a postcode",
    "description": "Three answers in one: is the format valid, is it in the current edition (known), and is it live. Northern Ireland (BT) postcodes are checked by format only and come back with coverage \"not_covered\"; on a key with Address lookup they are checked against the address data instead and come back covered. New-build postcodes can take up to a quarter to reach the open data, so treat known: false as \"check again\", never as \"wrong\".\n\nBilling: 1 lookup when known; otherwise free (a BT postcode checked against the address data: 1 address credit when found). Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "postcode",
      "in": "path",
      "required": true,
      "description": "Any UK postcode, in any case, with or without the space.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1AA"
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Validation"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "input": "sw1a1aa",
          "postcode": "SW1A 1AA",
          "format_valid": true,
          "known": true,
          "status": "live",
          "valid": true,
          "coverage": "covered",
          "country": {
           "code": "E92000001",
           "name": "England"
          },
          "replaced_by": null
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup when known; otherwise free (a BT postcode checked against the address data: 1 address credit when found)"
   }
  },
  "/postcodes/{postcode}/nearest": {
   "get": {
    "operationId": "nearestToPostcode",
    "tags": [
     "Postcodes"
    ],
    "summary": "Postcodes near a postcode",
    "description": "Live postcodes closest to this one, nearest first, with the distance in metres. Channel Islands and Isle of Man postcodes have no coordinates in the official data and answer no_position.\n\nBilling: 1 lookup. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "postcode",
      "in": "path",
      "required": true,
      "description": "Any UK postcode, in any case, with or without the space.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1AA"
     },
     {
      "name": "radius",
      "in": "query",
      "required": false,
      "description": "Search radius in metres (up to 20,000; default 500). Past 2,000 m a call returns up to 10 postcodes.",
      "schema": {
       "type": "integer"
      },
      "example": 500
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results (1 to 50, default 10).",
      "schema": {
       "type": "integer"
      },
      "example": 10
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Near"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "postcode": "SW1A 1BB",
           "distance_m": 359,
           "latitude": 51.503831,
           "longitude": -0.139099
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "That is not a UK postcode; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_postcode": {
          "summary": "That is not a UK postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_postcode",
           "title": "That is not a UK postcode",
           "status": 400,
           "detail": "The input isn't in the format of a UK postcode. Free. Show your customer the format: two to four characters, a space, a digit and two letters.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Postcode not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "postcode_not_found": {
          "summary": "Postcode not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#postcode_not_found",
           "title": "Postcode not found",
           "status": 404,
           "detail": "The format is right but the postcode isn't in this edition. Free. New-build postcodes can take up to three months to appear: never block a customer on this alone.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "422": {
      "description": "No coordinates for this postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "no_position": {
          "summary": "No coordinates for this postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#no_position",
           "title": "No coordinates for this postcode",
           "status": 422,
           "detail": "The postcode is real but the official data gives it no coordinates (the Channel Islands and the Isle of Man), so there is no distance or neighbour to work out. A lookup still answers with its areas.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup"
   }
  },
  "/postcodes": {
   "get": {
    "operationId": "reverseGeocode",
    "tags": [
     "Postcodes"
    ],
    "summary": "Postcodes near a point (reverse geocode)",
    "description": "Live postcodes nearest a latitude and longitude, nearest first, out to 20 km for rural and island points.\n\nBilling: 1 lookup when anything is found. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude (WGS84).",
      "schema": {
       "type": "number"
      },
      "example": 51.501
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude (WGS84).",
      "schema": {
       "type": "number"
      },
      "example": -0.1416
     },
     {
      "name": "radius",
      "in": "query",
      "required": false,
      "description": "Search radius in metres (up to 20,000; default 500). Past 2,000 m a call returns up to 10 postcodes.",
      "schema": {
       "type": "integer"
      },
      "example": 500
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results (1 to 50, default 10).",
      "schema": {
       "type": "integer"
      },
      "example": 10
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Near"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "postcode": "SW1A 1AA",
           "distance_m": 3,
           "latitude": 51.50101,
           "longitude": -0.141563
          },
          {
           "postcode": "SW1A 1BB",
           "distance_m": 359,
           "latitude": 51.503831,
           "longitude": -0.139099
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup when anything is found"
   },
   "post": {
    "operationId": "bulkLookup",
    "tags": [
     "Postcodes"
    ],
    "summary": "Bulk lookup (up to 100)",
    "description": "Look up to 100 postcodes in one call, from anywhere in the country. Results come back in the order sent, each with the query, the record or null, and an error code when it wasn't found.\n\nBilling: 1 lookup per postcode found. Secret (server) keys only.",
    "parameters": [
     {
      "name": "fields",
      "in": "query",
      "required": false,
      "description": "Comma-separated top-level fields to return (postcode and status always come back). An unknown field answers 400 with the list.",
      "schema": {
       "type": "string"
      },
      "example": "location,local_authority,ward"
     }
    ],
    "requestBody": {
     "required": true,
     "description": "{\"postcodes\": [\"SW1A 1AA\", \"M1 1AE\"]}",
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "postcodes": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        },
        "required": [
         "postcodes"
        ]
       },
       "example": {
        "postcodes": [
         "SW1A 1AA",
         "M1 1AE",
         "EH1 1YZ"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/BulkItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "query": "SW1A 1AA",
           "result": {
            "postcode": "SW1A 1AA",
            "status": "live",
            "outcode": "SW1A",
            "incode": "1AA",
            "sector": "SW1A 1",
            "district": "SW1A",
            "area": "SW",
            "introduced": "1980-01",
            "terminated": null,
            "replaced_by": null,
            "user_type": "large",
            "location": {
             "latitude": 51.50101,
             "longitude": -0.141563,
             "easting": 529090,
             "northing": 179645,
             "positional_quality": 1,
             "positional_quality_label": "Within the building closest to the postcode's centre"
            },
            "country": {
             "code": "E92000001",
             "name": "England"
            },
            "region": {
             "code": "E12000007",
             "name": "London"
            },
            "county": null,
            "county_electoral_division": null,
            "local_authority": {
             "code": "E09000033",
             "name": "Westminster"
            },
            "ward": {
             "code": "E05013806",
             "name": "St James's"
            },
            "parish": {
             "code": "E43000236",
             "name": "Westminster, unparished area"
            },
            "constituency": {
             "code": "E14001172",
             "name": "Cities of London and Westminster"
            },
            "police_force": {
             "code": "E23000001",
             "name": "Metropolitan Police"
            },
            "nhs_region": {
             "code": "E40000003",
             "name": "London"
            },
            "icb": {
             "code": "E54000071",
             "name": "NHS West and North London Integrated Care Board"
            },
            "sub_icb": {
             "code": "E38000256",
             "name": "NHS West and North London ICB - W2U3Z"
            },
            "national_park": null,
            "built_up_area": {
             "code": "E63012036",
             "name": "City of Westminster"
            },
            "travel_to_work_area": {
             "code": "E30000234",
             "name": "London"
            },
            "lsoa": {
             "code": "E01004736",
             "name": "Westminster 018C"
            },
            "msoa": {
             "code": "E02000977",
             "name": "Westminster 018"
            },
            "output_area": "E00023938",
            "rural_urban": {
             "code": "UN1",
             "name": "Urban: Nearer to a major town or city",
             "urban": true
            },
            "area_classification": "3c2",
            "deprivation": {
             "index": "English Indices of Deprivation 2025",
             "rank": 24593,
             "of": 33755,
             "decile": 8
            }
           }
          },
          {
           "query": "SW1A 9ZZ",
           "result": null,
           "error": "postcode_not_found"
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Publishable key not allowed here",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "publishable_key_not_allowed": {
          "summary": "Publishable key not allowed here",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#publishable_key_not_allowed",
           "title": "Publishable key not allowed here",
           "status": 403,
           "detail": "Publishable keys work on lookups, validation and autocomplete only. Call this endpoint from your server with a secret key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "413": {
      "description": "Request body too large",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "body_too_large": {
          "summary": "Request body too large",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#body_too_large",
           "title": "Request body too large",
           "status": 413,
           "detail": "Bodies are capped at 64 KB: send up to 100 postcodes or 20 points a call.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup per postcode found"
   }
  },
  "/reverse": {
   "post": {
    "operationId": "bulkReverse",
    "tags": [
     "Postcodes"
    ],
    "summary": "Bulk reverse geocode (up to 20)",
    "description": "Nearest postcodes for up to 20 points in one call.\n\nBilling: 1 lookup per point with a result. Secret (server) keys only.",
    "parameters": [],
    "requestBody": {
     "required": true,
     "description": "{\"points\": [{\"lat\": 51.5, \"lon\": -0.12, \"limit\": 1}]}",
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "points": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "lat": {
             "type": "number"
            },
            "lon": {
             "type": "number"
            },
            "limit": {
             "type": "number"
            }
           }
          }
         }
        },
        "required": [
         "points"
        ]
       },
       "example": {
        "points": [
         {
          "lat": 51.5014,
          "lon": -0.1419,
          "limit": 1
         },
         {
          "lat": 53.4808,
          "lon": -2.2426,
          "limit": 1
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/ReverseItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "query": {
            "latitude": 51.5014,
            "longitude": -0.1419
           },
           "result": [
            {
             "postcode": "SW1A 1AA",
             "distance_m": 3,
             "latitude": 51.50101,
             "longitude": -0.141563
            }
           ]
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Publishable key not allowed here",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "publishable_key_not_allowed": {
          "summary": "Publishable key not allowed here",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#publishable_key_not_allowed",
           "title": "Publishable key not allowed here",
           "status": 403,
           "detail": "Publishable keys work on lookups, validation and autocomplete only. Call this endpoint from your server with a secret key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "413": {
      "description": "Request body too large",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "body_too_large": {
          "summary": "Request body too large",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#body_too_large",
           "title": "Request body too large",
           "status": 413,
           "detail": "Bodies are capped at 64 KB: send up to 100 postcodes or 20 points a call.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup per point with a result"
   }
  },
  "/autocomplete": {
   "get": {
    "operationId": "autocomplete",
    "tags": [
     "Postcodes"
    ],
    "summary": "Autocomplete a partial postcode",
    "description": "Postcodes (or districts, for 1 to 4 characters) that start with what has been typed. Free: keystrokes are never billed. Send at least 2 characters.\n\nBilling: Free (fair use). Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "What has been typed so far.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results (1 to 20, default 10).",
      "schema": {
       "type": "integer"
      },
      "example": 10
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Suggestion"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "type": "postcode",
           "postcode": "SW1A 1AA"
          },
          {
           "type": "postcode",
           "postcode": "SW1A 1AB"
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "Free (fair use)"
   }
  },
  "/distance": {
   "get": {
    "operationId": "distance",
    "tags": [
     "Postcodes"
    ],
    "summary": "Distance between two postcodes",
    "description": "Straight-line distance in kilometres and miles, and the compass bearing from the first to the second.\n\nBilling: 1 lookup. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "First postcode.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1AA"
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "Second postcode.",
      "schema": {
       "type": "string"
      },
      "example": "EH1 1YZ"
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Distance"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "from": {
           "postcode": "SW1A 1AA",
           "latitude": 51.50101,
           "longitude": -0.141563,
           "easting": 529090,
           "northing": 179645,
           "positional_quality": 1,
           "positional_quality_label": "Within the building closest to the postcode's centre"
          },
          "to": {
           "postcode": "EH1 1YZ",
           "latitude": 55.950328,
           "longitude": -3.193018,
           "easting": 325597,
           "northing": 673676,
           "positional_quality": 1,
           "positional_quality_label": "Within the building closest to the postcode's centre"
          },
          "km": 533.79,
          "miles": 331.682,
          "bearing_deg": 339,
          "direction": "north",
          "method": "great-circle (haversine)"
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "That is not a UK postcode; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_postcode": {
          "summary": "That is not a UK postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_postcode",
           "title": "That is not a UK postcode",
           "status": 400,
           "detail": "The input isn't in the format of a UK postcode. Free. Show your customer the format: two to four characters, a space, a digit and two letters.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Postcode not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "postcode_not_found": {
          "summary": "Postcode not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#postcode_not_found",
           "title": "Postcode not found",
           "status": 404,
           "detail": "The format is right but the postcode isn't in this edition. Free. New-build postcodes can take up to three months to appear: never block a customer on this alone.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "422": {
      "description": "No coordinates for this postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "no_position": {
          "summary": "No coordinates for this postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#no_position",
           "title": "No coordinates for this postcode",
           "status": 422,
           "detail": "The postcode is real but the official data gives it no coordinates (the Channel Islands and the Isle of Man), so there is no distance or neighbour to work out. A lookup still answers with its areas.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup"
   }
  },
  "/outcodes/{outcode}": {
   "get": {
    "operationId": "getOutcode",
    "tags": [
     "Geography"
    ],
    "summary": "A postcode district",
    "description": "One district (the outward code, e.g. SW1A): how many live and terminated postcodes, its sectors, centre, councils, wards, constituencies and places.\n\nBilling: 1 lookup. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "outcode",
      "in": "path",
      "required": true,
      "description": "Outward code.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A"
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/District"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "district": "SW1A",
          "area": "SW",
          "area_name": "South West London",
          "live": 145,
          "terminated": 210,
          "large_user": 64,
          "sectors": [
           {
            "sector": "SW1A 0",
            "live": 3,
            "terminated": 10
           },
           {
            "sector": "SW1A 1",
            "live": 67,
            "terminated": 121
           },
           {
            "sector": "SW1A 2",
            "live": 75,
            "terminated": 79
           }
          ],
          "centre": {
           "latitude": 51.50455,
           "longitude": -0.13223
          },
          "country": {
           "code": "E92000001",
           "name": "England"
          },
          "regions": [
           {
            "code": "E12000007",
            "name": "London",
            "postcodes": 145,
            "share": 100
           }
          ],
          "counties": [],
          "local_authorities": [
           {
            "code": "E09000033",
            "name": "Westminster",
            "postcodes": 143,
            "share": 99
           }
          ],
          "wards": [
           {
            "code": "E05013806",
            "name": "St James's",
            "postcodes": 143,
            "share": 99
           }
          ],
          "constituencies": [
           {
            "code": "E14001172",
            "name": "Cities of London and Westminster",
            "postcodes": 143,
            "share": 99
           }
          ],
          "police_forces": [
           {
            "code": "E23000001",
            "name": "Metropolitan Police",
            "postcodes": 145,
            "share": 100
           }
          ],
          "icbs": [
           {
            "code": "E54000071",
            "name": "NHS West and North London Integrated Care Board",
            "postcodes": 143,
            "share": 99
           }
          ],
          "national_parks": [
           {
            "code": "E65000001",
            "name": "England (non-National Park)",
            "postcodes": 145,
            "share": 100
           }
          ],
          "built_up_areas": [
           {
            "code": "E63012036",
            "name": "City of Westminster",
            "postcodes": 142,
            "share": 98
           }
          ],
          "parishes": [
           {
            "code": "E43000236",
            "name": "Westminster, unparished area",
            "postcodes": 143,
            "share": 99
           }
          ],
          "urban_share": 100,
          "deprivation": {
           "index": "English Indices of Deprivation 2025",
           "deciles": [
            0,
            0,
            0,
            0,
            0,
            0,
            29,
            115,
            1,
            0
           ]
          },
          "places": [
           {
            "name": "City of Westminster",
            "type": "City"
           }
          ],
          "neighbours": [
           "SW1Y",
           "SW1H",
           "WC2N",
           "SW1E",
           "W1J",
           "W1D",
           "W1S",
           "WC2E"
          ],
          "newest": [
           {
            "postcode": "SW1A 1NF",
            "introduced": "2026-06"
           }
          ],
          "oldest_introduced": "1980-01"
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup"
   }
  },
  "/outcodes/{outcode}/postcodes": {
   "get": {
    "operationId": "outcodePostcodes",
    "tags": [
     "Geography"
    ],
    "summary": "Every postcode in a district",
    "description": "The district's live postcodes with coordinates, in order, a page at a time. Pass meta.next_cursor as cursor= to get the next page (meta.next is the whole next URL).\n\nBilling: 1 lookup per page. Secret (server) keys only.",
    "parameters": [
     {
      "name": "outcode",
      "in": "path",
      "required": true,
      "description": "Outward code.",
      "schema": {
       "type": "string"
      },
      "example": "SW1A"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "meta.next_cursor from the previous page.",
      "schema": {
       "type": "string"
      },
      "example": "U1cxQTFBQQ"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results (1 to 500, default 100).",
      "schema": {
       "type": "integer"
      },
      "example": 100
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/OutcodePostcode"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "postcode": "SW1A 0AA",
           "latitude": 51.499842,
           "longitude": -0.124638
          },
          {
           "postcode": "SW1A 1AA",
           "latitude": 51.50101,
           "longitude": -0.141563
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Publishable key not allowed here",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "publishable_key_not_allowed": {
          "summary": "Publishable key not allowed here",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#publishable_key_not_allowed",
           "title": "Publishable key not allowed here",
           "status": 403,
           "detail": "Publishable keys work on lookups, validation and autocomplete only. Call this endpoint from your server with a secret key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup per page"
   }
  },
  "/sectors/{sector}": {
   "get": {
    "operationId": "getSector",
    "tags": [
     "Geography"
    ],
    "summary": "A postcode sector",
    "description": "One sector (e.g. SW1A 1): its live postcodes with coordinates, centre, and the councils and wards it covers.\n\nBilling: 1 lookup. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "sector",
      "in": "path",
      "required": true,
      "description": "Sector, e.g. \"SW1A 1\".",
      "schema": {
       "type": "string"
      },
      "example": "SW1A 1"
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Sector"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "sector": "SW1A 1",
          "district": "SW1A",
          "live": 67,
          "centre": {
           "latitude": 51.50501,
           "longitude": -0.1393
          },
          "local_authorities": [
           {
            "code": "E09000033",
            "name": "Westminster",
            "postcodes": 65
           },
           {
            "code": "E09000032",
            "name": "Wandsworth",
            "postcodes": 2
           }
          ],
          "wards": [
           {
            "code": "E05013806",
            "name": "St James's",
            "postcodes": 65
           },
           {
            "code": "E05014015",
            "name": "Nine Elms",
            "postcodes": 2
           }
          ],
          "constituencies": [
           {
            "code": "E14001172",
            "name": "Cities of London and Westminster",
            "postcodes": 65
           },
           {
            "code": "E14001081",
            "name": "Battersea",
            "postcodes": 2
           }
          ],
          "parishes": [
           {
            "code": "E43000236",
            "name": "Westminster, unparished area",
            "postcodes": 65
           },
           {
            "code": "E43000222",
            "name": "Wandsworth, unparished area",
            "postcodes": 2
           }
          ],
          "postcodes": [
           {
            "postcode": "SW1A 1AA",
            "latitude": 51.50101,
            "longitude": -0.141563,
            "user_type": "large"
           },
           {
            "postcode": "SW1A 1AB",
            "latitude": 51.505073,
            "longitude": -0.137478,
            "user_type": "small"
           }
          ]
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup"
   }
  },
  "/areas/{area}": {
   "get": {
    "operationId": "getArea",
    "tags": [
     "Geography"
    ],
    "summary": "A postcode area",
    "description": "One postcode area (the letters, e.g. SW): its name, counts and every district in it.\n\nBilling: 1 lookup. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "area",
      "in": "path",
      "required": true,
      "description": "Area letters.",
      "schema": {
       "type": "string"
      },
      "example": "SW"
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Area"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "area": "SW",
          "name": "South West London",
          "live": 20109,
          "terminated": 17448,
          "districts": [
           {
            "district": "SW1A",
            "live": 145,
            "terminated": 210,
            "local_authority": "Westminster"
           }
          ]
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found; Northern Ireland postcode",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "not_covered": {
          "summary": "Northern Ireland postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_covered",
           "title": "Northern Ireland postcode",
           "status": 404,
           "detail": "A Northern Ireland (BT) postcode in a valid format. Postcode data covers Great Britain, the Channel Islands and the Isle of Man; Northern Ireland addresses are served by Address lookup.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup"
   }
  },
  "/places": {
   "get": {
    "operationId": "places",
    "tags": [
     "Places"
    ],
    "summary": "Find a place",
    "description": "Cities, towns, villages and neighbourhoods by name (OS Open Names), each with its postcode district and coordinates. Accents are optional: Aber-Giar finds Aber-Giâr.\n\nBilling: 1 lookup when anything is found. Works with publishable (browser) keys. Can be tried without a key (rate-limited per network).",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "Place name or its start.",
      "schema": {
       "type": "string"
      },
      "example": "Chelsea"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results (1 to 20, default 10).",
      "schema": {
       "type": "integer"
      },
      "example": 10
     }
    ],
    "security": [
     {
      "ApiKey": []
     },
     {
      "Bearer": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Place"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "name": "Chelsea",
           "alternative_name": null,
           "type": "Suburban Area",
           "district": "SW3",
           "latitude": 51.4878,
           "longitude": -0.16788,
           "local_authority": "Kensington and Chelsea",
           "county": "Greater London"
          }
         ],
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Monthly postcode lookups used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "quota_exceeded": {
          "summary": "Monthly postcode lookups used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#quota_exceeded",
           "title": "Monthly postcode lookups used up",
           "status": 402,
           "detail": "This month's lookups (and any prepaid packs) are used up. Upgrade or add a pack; the allowance resets on your period date.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "1 lookup when anything is found"
   }
  },
  "/usage": {
   "get": {
    "operationId": "usage",
    "tags": [
     "Account"
    ],
    "summary": "Your usage",
    "description": "Your plan, this period's allowance, lookups used, credits and when the allowance resets.\n\nBilling: Free. Secret (server) keys only.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Usage"
          },
          "meta": {
           "$ref": "#/components/schemas/Meta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "plan": "free",
          "plan_name": "Free",
          "period_start": "2026-11-01",
          "resets": "2026-12-01T00:00:00.000Z",
          "allowance": 10000,
          "used": 412,
          "remaining": 9588,
          "credits": 0
         },
         "meta": {
          "edition": "2026-08",
          "next_edition": "2026-11",
          "next_edition_expected": {
           "from": "2026-12-01",
           "to": "2026-12-31"
          },
          "coverage": "Great Britain, the Channel Islands and the Isle of Man",
          "licence": "OGL-UK-3.0",
          "attribution": [
           "Contains OS data © Crown copyright and database right 2026",
           "Contains Royal Mail data © Royal Mail copyright and database right 2026",
           "Source: Office for National Statistics licensed under the Open Government Licence v.3.0"
          ],
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Secret key used in a browser; Publishable key not allowed here",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "publishable_key_not_allowed": {
          "summary": "Publishable key not allowed here",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#publishable_key_not_allowed",
           "title": "Publishable key not allowed here",
           "status": 403,
           "detail": "Publishable keys work on lookups, validation and autocomplete only. Call this endpoint from your server with a secret key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-billing": "Free"
   }
  },
  "/addresses": {
   "get": {
    "operationId": "addressesByPostcode",
    "tags": [
     "Addresses"
    ],
    "summary": "Addresses at a postcode (early access)",
    "description": "Every address at a postcode, in delivery order: line_1 to line_3, post_town, postcode, organisation, building and UDPRN, up to 100 an answer. A postcode with more pages on: pass meta.next_cursor as cursor= (meta.total says how many there are). Early access: a key answers once the business it serves has Address lookup switched on in the dashboard (End User Terms accepted). The account's first business gets 50 free addresses to test with, for 90 days from its first lookup; businesses added later start with a pack. Join at clearpostcode.co.uk/address-lookup.\n\nBilling: 1 address credit per page found; not found is free. Works with publishable (browser) keys.",
    "parameters": [
     {
      "name": "postcode",
      "in": "query",
      "required": true,
      "description": "A UK postcode, Northern Ireland included.",
      "schema": {
       "type": "string"
      },
      "example": "AB10 1AA"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "meta.next_cursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Address"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/AddressMeta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "udprn": "90000001",
           "umprn": null,
           "uprn": null,
           "line_1": "1 Lime Tree Avenue",
           "line_2": "Clifton",
           "line_3": "",
           "post_town": "MAPLEBURY",
           "postcode": "AB10 1AA",
           "organisation_name": "",
           "department_name": "",
           "sub_building_name": "",
           "building_name": "",
           "building_number": "1",
           "dependant_thoroughfare": "",
           "thoroughfare": "Lime Tree Avenue",
           "double_dependant_locality": "",
           "dependant_locality": "Clifton",
           "po_box": "",
           "postcode_type": "S",
           "delivery_point_suffix": "1A",
           "su_organisation_indicator": false,
           "households": 1,
           "postal_county": "Mapleshire",
           "traditional_county": "Old Mapleshire",
           "administrative_county": "Maple Council",
           "welsh": null
          },
          {
           "udprn": "90000002",
           "umprn": null,
           "uprn": null,
           "line_1": "2 Lime Tree Avenue",
           "line_2": "Clifton",
           "line_3": "",
           "post_town": "MAPLEBURY",
           "postcode": "AB10 1AA",
           "organisation_name": "",
           "department_name": "",
           "sub_building_name": "",
           "building_name": "",
           "building_number": "2",
           "dependant_thoroughfare": "",
           "thoroughfare": "Lime Tree Avenue",
           "double_dependant_locality": "",
           "dependant_locality": "Clifton",
           "po_box": "",
           "postcode_type": "S",
           "delivery_point_suffix": "1B",
           "su_organisation_indicator": false,
           "households": 1,
           "postal_county": "Mapleshire",
           "traditional_county": "Old Mapleshire",
           "administrative_county": "Maple Council",
           "welsh": null
          }
         ],
         "meta": {
          "edition": "2026-12",
          "coverage": "Every UK address that receives post, Northern Ireland included",
          "source": "Address lookup",
          "acknowledgement": "The data owner's credit line, as it asks us to show it.",
          "terms": "https://clearpostcode.co.uk/address-lookup/terms",
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "That is not a UK postcode; Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_postcode": {
          "summary": "That is not a UK postcode",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_postcode",
           "title": "That is not a UK postcode",
           "status": 400,
           "detail": "The input isn't in the format of a UK postcode. Free. Show your customer the format: two to four characters, a space, a digit and two letters.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Address credits used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_credits_exhausted": {
          "summary": "Address credits used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_credits_exhausted",
           "title": "Address credits used up",
           "status": 402,
           "detail": "The address credits (or the free trial) of the business this key serves are used up or have expired. Add address credits for it, in the dashboard or by email, and the key answers again at once; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Address lookup is not switched on for this key; Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_lookup_not_enabled": {
          "summary": "Address lookup is not switched on for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_lookup_not_enabled",
           "title": "Address lookup is not switched on for this key",
           "status": 403,
           "detail": "Address lookup answers keys whose business has accepted the End User Terms in the dashboard. Switch it on there (an agency adds one business per client), or join the early-access list while it opens.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Postcode not found",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "postcode_not_found": {
          "summary": "Postcode not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#postcode_not_found",
           "title": "Postcode not found",
           "status": 404,
           "detail": "The format is right but the postcode isn't in this edition. Free. New-build postcodes can take up to three months to appear: never block a customer on this alone.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-status": "preview",
    "x-billing": "1 address credit per page found; not found is free"
   }
  },
  "/addresses/suggest": {
   "get": {
    "operationId": "addressSuggest",
    "tags": [
     "Addresses"
    ],
    "summary": "Address autocomplete (early access)",
    "description": "Suggestions as the customer types, from any part of an address: postcode, street, building, organisation or number. A suggestion of kind \"address\" is one address: resolve its id with /addresses/retrieve/{id}. One of kind \"container\" is a postcode, sector, street or building holding count addresses: pass its id as container= to list what it holds. Each line carries only what the picker shows and an opaque id. A business gets a day's suggestions in proportion to the addresses it holds (a call that lists many lines counts as several), far more than its checkouts use. Early access: a key answers once the business it serves has Address lookup switched on in the dashboard (End User Terms accepted). The account's first business gets 50 free addresses to test with, for 90 days from its first lookup; businesses added later start with a pack. Join at clearpostcode.co.uk/address-lookup.\n\nBilling: Free. Works with publishable (browser) keys.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "What has been typed (3 characters or more; optional with container).",
      "schema": {
       "type": "string"
      },
      "example": "2 high street porthmore"
     },
     {
      "name": "container",
      "in": "query",
      "required": false,
      "description": "A container suggestion's id: list what it holds.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many suggestions (1 to 100, default 10).",
      "schema": {
       "type": "integer"
      },
      "example": 10
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/AddressSuggestion"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/AddressMeta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": [
          {
           "kind": "address",
           "id": "YR9UUjI0QUEfOTAwMDAwNTYf",
           "suggestion": "2 High Street, PORTHMORE, TR2 4AA"
          },
          {
           "kind": "container",
           "type": "postcode",
           "id": "cB9BQjEwMUFB",
           "suggestion": "AB10 1AA",
           "count": 17
          }
         ],
         "meta": {
          "edition": "2026-12",
          "coverage": "Every UK address that receives post, Northern Ireland included",
          "source": "Address lookup",
          "acknowledgement": "The data owner's credit line, as it asks us to show it.",
          "terms": "https://clearpostcode.co.uk/address-lookup/terms",
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Address credits used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_credits_exhausted": {
          "summary": "Address credits used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_credits_exhausted",
           "title": "Address credits used up",
           "status": 402,
           "detail": "The address credits (or the free trial) of the business this key serves are used up or have expired. Add address credits for it, in the dashboard or by email, and the key answers again at once; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Address lookup is not switched on for this key; Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_lookup_not_enabled": {
          "summary": "Address lookup is not switched on for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_lookup_not_enabled",
           "title": "Address lookup is not switched on for this key",
           "status": 403,
           "detail": "Address lookup answers keys whose business has accepted the End User Terms in the dashboard. Switch it on there (an agency adds one business per client), or join the early-access list while it opens.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Today's address suggestions used; Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "suggestions_capped": {
          "summary": "Today's address suggestions used",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#suggestions_capped",
           "title": "Today's address suggestions used",
           "status": 429,
           "detail": "Each business gets a day's suggestions in proportion to the addresses it holds, far more than its checkouts use. They open again at midnight UTC; meanwhile resolve the suggestions you have with /addresses/retrieve/{id} or list a postcode with /addresses?postcode=.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-status": "preview",
    "x-billing": "Free"
   }
  },
  "/addresses/retrieve/{id}": {
   "get": {
    "operationId": "addressRetrieve",
    "tags": [
     "Addresses"
    ],
    "summary": "Resolve a suggestion (early access)",
    "description": "The full address for an address suggestion's id, ready to save on the order. Ids hold within the edition that issued them; an older one answers not_found, so suggest again. Early access: a key answers once the business it serves has Address lookup switched on in the dashboard (End User Terms accepted). The account's first business gets 50 free addresses to test with, for 90 days from its first lookup; businesses added later start with a pack. Join at clearpostcode.co.uk/address-lookup.\n\nBilling: 1 address credit when found. Works with publishable (browser) keys.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The id of a suggestion of kind \"address\".",
      "schema": {
       "type": "string"
      },
      "example": "YR9BQjEwMUFBHzkwMDAwMDAxHw"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Address"
          },
          "meta": {
           "$ref": "#/components/schemas/AddressMeta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "udprn": "90000001",
          "umprn": null,
          "uprn": null,
          "line_1": "1 Lime Tree Avenue",
          "line_2": "Clifton",
          "line_3": "",
          "post_town": "MAPLEBURY",
          "postcode": "AB10 1AA",
          "organisation_name": "",
          "department_name": "",
          "sub_building_name": "",
          "building_name": "",
          "building_number": "1",
          "dependant_thoroughfare": "",
          "thoroughfare": "Lime Tree Avenue",
          "double_dependant_locality": "",
          "dependant_locality": "Clifton",
          "po_box": "",
          "postcode_type": "S",
          "delivery_point_suffix": "1A",
          "su_organisation_indicator": false,
          "households": 1,
          "postal_county": "Mapleshire",
          "traditional_county": "Old Mapleshire",
          "administrative_county": "Maple Council",
          "welsh": null
         },
         "meta": {
          "edition": "2026-12",
          "coverage": "Every UK address that receives post, Northern Ireland included",
          "source": "Address lookup",
          "acknowledgement": "The data owner's credit line, as it asks us to show it.",
          "terms": "https://clearpostcode.co.uk/address-lookup/terms",
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Address credits used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_credits_exhausted": {
          "summary": "Address credits used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_credits_exhausted",
           "title": "Address credits used up",
           "status": 402,
           "detail": "The address credits (or the free trial) of the business this key serves are used up or have expired. Add address credits for it, in the dashboard or by email, and the key answers again at once; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Address lookup is not switched on for this key; Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_lookup_not_enabled": {
          "summary": "Address lookup is not switched on for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_lookup_not_enabled",
           "title": "Address lookup is not switched on for this key",
           "status": 403,
           "detail": "Address lookup answers keys whose business has accepted the End User Terms in the dashboard. Switch it on there (an agency adds one business per client), or join the early-access list while it opens.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-status": "preview",
    "x-billing": "1 address credit when found"
   }
  },
  "/addresses/{udprn}": {
   "get": {
    "operationId": "addressByUdprn",
    "tags": [
     "Addresses"
    ],
    "summary": "One address by UDPRN (early access)",
    "description": "The full address for a UDPRN, the number of one delivery point (a stored address, re-checked). Early access: a key answers once the business it serves has Address lookup switched on in the dashboard (End User Terms accepted). The account's first business gets 50 free addresses to test with, for 90 days from its first lookup; businesses added later start with a pack. Join at clearpostcode.co.uk/address-lookup.\n\nBilling: 1 address credit when found. Works with publishable (browser) keys.",
    "parameters": [
     {
      "name": "udprn",
      "in": "path",
      "required": true,
      "description": "The Unique Delivery Point Reference Number (up to 8 digits).",
      "schema": {
       "type": "string"
      },
      "example": "90000001"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Server-Timing": {
        "$ref": "#/components/headers/Server-Timing"
       },
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimit-Policy"
       },
       "RateLimit-Limit": {
        "$ref": "#/components/headers/RateLimit-Limit"
       },
       "RateLimit-Remaining": {
        "$ref": "#/components/headers/RateLimit-Remaining"
       },
       "RateLimit-Reset": {
        "$ref": "#/components/headers/RateLimit-Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Address"
          },
          "meta": {
           "$ref": "#/components/schemas/AddressMeta"
          }
         },
         "required": [
          "data",
          "meta"
         ],
         "additionalProperties": false
        },
        "example": {
         "data": {
          "udprn": "90000001",
          "umprn": null,
          "uprn": null,
          "line_1": "1 Lime Tree Avenue",
          "line_2": "Clifton",
          "line_3": "",
          "post_town": "MAPLEBURY",
          "postcode": "AB10 1AA",
          "organisation_name": "",
          "department_name": "",
          "sub_building_name": "",
          "building_name": "",
          "building_number": "1",
          "dependant_thoroughfare": "",
          "thoroughfare": "Lime Tree Avenue",
          "double_dependant_locality": "",
          "dependant_locality": "Clifton",
          "po_box": "",
          "postcode_type": "S",
          "delivery_point_suffix": "1A",
          "su_organisation_indicator": false,
          "households": 1,
          "postal_county": "Mapleshire",
          "traditional_county": "Old Mapleshire",
          "administrative_county": "Maple Council",
          "welsh": null
         },
         "meta": {
          "edition": "2026-12",
          "coverage": "Every UK address that receives post, Northern Ireland included",
          "source": "Address lookup",
          "acknowledgement": "The data owner's credit line, as it asks us to show it.",
          "terms": "https://clearpostcode.co.uk/address-lookup/terms",
          "docs": "https://clearpostcode.co.uk/developers/docs"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; Secret key sent in the URL; Unknown parameter",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "bad_request": {
          "summary": "Bad request",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#bad_request",
           "title": "Bad request",
           "status": 400,
           "detail": "A parameter is missing or out of range (an unknown field in fields=, a cursor from another list); the detail says which.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_url": {
          "summary": "Secret key sent in the URL",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_url",
           "title": "Secret key sent in the URL",
           "status": 400,
           "detail": "A secret key arrived in ?key=. Send secret keys in the X-Api-Key header; only publishable keys may ride in the URL.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "unknown_parameter": {
          "summary": "Unknown parameter",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#unknown_parameter",
           "title": "Unknown parameter",
           "status": 400,
           "detail": "The query carries a parameter this endpoint doesn't take. The problem names it and lists the ones it does; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Invalid API key; API key required",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "invalid_key": {
          "summary": "Invalid API key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#invalid_key",
           "title": "Invalid API key",
           "status": 401,
           "detail": "The key is malformed, revoked or unknown, or the variable holding it is not set. Check it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "key_required": {
          "summary": "API key required",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#key_required",
           "title": "API key required",
           "status": 401,
           "detail": "This endpoint needs a key. Get one free in under a minute.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Address credits used up",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_credits_exhausted": {
          "summary": "Address credits used up",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_credits_exhausted",
           "title": "Address credits used up",
           "status": 402,
           "detail": "The address credits (or the free trial) of the business this key serves are used up or have expired. Add address credits for it, in the dashboard or by email, and the key answers again at once; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Address lookup is not switched on for this key; Secret key used in a browser; Origin not allowed for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "address_lookup_not_enabled": {
          "summary": "Address lookup is not switched on for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#address_lookup_not_enabled",
           "title": "Address lookup is not switched on for this key",
           "status": 403,
           "detail": "Address lookup answers keys whose business has accepted the End User Terms in the dashboard. Switch it on there (an agency adds one business per client), or join the early-access list while it opens.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "secret_key_in_browser": {
          "summary": "Secret key used in a browser",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#secret_key_in_browser",
           "title": "Secret key used in a browser",
           "status": 403,
           "detail": "A secret key arrived from a web page. Keep secret keys on your server; use a publishable key in browsers.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "origin_not_allowed": {
          "summary": "Origin not allowed for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#origin_not_allowed",
           "title": "Origin not allowed for this key",
           "status": 403,
           "detail": "The page's domain isn't on this publishable key's list. Add it in your dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_found": {
          "summary": "Not found",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_found",
           "title": "Not found",
           "status": 404,
           "detail": "No such endpoint or resource.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "method_not_allowed": {
          "summary": "Method not allowed",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#method_not_allowed",
           "title": "Method not allowed",
           "status": 405,
           "detail": "The endpoint exists but takes another method; see the Allow header.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "406": {
      "description": "JSON only",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "not_acceptable": {
          "summary": "JSON only",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#not_acceptable",
           "title": "JSON only",
           "status": 406,
           "detail": "The Accept header rules out JSON. Every answer is JSON: accept application/json (or */*).",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too many requests; Daily cap reached for this key",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "rate_limited": {
          "summary": "Too many requests",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#rate_limited",
           "title": "Too many requests",
           "status": 429,
           "detail": "Too many requests in a short time, or the day's keyless allowance for your network. Wait for Retry-After seconds, or send a free key.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         },
         "daily_cap_reached": {
          "summary": "Daily cap reached for this key",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#daily_cap_reached",
           "title": "Daily cap reached for this key",
           "status": 429,
           "detail": "The key's owner set a daily cap and today's is reached. It opens again at midnight UTC; change the cap in the dashboard.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "server_error": {
          "summary": "Something went wrong on our side",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#server_error",
           "title": "Something went wrong on our side",
           "status": 500,
           "detail": "Retry with backoff; quote the request_id if it persists.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Briefly unavailable",
      "headers": {
       "X-Request-Id": {
        "$ref": "#/components/headers/X-Request-Id"
       },
       "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        },
        "examples": {
         "service_unavailable": {
          "summary": "Briefly unavailable",
          "value": {
           "type": "https://clearpostcode.co.uk/developers/docs/errors#service_unavailable",
           "title": "Briefly unavailable",
           "status": 503,
           "detail": "A moment's interruption. Retry after the Retry-After seconds; nothing was billed.",
           "instance": "/v1/…",
           "request_id": "8f1c2a7d9b3e4f60-LHR"
          }
         }
        }
       }
      }
     }
    },
    "x-status": "preview",
    "x-billing": "1 address credit when found"
   }
  }
 },
 "components": {
  "securitySchemes": {
   "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Api-Key"
   },
   "Bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "headers": {
   "X-Request-Id": {
    "description": "This call's id: quote it and we can trace the call.",
    "schema": {
     "type": "string"
    }
   },
   "Server-Timing": {
    "description": "Time spent on our side (app;dur=<ms>).",
    "schema": {
     "type": "string"
    }
   },
   "RateLimit": {
    "description": "IETF RateLimit: the limit closest to running out, e.g. \"month\";r=9588;t=1814400 (remaining, seconds to reset).",
    "schema": {
     "type": "string"
    }
   },
   "RateLimit-Policy": {
    "description": "IETF RateLimit-Policy: every limit on this caller, e.g. \"burst\";q=100;w=10, \"month\";q=10000;w=2592000.",
    "schema": {
     "type": "string"
    }
   },
   "RateLimit-Limit": {
    "description": "The same limit as RateLimit, in the three-field form: the quota (a keyed call: the month's lookups; keyless: the day's calls).",
    "schema": {
     "type": "integer"
    }
   },
   "RateLimit-Remaining": {
    "description": "What is left of it.",
    "schema": {
     "type": "integer"
    }
   },
   "RateLimit-Reset": {
    "description": "Seconds until it resets.",
    "schema": {
     "type": "integer"
    }
   },
   "Retry-After": {
    "description": "Seconds to wait before retrying (429, 503).",
    "schema": {
     "type": "integer"
    }
   },
   "ETag": {
    "description": "Weak validator for If-None-Match: a matching request answers a free 304.",
    "schema": {
     "type": "string"
    }
   }
  },
  "schemas": {
   "Named": {
    "anyOf": [
     {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "name": {
        "type": [
         "string",
         "null"
        ]
       }
      },
      "required": [
       "code",
       "name"
      ],
      "additionalProperties": false
     },
     {
      "type": "null"
     }
    ]
   },
   "Postcode": {
    "type": "object",
    "properties": {
     "postcode": {
      "type": "string",
      "description": "Canonical form, e.g. \"SW1A 1AA\"."
     },
     "status": {
      "enum": [
       "live",
       "terminated"
      ]
     },
     "outcode": {
      "type": "string"
     },
     "incode": {
      "type": "string"
     },
     "sector": {
      "type": "string"
     },
     "district": {
      "type": "string"
     },
     "area": {
      "type": "string"
     },
     "introduced": {
      "type": [
       "string",
       "null"
      ],
      "description": "YYYY-MM"
     },
     "terminated": {
      "type": [
       "string",
       "null"
      ],
      "description": "YYYY-MM"
     },
     "replaced_by": {
      "type": [
       "string",
       "null"
      ],
      "description": "For a terminated postcode: the nearest live postcode."
     },
     "user_type": {
      "enum": [
       "small",
       "large"
      ]
     },
     "location": {
      "type": "object",
      "properties": {
       "latitude": {
        "type": [
         "number",
         "null"
        ]
       },
       "longitude": {
        "type": [
         "number",
         "null"
        ]
       },
       "easting": {
        "type": [
         "integer",
         "null"
        ]
       },
       "northing": {
        "type": [
         "integer",
         "null"
        ]
       },
       "positional_quality": {
        "type": [
         "integer",
         "null"
        ]
       },
       "positional_quality_label": {
        "type": [
         "string",
         "null"
        ]
       }
      },
      "required": [
       "latitude",
       "longitude",
       "easting",
       "northing",
       "positional_quality",
       "positional_quality_label"
      ],
      "additionalProperties": false
     },
     "country": {
      "$ref": "#/components/schemas/Named"
     },
     "region": {
      "$ref": "#/components/schemas/Named"
     },
     "county": {
      "$ref": "#/components/schemas/Named"
     },
     "county_electoral_division": {
      "$ref": "#/components/schemas/Named"
     },
     "local_authority": {
      "$ref": "#/components/schemas/Named"
     },
     "ward": {
      "$ref": "#/components/schemas/Named"
     },
     "parish": {
      "$ref": "#/components/schemas/Named"
     },
     "constituency": {
      "$ref": "#/components/schemas/Named"
     },
     "police_force": {
      "$ref": "#/components/schemas/Named"
     },
     "nhs_region": {
      "$ref": "#/components/schemas/Named"
     },
     "icb": {
      "$ref": "#/components/schemas/Named"
     },
     "sub_icb": {
      "$ref": "#/components/schemas/Named"
     },
     "national_park": {
      "$ref": "#/components/schemas/Named"
     },
     "built_up_area": {
      "$ref": "#/components/schemas/Named"
     },
     "travel_to_work_area": {
      "$ref": "#/components/schemas/Named"
     },
     "lsoa": {
      "$ref": "#/components/schemas/Named"
     },
     "msoa": {
      "$ref": "#/components/schemas/Named"
     },
     "output_area": {
      "type": [
       "string",
       "null"
      ]
     },
     "rural_urban": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "name": {
          "type": [
           "string",
           "null"
          ]
         },
         "urban": {
          "type": [
           "boolean",
           "null"
          ]
         }
        },
        "required": [
         "code",
         "name",
         "urban"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     },
     "area_classification": {
      "type": [
       "string",
       "null"
      ]
     },
     "deprivation": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "index": {
          "type": "string"
         },
         "rank": {
          "type": "integer"
         },
         "of": {
          "type": "integer"
         },
         "decile": {
          "type": "integer"
         }
        },
        "required": [
         "index",
         "rank",
         "of",
         "decile"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "postcode",
     "status"
    ],
    "additionalProperties": false
   },
   "Validation": {
    "type": "object",
    "properties": {
     "input": {
      "type": "string"
     },
     "postcode": {
      "type": [
       "string",
       "null"
      ]
     },
     "format_valid": {
      "type": "boolean"
     },
     "known": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "status": {
      "enum": [
       "live",
       "terminated",
       null
      ]
     },
     "valid": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "coverage": {
      "enum": [
       "covered",
       "not_covered"
      ]
     },
     "country": {
      "$ref": "#/components/schemas/Named"
     },
     "replaced_by": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "input",
     "postcode",
     "format_valid",
     "known",
     "status",
     "valid",
     "coverage",
     "country",
     "replaced_by"
    ],
    "additionalProperties": false
   },
   "Near": {
    "type": "object",
    "properties": {
     "postcode": {
      "type": "string"
     },
     "distance_m": {
      "type": "integer"
     },
     "latitude": {
      "type": "number"
     },
     "longitude": {
      "type": "number"
     }
    },
    "required": [
     "postcode",
     "distance_m",
     "latitude",
     "longitude"
    ],
    "additionalProperties": false
   },
   "BulkItem": {
    "type": "object",
    "properties": {
     "query": {
      "type": "string"
     },
     "result": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Postcode"
       },
       {
        "type": "null"
       }
      ]
     },
     "error": {
      "enum": [
       "invalid_postcode",
       "not_covered",
       "postcode_not_found"
      ]
     }
    },
    "required": [
     "query",
     "result"
    ],
    "additionalProperties": false
   },
   "ReverseItem": {
    "type": "object",
    "properties": {
     "query": {
      "type": "object",
      "properties": {
       "latitude": {
        "type": [
         "number",
         "null"
        ]
       },
       "longitude": {
        "type": [
         "number",
         "null"
        ]
       }
      },
      "required": [
       "latitude",
       "longitude"
      ],
      "additionalProperties": false
     },
     "result": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Near"
      }
     },
     "error": {
      "const": "bad_point"
     }
    },
    "required": [
     "query",
     "result"
    ],
    "additionalProperties": false
   },
   "Suggestion": {
    "oneOf": [
     {
      "type": "object",
      "properties": {
       "type": {
        "const": "district"
       },
       "outcode": {
        "type": "string"
       },
       "postcodes": {
        "type": "integer"
       }
      },
      "required": [
       "type",
       "outcode",
       "postcodes"
      ],
      "additionalProperties": false
     },
     {
      "type": "object",
      "properties": {
       "type": {
        "const": "postcode"
       },
       "postcode": {
        "type": "string"
       }
      },
      "required": [
       "type",
       "postcode"
      ],
      "additionalProperties": false
     }
    ]
   },
   "Distance": {
    "type": "object",
    "properties": {
     "from": {
      "type": "object",
      "properties": {
       "postcode": {
        "type": "string"
       },
       "latitude": {
        "type": "number"
       },
       "longitude": {
        "type": "number"
       },
       "easting": {
        "type": "integer"
       },
       "northing": {
        "type": "integer"
       },
       "positional_quality": {
        "type": "integer"
       },
       "positional_quality_label": {
        "type": "string"
       }
      },
      "required": [
       "postcode",
       "latitude",
       "longitude",
       "easting",
       "northing",
       "positional_quality",
       "positional_quality_label"
      ],
      "additionalProperties": false
     },
     "to": {
      "type": "object",
      "properties": {
       "postcode": {
        "type": "string"
       },
       "latitude": {
        "type": "number"
       },
       "longitude": {
        "type": "number"
       },
       "easting": {
        "type": "integer"
       },
       "northing": {
        "type": "integer"
       },
       "positional_quality": {
        "type": "integer"
       },
       "positional_quality_label": {
        "type": "string"
       }
      },
      "required": [
       "postcode",
       "latitude",
       "longitude",
       "easting",
       "northing",
       "positional_quality",
       "positional_quality_label"
      ],
      "additionalProperties": false
     },
     "km": {
      "type": "number"
     },
     "miles": {
      "type": "number"
     },
     "bearing_deg": {
      "type": "integer"
     },
     "direction": {
      "type": "string"
     },
     "method": {
      "type": "string"
     }
    },
    "required": [
     "from",
     "to",
     "km",
     "miles",
     "bearing_deg",
     "direction",
     "method"
    ],
    "additionalProperties": false
   },
   "District": {
    "type": "object",
    "properties": {
     "district": {
      "type": "string"
     },
     "area": {
      "type": "string"
     },
     "area_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "live": {
      "type": "integer"
     },
     "terminated": {
      "type": "integer"
     },
     "large_user": {
      "type": "integer"
     },
     "sectors": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "sector": {
         "type": "string"
        },
        "live": {
         "type": "integer"
        },
        "terminated": {
         "type": "integer"
        }
       },
       "required": [
        "sector",
        "live",
        "terminated"
       ],
       "additionalProperties": false
      }
     },
     "centre": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "latitude": {
          "type": "number"
         },
         "longitude": {
          "type": "number"
         }
        },
        "required": [
         "latitude",
         "longitude"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     },
     "country": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "name": {
          "type": [
           "string",
           "null"
          ]
         }
        },
        "required": [
         "code",
         "name"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     },
     "regions": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "counties": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "local_authorities": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "wards": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "constituencies": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "police_forces": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "icbs": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "national_parks": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "built_up_areas": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "parishes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        },
        "share": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes",
        "share"
       ],
       "additionalProperties": false
      }
     },
     "urban_share": {
      "type": [
       "integer",
       "null"
      ]
     },
     "deprivation": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "index": {
          "type": "string"
         },
         "deciles": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         }
        },
        "required": [
         "index",
         "deciles"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     },
     "places": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        },
        "type": {
         "type": "string"
        }
       },
       "required": [
        "name",
        "type"
       ],
       "additionalProperties": false
      }
     },
     "neighbours": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "newest": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "postcode": {
         "type": "string"
        },
        "introduced": {
         "type": [
          "string",
          "null"
         ]
        }
       },
       "required": [
        "postcode",
        "introduced"
       ],
       "additionalProperties": false
      }
     },
     "oldest_introduced": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "district",
     "area",
     "area_name",
     "live",
     "terminated",
     "large_user",
     "sectors",
     "centre",
     "country",
     "regions",
     "counties",
     "local_authorities",
     "wards",
     "constituencies",
     "police_forces",
     "icbs",
     "national_parks",
     "built_up_areas",
     "parishes",
     "urban_share",
     "deprivation",
     "places",
     "neighbours",
     "newest",
     "oldest_introduced"
    ],
    "additionalProperties": false
   },
   "OutcodePostcode": {
    "type": "object",
    "properties": {
     "postcode": {
      "type": "string"
     },
     "latitude": {
      "type": [
       "number",
       "null"
      ]
     },
     "longitude": {
      "type": [
       "number",
       "null"
      ]
     }
    },
    "required": [
     "postcode",
     "latitude",
     "longitude"
    ],
    "additionalProperties": false
   },
   "Sector": {
    "type": "object",
    "properties": {
     "sector": {
      "type": "string"
     },
     "district": {
      "type": "string"
     },
     "live": {
      "type": "integer"
     },
     "centre": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "latitude": {
          "type": "number"
         },
         "longitude": {
          "type": "number"
         }
        },
        "required": [
         "latitude",
         "longitude"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     },
     "local_authorities": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes"
       ],
       "additionalProperties": false
      }
     },
     "wards": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes"
       ],
       "additionalProperties": false
      }
     },
     "constituencies": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes"
       ],
       "additionalProperties": false
      }
     },
     "parishes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "postcodes": {
         "type": "integer"
        }
       },
       "required": [
        "code",
        "name",
        "postcodes"
       ],
       "additionalProperties": false
      }
     },
     "postcodes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "postcode": {
         "type": "string"
        },
        "latitude": {
         "type": [
          "number",
          "null"
         ]
        },
        "longitude": {
         "type": [
          "number",
          "null"
         ]
        },
        "user_type": {
         "enum": [
          "small",
          "large"
         ]
        }
       },
       "required": [
        "postcode",
        "latitude",
        "longitude",
        "user_type"
       ],
       "additionalProperties": false
      }
     }
    },
    "required": [
     "sector",
     "district",
     "live",
     "centre",
     "local_authorities",
     "wards",
     "constituencies",
     "parishes",
     "postcodes"
    ],
    "additionalProperties": false
   },
   "Area": {
    "type": "object",
    "properties": {
     "area": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "live": {
      "type": "integer"
     },
     "terminated": {
      "type": "integer"
     },
     "districts": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "district": {
         "type": "string"
        },
        "live": {
         "type": "integer"
        },
        "terminated": {
         "type": "integer"
        },
        "local_authority": {
         "type": [
          "string",
          "null"
         ]
        }
       },
       "required": [
        "district",
        "live",
        "terminated",
        "local_authority"
       ],
       "additionalProperties": false
      }
     }
    },
    "required": [
     "area",
     "name",
     "live",
     "terminated",
     "districts"
    ],
    "additionalProperties": false
   },
   "Place": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "alternative_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "type": {
      "type": "string"
     },
     "district": {
      "type": "string"
     },
     "latitude": {
      "type": "number"
     },
     "longitude": {
      "type": "number"
     },
     "local_authority": {
      "type": [
       "string",
       "null"
      ]
     },
     "county": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "name",
     "alternative_name",
     "type",
     "district",
     "latitude",
     "longitude",
     "local_authority",
     "county"
    ],
    "additionalProperties": false
   },
   "Usage": {
    "type": "object",
    "properties": {
     "plan": {
      "enum": [
       "free",
       "starter",
       "pro",
       "business"
      ]
     },
     "plan_name": {
      "type": "string"
     },
     "period_start": {
      "type": "string"
     },
     "resets": {
      "type": "string"
     },
     "allowance": {
      "type": "integer"
     },
     "used": {
      "type": "integer"
     },
     "remaining": {
      "type": "integer"
     },
     "credits": {
      "type": "integer"
     }
    },
    "required": [
     "plan",
     "plan_name",
     "period_start",
     "resets",
     "allowance",
     "used",
     "remaining",
     "credits"
    ],
    "additionalProperties": false
   },
   "Address": {
    "type": "object",
    "properties": {
     "udprn": {
      "type": "string",
      "description": "The Unique Delivery Point Reference Number: one delivery point's own number."
     },
     "umprn": {
      "type": [
       "string",
       "null"
      ],
      "description": "Multiple Residence unit number (null: not a unit)."
     },
     "uprn": {
      "type": [
       "string",
       "null"
      ],
      "description": "Ordnance Survey's property id where held (null otherwise)."
     },
     "line_1": {
      "type": "string"
     },
     "line_2": {
      "type": "string"
     },
     "line_3": {
      "type": "string"
     },
     "post_town": {
      "type": "string"
     },
     "postcode": {
      "type": "string"
     },
     "organisation_name": {
      "type": "string"
     },
     "department_name": {
      "type": "string"
     },
     "sub_building_name": {
      "type": "string"
     },
     "building_name": {
      "type": "string"
     },
     "building_number": {
      "type": "string"
     },
     "dependant_thoroughfare": {
      "type": "string"
     },
     "thoroughfare": {
      "type": "string"
     },
     "double_dependant_locality": {
      "type": "string"
     },
     "dependant_locality": {
      "type": "string"
     },
     "po_box": {
      "type": "string"
     },
     "postcode_type": {
      "enum": [
       "S",
       "L"
      ],
      "description": "S: a small user postcode; L: a large user with its own postcode."
     },
     "delivery_point_suffix": {
      "type": "string",
      "description": "With the postcode, identifies the delivery point (1A to 9T)."
     },
     "su_organisation_indicator": {
      "type": "boolean",
      "description": "A small user organisation is at this address."
     },
     "households": {
      "type": "integer",
      "description": "Households behind this delivery point (more than 1: multiple occupancy)."
     },
     "postal_county": {
      "type": "string"
     },
     "traditional_county": {
      "type": "string"
     },
     "administrative_county": {
      "type": "string"
     },
     "welsh": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "line_1": {
          "type": "string"
         },
         "line_2": {
          "type": "string"
         },
         "line_3": {
          "type": "string"
         },
         "post_town": {
          "type": "string"
         },
         "dependant_locality": {
          "type": "string"
         },
         "double_dependant_locality": {
          "type": "string"
         },
         "thoroughfare": {
          "type": "string"
         },
         "dependant_thoroughfare": {
          "type": "string"
         }
        },
        "required": [
         "line_1",
         "line_2",
         "line_3",
         "post_town",
         "dependant_locality",
         "double_dependant_locality",
         "thoroughfare",
         "dependant_thoroughfare"
        ],
        "additionalProperties": false
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "udprn",
     "umprn",
     "uprn",
     "line_1",
     "line_2",
     "line_3",
     "post_town",
     "postcode",
     "organisation_name",
     "department_name",
     "sub_building_name",
     "building_name",
     "building_number",
     "dependant_thoroughfare",
     "thoroughfare",
     "double_dependant_locality",
     "dependant_locality",
     "po_box"
    ],
    "additionalProperties": false
   },
   "AddressSuggestion": {
    "oneOf": [
     {
      "type": "object",
      "properties": {
       "kind": {
        "const": "address"
       },
       "id": {
        "type": "string",
        "description": "Resolve with /addresses/retrieve/{id}."
       },
       "suggestion": {
        "type": "string",
        "description": "The line to show the customer."
       }
      },
      "required": [
       "kind",
       "id",
       "suggestion"
      ],
      "additionalProperties": false
     },
     {
      "type": "object",
      "properties": {
       "kind": {
        "const": "container"
       },
       "id": {
        "type": "string",
        "description": "Pass as container= to list what it holds."
       },
       "suggestion": {
        "type": "string"
       },
       "type": {
        "enum": [
         "postcode",
         "sector",
         "street",
         "building"
        ]
       },
       "count": {
        "type": "integer"
       }
      },
      "required": [
       "kind",
       "id",
       "suggestion",
       "type",
       "count"
      ],
      "additionalProperties": false
     }
    ]
   },
   "AddressMeta": {
    "type": "object",
    "properties": {
     "edition": {
      "type": "string",
      "description": "The address data edition answering."
     },
     "coverage": {
      "type": "string"
     },
     "source": {
      "type": "string"
     },
     "acknowledgement": {
      "type": "string",
      "description": "The data owner's credit line: show it where your product credits its data."
     },
     "terms": {
      "type": "string",
      "description": "The End User Terms this data is used under."
     },
     "docs": {
      "type": "string"
     },
     "total": {
      "type": "integer"
     },
     "next_cursor": {
      "type": [
       "string",
       "null"
      ]
     },
     "next": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "edition",
     "coverage",
     "source",
     "acknowledgement",
     "terms",
     "docs"
    ],
    "additionalProperties": false
   },
   "Meta": {
    "type": "object",
    "properties": {
     "edition": {
      "type": "string",
      "description": "The ONS Postcode Directory edition, YYYY-MM."
     },
     "next_edition": {
      "type": "string",
      "description": "The next quarterly edition, YYYY-MM."
     },
     "next_edition_expected": {
      "type": "object",
      "properties": {
       "from": {
        "type": "string"
       },
       "to": {
        "type": "string"
       }
      },
      "required": [
       "from",
       "to"
      ],
      "additionalProperties": false,
      "description": "The dates the ONS usually publishes it between."
     },
     "coverage": {
      "type": "string"
     },
     "licence": {
      "type": "string"
     },
     "attribution": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "docs": {
      "type": "string"
     },
     "radius_m": {
      "type": "integer"
     },
     "found": {
      "type": "integer"
     },
     "sent": {
      "type": "integer"
     },
     "total": {
      "type": "integer"
     },
     "next_cursor": {
      "type": [
       "string",
       "null"
      ]
     },
     "next": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": "string"
     },
     "acknowledgement": {
      "type": "string",
      "description": "The data owner's credit line, on an answer that used address data (a Northern Ireland postcode validated against it)."
     }
    },
    "required": [
     "edition",
     "next_edition",
     "next_edition_expected",
     "coverage",
     "licence",
     "attribution",
     "docs"
    ],
    "additionalProperties": false
   },
   "Problem": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "format": "uri"
     },
     "title": {
      "type": "string"
     },
     "status": {
      "type": "integer"
     },
     "detail": {
      "type": "string"
     },
     "instance": {
      "type": "string"
     },
     "request_id": {
      "type": "string"
     },
     "postcode": {
      "type": "string"
     },
     "format_valid": {
      "type": "boolean"
     },
     "known": {
      "type": "boolean"
     },
     "coverage": {
      "const": "not_covered"
     },
     "country": {
      "type": "string"
     },
     "upgrade": {
      "type": "string"
     },
     "resets": {
      "type": "string"
     },
     "fields": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "early_access": {
      "type": "string"
     },
     "setup": {
      "type": "string",
      "description": "Where to switch Address lookup on for this key."
     },
     "parameters": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "accepted": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    },
    "required": [
     "type",
     "title",
     "status",
     "detail",
     "instance",
     "request_id"
    ],
    "additionalProperties": false
   }
  }
 }
}