API Documentation

Everything you need to integrate CrimeRisk into your application.

Authentication

All API requests require an API key passed via the X-API-Key header. Get your key from the signup page.

Header
X-API-Key: your_api_key_here

Base URL

Production
https://api.crimerisk.co.uk

GET /api/risk/:postcode

Returns a crime risk score for the given UK postcode. The postcode should be URL-encoded (spaces replaced with %20 or removed).

Parameters
NameTypeDescription
postcodestring (path)UK postcode, e.g. SW1A1AA or SW1A%201AA
Request
curl https://api.crimerisk.co.uk/api/risk/SW1A1AA \
  -H "X-API-Key: your_api_key"

Response (Free Tier)

200 OK
{
  "postcode": "SW1A 1AA",
  "score": 42,
  "level": "moderate",
  "computedAt": "2025-01-15T00:00:00.000Z"
}

Response (paid plans)

Paid plans include the same fields plus a full crime category breakdown with individual scores.

Response Fields
FieldTypeDescription
postcodestringNormalised postcode
scorenumberRisk score (0–100)
levelstringRisk level: low, moderate, high, or very high
computedAtstringISO 8601 timestamp of when the score was calculated

Error Responses

StatusMeaning
400Invalid postcode format
401Missing or invalid API key
404Postcode not found in database
429Monthly request limit exceeded
Error Response Format
{
  "error": "Invalid UK postcode format.",
  "postcode": "INVALID"
}

Rate Limits

TierMonthly LimitResponse Detail
Free50 requestsScore & level only
Branch1,000 requestsFull breakdown
Agency5,000 requestsFull breakdown
API & PlatformHigh-volumeFull breakdown + SLA