Crime Data API: Crime Statistics by Postcode

Look up official UK crime statistics by postcode using Police UK data with comprehensive analysis and trends

REST API
JSON Responses
API Key Authentication
Official Police Data

Crime data API overview

The Crime Statistics API provides comprehensive access to official UK crime data sourced directly from Police UK's open data service. Our API aggregates and analyzes crime incidents by category for any UK postcode, providing historical trends and detailed breakdowns with intelligent data processing and a 2-month publication lag to ensure data accuracy.

This API provides:

  • Official police force area identification and postcode coordinate resolution
  • Historical monthly crime totals for customizable time periods (up to 24 months)
  • Crime category breakdowns with incident counts, percentages, and outcome statistics
  • Detailed location information including ward, district, and police force boundaries
  • Detailed case outcome analysis showing resolution status for each crime type
  • Crime trend analysis and month-over-month comparison data
  • Population-adjusted crime rates where demographic data is available
  • Complete coverage of England, Wales, and Northern Ireland police forces
  • Police Scotland does not publish street-level crime, so Scottish postcodes return area rates instead of incidents: recorded crimes and offences per 10,000 people for the council area by crime group, from the Scottish Government's Recorded Crime in Scotland statistics (latest financial year, five-year history and the Scottish average), plus the SIMD 2020v2 crime rate for the 2011 data zone. The street-level fields are null and the figures are under scotland. Scottish postcodes with neither figure return 404 AREA_NOT_COVERED with no charge

UK Crime Categories:

Major Crime Categories

  • Anti-social behaviour: Public order offences
  • Violence and sexual offences: Assault, harassment
  • Criminal damage and arson: Property damage
  • Public order: Disorder and weapons offences
  • Burglary: Residential and commercial break-ins
  • Vehicle crime: Theft of/from vehicles
  • Shoplifting: Retail theft offences

Key Features

  • Official Police UK data integration
  • Real-time postcode geolocation services
  • Historical trend analysis capabilities
  • Configurable time window analysis
  • Raw incident data access for research
  • Fast response times (<500ms typical)

This API is ideal for:

  • Property portals displaying neighborhood safety information
  • Estate agents providing comprehensive area analysis to buyers
  • Insurance companies assessing risk profiles for properties
  • Local government and planning authorities conducting safety assessments
  • Academic research institutions studying crime patterns and trends
  • Security consultancies providing area risk assessments
  • Community safety applications and neighborhood watch platforms
  • Investment analysts evaluating property market conditions

Important Notes

  • • Crime data is sourced from official Police UK databases with a standard 2-month publication lag
  • • Data reflects reported incidents only and may not include all criminal activity
  • • Always consider multiple factors when assessing area safety and consult local authorities for the most current information

Performance Note

API response times increase with longer lookback periods. A 12-month analysis typically completes in under 2 seconds, while a full 24-month analysis may take 3-4 seconds due to sequential API calls to Police UK's service.

Authentication

All requests to the Crime Statistics 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.

Crime data API endpoints

Base URL

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

Crime Statistics by Postcode

GET
/crime/by-postcode?postcode={postcode}&months={months}&includeRaw={boolean}

Retrieve comprehensive crime statistics for a specific UK postcode. Returns aggregated monthly totals, crime category breakdowns, location information, and optionally raw incident data. Data covers the specified time period with intelligent analysis of trends and patterns.

Request Parameters

GET /crime/by-postcode

ParameterRequiredTypeDescription
postcodeRequiredStringUK postcode (e.g., SW1A 2AA)
monthsOptionalNumberNumber of months to include (default 12, max 24)
includeRawOptionalBooleanInclude raw incidents for the reference month (true/false)

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

All API responses are returned in JSON format. The standard response structure is as follows:

{
  "success": boolean,
  "data": {
    "locationName": string,
    "postcode": string,
    "latitude": number,
    "longitude": number,
    "policeForce": string,
    "referenceMonth": string,
    "monthsRequested": number,
    "monthlyTotals": object,
    "crimeCategories": array,
    "totalCrimes": number,
    "percentiles": { "total": number, "byCategory": object } | null,
    "percentileBasis": object,
    "rawCrimes": array // Optional
  },
  "error": {
    "code": string,
    "message": string
  } // Only present if success is false
}

