Tyche Labs data APIs
Docs menu: Postcode check

Postcode check

One call with a postcode in Great Britain returns its area codes, the Environment Agency flood risk, a 12-month crime summary from police.uk and the nearest schools with their latest Ofsted outcome.

Try it with the sandbox keySandbox data, free, nothing billed
Uses the public sandbox key. Paste your own tl_test_ key to try your account.
// The response appears here.

Check a postcode

GET/v1/postcodes/{postcode}?include=areas,flood,crime,schools

Spaces and case are ignored. Ask for only the parts you need with include (default all). schools sets how many schools to return (1 to 10, default 5) and phase filters them (primary, secondary or all). One call counts as one check.

curl https://api.tychelabs.net/v1/postcodes/SW1A2AA \
  -H "x-api-key: $TYCHE_API_KEY"

Fields

FieldTypeDescription
postcodestringFormatted postcode
areasobjectoutcode, incode, status (live or terminated), terminated, latitude, longitude, eastings, northings, country, region, localAuthority, county, ward, parish, parliamentaryConstituency (2024 boundaries), lsoa21, msoa21, outputArea21, policeForceArea, nhs (ICB and sub-ICB), ruralUrban. Areas have code and name.
floodobject|nullrelease, addressesByRisk (high, medium, low), addressesAtRisk, groundwater, sources, note and a link to the official checker (England)
crimeobject|nullmonths, latestMonth, total, byCategory, byMonth and the radius searched (England and Wales). Very busy areas may come back as pending: retry after Retry-After.
schoolsobject|nullphase, limit and items[]: urn, name, phase, type, distanceMetres, postcode and ofsted (England)

Coverage

Area codes cover England, Scotland and Wales, including terminated postcodes (flagged). Northern Ireland postcodes (BT) need a separate commercial licence, and the Channel Islands and the Isle of Man are outside the directory's open data: all return 422 unsupported_region, which is not counted. Flood risk and schools cover England; crime covers England and Wales. When a part is not available for a postcode it is null and meta.sources says why.

Ofsted outcomes

Ofsted replaced single-word overall grades with report cards for inspections from November 2025. Each school's ofsted object says which framework its latest inspection used, with the overall grade for older inspections and the report card grades where published.

Example response

