Crime Statistics API

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

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

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.

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.

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,
    "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")
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
                }
            }
        ]
    }
}

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
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
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.