Response Fields

FieldTypeDescription
locationNameStringHuman-readable location name (ward/district)
policeForceStringName of the responsible police force
referenceMonthStringMost recent month with available data (YYYY-MM format)
monthlyTotalsObjectMonthly crime totals keyed by YYYY-MM format
crimeCategoriesArrayCrime categories with counts, percentages, and outcome breakdowns for reference month
percentageNumberPercentage of total crimes this category represents
outcomesObjectBreakdown of case outcomes by type (e.g., "Investigation complete; no suspect identified", "Unable to prosecute suspect")
percentilesObject or nullWhere the postcode ranks against homes in the same country (England or Wales), from 0 to 100. Higher means more crime. total covers all crime and byCategory has one value per police.uk category. Based on average street crimes per month within 1 mile. Null in Northern Ireland.
percentileBasisObjectHow the percentiles were made: coverage (England or Wales, the reference the postcode was ranked against), referenceFrom and referenceTo (the 12 police.uk months in the reference), builtOn, referencePoints (the ONS LSOA centroids used, with attribution) and a short note
rawCrimesArrayIndividual crime incidents (only when includeRaw=true)

Examples

Example 1: Basic Crime Statistics

GET https://propertyinsights.co.uk/api/v1/crime/by-postcode?postcode=SW1A%202AA&months=12
X-API-Key: your_api_key_here
{
    "success": true,
    "data": {
        "locationName": "City of Westminster",
        "postcode": "SW1A 2AA",
        "latitude": 51.5034,
        "longitude": -0.1276,
        "referenceMonth": "2025-06",
        "monthlyTotals": {
            "2025-06": 37,
            "2025-05": 40,
            "2025-04": 34,
            "2025-03": 37,
            "2025-02": 31,
            "2025-01": 32,
            "2024-12": 43,
            "2024-11": 42,
            "2024-10": 49,
            "2024-09": 39,
            "2024-08": 31
        },
        "crimeCategories": [
            {
                "category": "violent-crime",
                "count": 19,
                "percentage": 51.4,
                "outcomes": {
                    "Action to be taken by another organisation": 1,
                    "Under investigation": 13,
                    "Unable to prosecute suspect": 4,
                    "Investigation complete; no suspect identified": 1
                }
            },
            {
                "category": "anti-social-behaviour",
                "count": 9,
                "percentage": 24.3,
                "outcomes": {
                    "Investigation complete; no suspect identified": 6,
                    "Local resolution": 2,
                    "No outcome recorded": 1
                }
            },
            {
                "category": "criminal-damage-arson",
                "count": 5,
                "percentage": 13.5,
                "outcomes": {
                    "Investigation complete; no suspect identified": 3,
                    "Unable to prosecute suspect": 2
                }
            }
        ],
        "percentiles": {
            "total": 19,
            "byCategory": {
                "violent-crime": 22,
                "anti-social-behaviour": 28,
                "criminal-damage-arson": 27,
                "burglary": 0
            }
        },
        "percentileBasis": {
            "coverage": "England",
            "referenceFrom": "2025-09",
            "referenceTo": "2026-08",
            "builtOn": "2026-10-27",
            "referencePoints": "ONS Lower layer Super Output Areas (December 2021) EW Population Weighted Centroids. Source: Office for National Statistics licensed under the Open Government Licence v3.0",
            "note": "England only. Compares average street crimes per month within 1 mile of the postcode with the same measure at the population weighted centre of every LSOA in England..."
        }
    }
}

Returns 12 months of crime statistics for Downing Street area showing 37 total incidents in the most recent month with detailed outcome breakdowns

Example 2: 6-Month Crime Analysis

