Ofsted API and Schools Search

Search schools in England, Wales and Scotland by postcode, with Ofsted ratings and Progress 8 scores for England

REST API
JSON Responses
API Key Authentication
1 Credit Per API Call

Ofsted API overview

The Schools Search API covers schools in England, Wales and Scotland. Search by postcode to find nearby schools with their type, phase, pupil numbers, contact details and distance. English schools also have Ofsted ratings, Progress 8 scores and age ranges.

Coverage by nation:

  • England: every establishment on the DfE Get Information about Schools register, with Ofsted and Progress 8 where published.
  • Wales: maintained and independent schools and pupil referral units from the Welsh Government address list of schools, with pupil numbers for maintained schools and the school language category.
  • Scotland: publicly funded schools from the Scottish Government school contact list, keyed by SEED code, with the medium of education. Independent schools are not included.

Results always come from the postcode's own nation, so a Welsh postcode near the border returns Welsh schools only. Each school has a nation and source. Estyn and Education Scotland publish inspection reports without an overall grade, so Welsh and Scottish schools return ofstedRating and inspection as null, and summary.inspectionNote explains why. Welsh schools sit at their postcode centroid; Scottish schools sit at their UPRN where OS Open UPRN has it.

Data included for each school:

  • Basic info — school name, URN, type, phase (Primary/Secondary/All through/16 plus), gender, religious character
  • Ofsted data — overall Ofsted rating (Outstanding/Good/Requires improvement/Inadequate) and date of last inspection
  • Performance — Progress 8 score and category for secondary schools
  • Capacity — number of pupils, school capacity, age range (statutory low/high age)
  • Contact — full address, postcode, telephone, website, headteacher name
  • Location — coordinates (lat/lng) and distance from search postcode in miles
  • Summary stats — Ofsted rating breakdown and phase breakdown for all results

This API is ideal for:

  • Property platforms showing nearby schools on listings
  • Relocation services helping families find schools
  • Estate agents providing catchment area information
  • Education technology platforms and school comparison tools
  • Property investors assessing area desirability for families

Authentication

All requests to the Schools Search API require authentication using an API key. You can obtain your API key from your PropertyInsights dashboard after subscribing to an API plan.

Include your API key in the request header as follows:

X-API-Key: your_api_key_here

Security Warning

Never expose your API key in client-side code. Always make API calls from your server-side application to protect your credentials.

Ofsted API endpoints

Base URL

https://propertyinsights.co.uk/api/v1/

Search Schools

GET
/schools/search

Returns nearby schools for the specified postcode, sorted by distance, with optional filtering by phase, Ofsted rating, and school type.

Request Parameters

ParameterRequiredTypeDescription
postcodeRequiredStringUK postcode to search near (e.g., "SW1A 1AA")
radiusOptionalFloatSearch radius in miles (default: 1, max: 10)
phaseOptionalStringFilter by phase: Primary, Secondary, 16 plus, All-through, Nursery. Welsh and Scottish schools also use Special.
ofstedRatingOptionalStringMinimum Ofsted rating: Outstanding, Good, Requires improvement, Inadequate. England only.
typeOptionalStringFilter by establishment type group (e.g., Academies, Free Schools). In Wales: Local authority maintained schools, Independent schools, Pupil referral units. In Scotland: Local authority schools, Grant-aided schools.
limitOptionalIntegerMaximum results to return (default: 20, max: 50)

The ofstedRating filter returns schools at the specified rating or better. For example, ofstedRating=Good returns both Outstanding and Good rated schools. Only open schools are included in results.

Billing details in the response

Successful chargeable JSON responses include a top-level billing object. The endpoint examples on this page focus on the endpoint-specific data, so this repeated block may not be shown in every example.

"billing": {
  "mode": "prepaid",
  "creditsCharged": 1,
  "creditsRemaining": 1999,
  "creditsRefreshAt": "2026-08-14T09:30:00.000Z"
}
Field or headerMeaning
billing.creditsCharged
X-Credits-Charged
Credits charged by this call. Failed and non-chargeable calls return 0 in the header.
billing.creditsRemaining
X-Credits-Remaining
The credit balance after the call.
billing.creditsRefreshAt
X-Credits-Refresh-At
The next monthly credit refresh as an ISO 8601 timestamp. Trial and non-renewing balances return null and omit the header.

All authenticated API-key calls expose the billing headers, including validation errors and zero-credit status or management requests. Only successful chargeable JSON responses add the billing object to the response body.

When credits run out

If your balance is lower than the cost of a request, the API returns HTTP 402 and charges nothing. The error includes the credits needed, your balance and a link to change plan.

{
  "statusCode": 402,
  "statusMessage": "Payment Required",
  "data": {
    "success": false,
    "error": {
      "code": "INSUFFICIENT_CREDITS",
      "message": "This request costs 35 API credits. Upgrade your plan or wait for your monthly refresh: https://propertyinsights.co.uk/billing",
      "required": 35,
      "available": 12,
      "upgradeUrl": "https://propertyinsights.co.uk/billing"
    }
  }
}