{
  "data": {
    "postcode": "SW1A 2AA",
    "areas": {
      "postcode": "SW1A 2AA",
      "outcode": "SW1A",
      "incode": "2AA",
      "status": "live",
      "terminated": null,
      "usertype": "large",
      "latitude": 51.50101,
      "longitude": -0.141563,
      "eastings": 529090,
      "northings": 179645,
      "positionalQuality": 1,
      "country": {
        "code": "E92000001",
        "name": "England"
      },
      "region": {
        "code": "E12000007",
        "name": "London"
      },
      "localAuthority": {
        "code": "E09000033",
        "name": "Westminster"
      },
      "county": null,
      "ward": {
        "code": "E05013806",
        "name": "St James's"
      },
      "parish": {
        "code": "E43000236",
        "name": "Westminster, unparished area"
      },
      "parliamentaryConstituency": {
        "code": "E14001172",
        "name": "Cities of London and Westminster",
        "boundaries": "2024"
      },
      "lsoa21": {
        "code": "E01004736",
        "name": "Westminster 018C",
        "type": "lsoa_2021"
      },
      "msoa21": {
        "code": "E02000977",
        "name": "Westminster 018",
        "type": "msoa_2021"
      },
      "outputArea21": "E00023938",
      "policeForceArea": {
        "code": "E23000001",
        "name": "Metropolitan Police"
      },
      "nhs": {
        "icb": {
          "code": "E54000071",
          "name": "NHS West and North London Integrated Care Board"
        },
        "subIcbLocation": {
          "code": "E38000256",
          "name": "NHS West and North London ICB - W2U3Z"
        }
      },
      "ruralUrban": {
        "code": "UN1",
        "description": "Urban: Nearer to a major town or city",
        "urbanRural": "Urban",
        "classification": "Rural Urban Classification 2021"
      }
    },
    "flood": {
      "release": "2026-11-11",
      "inDataset": true,
      "addressesByRisk": {
        "high": 0,
        "medium": 2,
        "low": 5
      },
      "addressesAtRisk": 7,
      "groundwater": "unlikely",
      "sources": [
        "Risk of Flooding from Rivers and Sea",
        "Risk of Flooding from Surface Water",
        "Groundwater flood alert areas"
      ],
      "note": "Number of addresses in the postcode in areas at high (3.3% or more a year), medium (1% to 3.3%) and low (0.1% to 1%) long-term flood risk, taking the higher of the risk from rivers and the sea and from surface water. Addresses at very low risk are not counted. Groundwater is separate: possible when any address is in a groundwater flood alert area. The risk is for the area around each address, not the building.",
      "checkUrl": "https://www.gov.uk/check-long-term-flood-risk"
    },
    "crime": {
      "months": [
        "2025-10",
        "2025-11",
        "2025-12",
        "2026-01",
        "2026-02",
        "2026-03",
        "2026-04",
        "2026-05",
        "2026-06",
        "2026-07",
        "2026-08",
        "2026-09"
      ],
      "latestMonth": "2026-09",
      "total": 1284,
      "byCategory": {
        "theft-from-the-person": 402,
        "other-theft": 233,
        "anti-social-behaviour": 188,
        "violent-crime": 151,
        "shoplifting": 96,
        "robbery": 71,
        "public-order": 52,
        "bicycle-theft": 31,
        "criminal-damage-arson": 22,
        "drugs": 18,
        "vehicle-crime": 11,
        "burglary": 6,
        "possession-of-weapons": 2,
        "other-crime": 1
      },
      "radius": {
        "metres": 805,
        "description": "Within about half a mile of the postcode (police.uk refuses areas with more than 10,000 crimes a month, so we used a smaller area)",
        "reduced": true,
        "centre": {
          "latitude": 51.501,
          "longitude": -0.142
        }
      },
      "note": "Street-level crimes and anti-social behaviour reported by police forces to police.uk. Locations are approximate: police.uk moves each crime to a nearby anonymous map point."
    },
    "schools": {
      "phase": "all",
      "limit": 2,
      "items": [
        {
          "urn": 100000,
          "name": "Sandbox Church of England Primary School",
          "phase": "Primary",
          "type": "Voluntary aided school",
          "typeGroup": "Local authority maintained schools",
          "distanceMetres": 412,
          "postcode": "SW1P 1AA",
          "localAuthority": "Westminster",
          "ageRange": {
            "low": 3,
            "high": 11
          },
          "gender": "Mixed",
          "ofsted": {
            "framework": "report_card",
            "overallEffectiveness": null,
            "reportCard": {
              "safeguarding": "Met",
              "inclusion": "Strong standard",
              "curriculumAndTeaching": "Expected standard",
              "achievement": "Expected standard",
              "attendanceAndBehaviour": "Strong standard",
              "personalDevelopmentAndWellbeing": "Expected standard",
              "earlyYears": "Expected standard",
              "post16": null,
              "leadershipAndGovernance": "Expected standard"
            },
            "categoryOfConcern": null,
            "inspectionType": "S5 Inspection",
            "inspectedOn": "2026-03-10",
            "publishedOn": "2026-04-21",
            "relatesToPredecessorSchool": false,
            "previousGradedInspection": {
              "framework": "grade",
              "overallEffectiveness": "Good",
              "judgements": {
                "qualityOfEducation": "Good",
                "behaviourAndAttitudes": "Good",
                "personalDevelopment": "Outstanding",
                "leadershipAndManagement": "Good",
                "earlyYears": "Good"
              },
              "safeguardingEffective": true,
              "categoryOfConcern": null,
              "inspectedOn": "2019-05-14",
              "publishedOn": "2019-06-20",
              "relatesToPredecessorSchool": false,
              "reportUrl": null
            },
            "reportUrl": "https://reports.ofsted.gov.uk/"
          }
        },
        {
          "urn": 100001,
          "name": "Sandbox Academy",
          "phase": "Secondary",
          "type": "Academy converter",
          "typeGroup": "Academies",
          "distanceMetres": 730,
          "postcode": "SW1P 2AA",
          "localAuthority": "Westminster",
          "ageRange": {
            "low": 11,
            "high": 18
          },
          "gender": "Mixed",
          "ofsted": {
            "framework": "grade",
            "overallEffectiveness": "Good",
            "judgements": {
              "qualityOfEducation": "Good",
              "behaviourAndAttitudes": "Good",
              "personalDevelopment": "Good",
              "leadershipAndManagement": "Good",
              "sixthForm": "Good"
            },
            "safeguardingEffective": true,
            "categoryOfConcern": null,
            "inspectedOn": "2023-01-24",
            "publishedOn": "2023-03-02",
            "relatesToPredecessorSchool": false,
            "reportUrl": "https://reports.ofsted.gov.uk/",
            "latestUngradedInspection": {
              "inspectedOn": "2025-02-11",
              "publishedOn": "2025-03-20",
              "outcome": "School remains Good",
              "relatesToPredecessorSchool": false
            }
          }
        }
      ]
    }
  },
  "meta": {
    "requestId": "req_2c9d4e1f7a6b3c50",
    "sandbox": true,
    "partial": false,
    "stale": false,
    "sources": {
      "areas": {
        "status": "ok",
        "release": "August 2026",
        "cache": "sandbox"
      },
      "flood": {
        "status": "ok",
        "release": "2026-11-11",
        "cache": "sandbox"
      },
      "crime": {
        "status": "ok",
        "cache": "sandbox"
      },
      "schools": {
        "status": "ok",
        "release": {
          "gias": "2026-11-24",
          "ofsted": "2026-10-31"
        },
        "cache": "sandbox"
      }
    },
    "usage": {
      "plan": "free",
      "used": 4,
      "limit": 100,
      "period": "2026-11"
    }
  }
}