GET https://propertyinsights.co.uk/api/v1/crime/by-postcode?postcode=SW1A%202AA&months=6
X-API-Key: your_api_key_here
{
    "success": true,
    "data": {
        "locationName": "City of Westminster",
        "postcode": "SW1A 2AA",
        "latitude": 51.5034,
        "longitude": -0.1276,
        "referenceMonth": "2025-06",
        "monthlyTotals": {
            "2025-06": 89,
            "2025-05": 76,
            "2025-04": 82,
            "2025-03": 95,
            "2025-02": 71,
            "2025-01": 68
        },
        "crimeCategories": [
            {
                "category": "anti-social-behaviour",
                "displayName": "Anti-social behaviour",
                "count": 32,
                "percentage": 36.0,
                "outcomes": {
                    "Investigation complete; no suspect identified": 18,
                    "Unable to prosecute suspect": 8,
                    "Local resolution": 4,
                    "Community resolution": 2
                }
            },
            {
                "category": "shoplifting",
                "displayName": "Shoplifting",
                "count": 18,
                "percentage": 20.2,
                "outcomes": {
                    "Investigation complete; no suspect identified": 10,
                    "Unable to prosecute suspect": 4,
                    "Offender given penalty notice": 2,
                    "Awaiting court outcome": 2
                }
            },
            {
                "category": "violence-and-sexual-offences",
                "displayName": "Violence and sexual offences",
                "count": 15,
                "percentage": 16.9,
                "outcomes": {
                    "Investigation complete; no suspect identified": 8,
                    "Unable to prosecute suspect": 3,
                    "Awaiting court outcome": 2,
                    "Offender given a caution": 2
                }
            }
        ],
        "rawCrimes": [
            {
                "month": "2024-10",
                "category": "anti-social-behaviour",
                "location": "On or near Mosley Street",
                "context": "",
                "persistent_id": "a1b2c3d4e5f67890123456789abcdef0",
                "location_subtype": "ROAD",
                "outcome_status": null
            },
            {
                "month": "2024-10",
                "category": "shoplifting",
                "location": "On or near Market Street",
                "context": "",
                "persistent_id": "b2c3d4e5f67890123456789abcdef01a",
                "location_subtype": "ROAD",
                "outcome_status": {
                    "category": "Unable to prosecute suspect",
                    "date": "2024-11"
                }
            }
        ]
    }
}

Returns 6 months of crime statistics for Downing Street area showing detailed outcome breakdowns

Error Handling

The API uses standard HTTP response codes and returns detailed error information in JSON format. All errors follow a consistent structure to help you handle them appropriately in your application.

HTTP CodeError CodeDescription
400MISSING_POSTCODEPostcode parameter is required
400INVALID_POSTCODEInvalid UK postcode format
400INVALID_MONTHSMonths parameter must be between 1 and 24
404POSTCODE_NOT_FOUNDPostcode not found in UK database
404NO_CRIME_DATANo crime data available for this area
404AREA_NOT_COVEREDScottish postcode with no council area or data zone crime figures. Not charged
429RATE_LIMITEDToo many requests - rate limit exceeded
502POLICE_API_ERRORUpstream Police UK API service error
503SERVICE_UNAVAILABLECrime data service temporarily unavailable
401AUTHENTICATION_REQUIREDValid API key is required
402INSUFFICIENT_CREDITSNot enough API credits remaining to perform operation
429TOO_MANY_INVALID_API_KEYSToo many requests with an invalid API key from your IP address. Check the key, then retry after 15 minutes
502UPSTREAM_ERRORA data source is temporarily unavailable - please try again
500DATABASE_ERRORError accessing database - please try again
500INTERNAL_SERVER_ERRORAn unexpected error occurred

Error Response Format

{
  "success": false,
  "error": {
    "code": "NO_CRIME_DATA",
    "message": "No crime data available for the specified postcode area."
  }
}

Rate Limits

API requests are subject to rate limiting based on your subscription plan. The current limits are:

PlanRequests per MinuteRequests per DayRequests per Month
Basic105005,000
Standard302,00030,000
Premium1005,000100,000
EnterpriseCustomCustomCustom

When you exceed your rate limit, the API will return a 429 Too Many Requests response. Each response includes the following headers to help you track your usage:

X-RateLimit-Limit: [requests-per-minute limit]
X-RateLimit-Remaining: [requests remaining in current window]
X-RateLimit-Reset: [timestamp when limit resets]

Performance Note: Crime statistics requests typically complete within 300-500ms, making them suitable for real-time property analysis applications.

Need Help?

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