Response Format

The response is returned in JSON format with the following structure:

{
  "success": true,
  "data": {
    "schools": [ ... ],
    "summary": {
      "totalResults": 15,
      "searchRadius": 1,
      "searchPostcode": "SW1A 2AA",
      "nation": "England",
      "ofstedBreakdown": {
        "Outstanding": 2,
        "Good": 8,
        "Requires improvement": 3
      },
      "phaseBreakdown": {
        "Primary": 10,
        "Secondary": 5
      },
      "inspectionNote": null,
      "sources": {
        "dfe_gias": {
          "name": "Get Information about Schools, Department for Education",
          "licence": "Open Government Licence v3.0",
          "coverage": "England"
        }
      }
    }
  }
}

schools (array)

Each item in the array represents a single school, sorted by distance from the search postcode.

{
  "urn": 140123,
  "schoolCode": "140123",
  "nation": "England",
  "source": "dfe_gias",
  "name": "Westminster Academy",
  "phase": "Secondary",
  "type": "Academy sponsor led",
  "typeGroup": "Academies",
  "address": {
    "street": "15 Horseferry Road",
    "locality": "Westminster",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AB"
  },
  "ofstedRating": "Good",
  "ofstedLastInspection": "2024-03-15",
  "inspection": {
    "body": "Ofsted",
    "rating": "Good",
    "lastInspection": "2024-03-15"
  },
  "progress8Score": 0.45,
  "progress8Category": "Above average",
  "pupils": 1200,
  "capacity": 1350,
  "ageRange": {
    "low": 11,
    "high": 18
  },
  "gender": "Mixed",
  "religiousCharacter": "Does not apply",
  "admissionsPolicy": "Non-selective",
  "hasSixthForm": true,
  "languageMedium": null,
  "website": "https://www.westminsteracademy.org.uk",
  "telephone": "020 7123 4567",
  "headteacher": {
    "title": "Mrs",
    "firstName": "Jane",
    "lastName": "Smith"
  },
  "coordinates": {
    "lat": 51.4975,
    "lng": -0.1357
  },
  "distance": 0.3
}

Welsh or Scottish school

Fields the Welsh and Scottish lists do not publish are null. schoolCode is the Welsh school number or the Scottish SEED code, and locationMethod says how the school was placed.

{
  "urn": null,
  "schoolCode": "6812999",
  "nation": "Wales",
  "source": "welsh_gov",
  "name": "Ysgol Gynradd Example",
  "phase": "Primary",
  "type": "Community school",
  "typeGroup": "Local authority maintained schools",
  "address": {
    "street": "1 Example Road",
    "locality": null,
    "town": "Exampleton",
    "county": "Cardiff",
    "postcode": "ZZ1 1AA"
  },
  "ofstedRating": null,
  "ofstedLastInspection": null,
  "inspection": null,
  "progress8Score": null,
  "progress8Category": null,
  "pupils": 240,
  "capacity": null,
  "ageRange": { "low": null, "high": null },
  "gender": null,
  "religiousCharacter": null,
  "admissionsPolicy": null,
  "hasSixthForm": null,
  "languageMedium": "Welsh medium school / provision (including transitional)",
  "website": null,
  "telephone": "029 2018 0000",
  "headteacher": null,
  "coordinates": { "lat": 51.4901, "lng": -3.1802 },
  "locationMethod": "postcode_centroid",
  "distance": 0.4
}

Examples

Basic Request

GET https://propertyinsights.co.uk/api/v1/schools/search?postcode=SW1A%202AA

Search for Outstanding Primary Schools

GET https://propertyinsights.co.uk/api/v1/schools/search?postcode=SW1A%202AA&phase=Primary&ofstedRating=Outstanding&radius=2

Search for Secondary Schools within 5 Miles

GET https://propertyinsights.co.uk/api/v1/schools/search?postcode=SW1A%201AA&phase=Secondary&radius=5&limit=30

Request example

curl -X GET "https://propertyinsights.co.uk/api/v1/schools/search?postcode=SW1A%202AA&radius=2&phase=Primary" \
  -H "x-api-key: YOUR_API_KEY"

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests.

CodeError CodeDescription
400MISSING_POSTCODEPostcode parameter is required
400INVALID_POSTCODECould not geocode the provided postcode
400FILTER_NOT_AVAILABLEofstedRating was sent for a Welsh or Scottish postcode
401UNAUTHORIZEDAPI key is missing or invalid
402INSUFFICIENT_CREDITSInsufficient API credits to process this request
404AREA_NOT_COVEREDThe postcode is outside England, Wales and Scotland. Not charged.
500INTERNAL_ERRORAn error occurred while searching for schools

Error Response Example

{
  "success": false,
  "error": {
    "code": "INVALID_POSTCODE",
    "message": "Could not geocode the provided postcode. Please check it is a valid UK postcode."
  }
}

Need Help?

If you need assistance with implementation or have questions about the API, our support team is here to help.