MCP-Server

uk-police-crime-mcp-server

io.github.cyanheads/uk-police-crime-mcp-server
Daten & Analytik Suche & Recherche Öffentlich und erreichbar MCP 2025-11-25

Was dieses MCP kann

Searches UK police crime, outcomes, stop-and-search records, and neighbourhood policing information by location, force, category, and date.

ukcrime_find_neighbourhood
Find UK Police Neighbourhood
Find the police force and neighbourhood policing team for a point, or look one up by force and neighbourhood id. Returns the team's description, contact channels and police stations, its current priorities with the action taken, team members' ranks and names, and upcoming engagement events. include adds the boundary polygon, needed only to split a neighbourhood too large to search into smaller polygons: ukcrime_search_crimes, ukcrime_search_outcomes and ukcrime_search_stops take the neighbourhood directly through area 'neighbourhood'.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': 'Latitude, WGS84 decimal degrees, to look up by point (with lng).'}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': 'Longitude, WGS84 decimal degrees, to look up by point (with lat).'}, 'force': {'type': 'string', 'pattern': '^\\s*[A-Za-z](?:[A-Za-z\\s&_-]*[A-Za-z])?\\s*$', 'maxLength': 100, 'description': "Force id such as 'leicestershire', or its name such as 'Leicestershire Police' (ukcrime_list_reference topic 'forces' lists both), to look up by id (with neighbourhood_id); case-insensitive, spaces, underscores and hyphens match each other, '&' matches 'and', and a trailing 'Police', 'Police Service' or 'Constabulary' is optional."}, 'include': {'type': 'array', 'items': {'enum': ['priorities', 'team', 'events', 'boundary'], 'type': 'string', 'description': 'An optional section to load.'}, 'maxItems': 4, 'description': "Optional sections to load: 'priorities', 'team', 'events', 'boundary'. Omitted: priorities, team and events. [] loads none of them."}, 'neighbourhood_id': {'type': 'string', 'pattern': '^[^/\\\\?#]+$', 'maxLength': 100, 'description': "Neighbourhood id from ukcrime_list_reference topic 'neighbourhoods', to look up by id (with force). Case-sensitive; only trimmed."}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['found', 'attribution', 'data_note']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'gaps': {'type': 'string', 'description': "The force's known coverage gaps, each ending with the date the table was verified."}, 'team': {'type': 'array', 'items': {'type': 'object', 'required': ['rank', 'name'], 'properties': {'name': {'type': 'string', 'description': 'Name.'}, 'rank': {'type': 'string', 'description': 'Rank; can include a collar number.'}}, 'description': 'One team member, as the force publishes them.', 'additionalProperties': False}, 'description': "Team members' ranks and names; present when include has 'team' and they loaded."}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['invalid_lookup', 'unknown_force', 'rate_limited', 'pacer_shed', 'upstream_unavailable', 'retry_deadline_exceeded'], 'description': "Machine-readable failure mode. Declared by this tool: `invalid_lookup`: neither or both of lat+lng and force+neighbourhood_id are given, or half of a pair. `unknown_force`: force matches no listed force id or name, or more than one, or is 'btp' (British Transport Police has no neighbourhoods). `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `upstream_unavailable`: data.police.uk is not answering. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler."}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'force': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string', 'description': "Force id the other tools take as force, such as 'leicestershire'."}, 'url': {'type': 'string', 'description': 'Force website.'}, 'name': {'type': 'string', 'description': 'Force name.'}, 'telephone': {'type': 'string', 'description': 'Force switchboard number.'}}, 'description': 'The police force the neighbourhood belongs to, as published.', 'additionalProperties': False}, 'found': {'type': 'boolean', 'description': 'True when data.police.uk holds a neighbourhood team for the point or id.'}, 'events': {'type': 'array', 'items': {'type': 'object', 'required': ['title'], 'properties': {'end': {'type': 'string', 'description': 'End.'}, 'type': {'type': 'string', 'description': 'Event type, such as meeting.'}, 'start': {'type': 'string', 'description': 'Start, YYYY-MM-DDTHH:MM:SS (no time zone).'}, 'title': {'type': 'string', 'description': 'Event title.'}, 'address': {'type': 'string', 'description': 'Where it takes place.'}, 'description': {'type': 'string', 'description': 'Event description, as plain text.'}}, 'description': 'One upcoming engagement event, force-written.', 'additionalProperties': False}, 'description': "Every upcoming engagement event the force published, soonest first and undated last; present when include has 'events' and they loaded."}, 'notice': {'type': 'string', 'description': 'Parts that could not be loaded from data.police.uk, and how to retry.'}, 'boundary': {'type': 'object', 'required': ['vertex_count', 'polygon'], 'properties': {'polygon': {'type': 'string', 'description': "The boundary as 'lat,lng:lat,lng:â\x80¦' at 6 dp, the form the search tools' polygon takes. The first vertex repeats last."}, 'vertex_count': {'type': 'number', 'description': 'Vertices in the polygon as returned.'}}, 'description': "The neighbourhood boundary; present when include has 'boundary' and it loaded.", 'additionalProperties': False}, 'guidance': {'type': 'string', 'description': 'Why nothing was found and what to try instead; present when found is false.'}, 'data_note': {'type': 'string', 'description': 'What these records can and cannot say; read it before drawing conclusions.'}, 'priorities': {'type': 'array', 'items': {'type': 'object', 'required': ['issue'], 'properties': {'issue': {'type': 'string', 'description': 'The priority, as plain text.'}, 'action': {'type': 'string', 'description': 'Action taken, as plain text.'}, 'issue_date': {'type': 'string', 'description': 'When it was set, YYYY-MM-DDTHH:MM:SS (no time zone).'}, 'action_date': {'type': 'string', 'description': 'When the action was recorded.'}}, 'description': 'One current priority.', 'additionalProperties': False}, 'description': "The team's current priorities, force-written; present when include has 'priorities' and they loaded."}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution for data.police.uk data.'}, 'events_total': {'type': 'number', 'description': 'Upcoming events published; every one is in events.'}, 'located_from': {'type': 'object', 'required': ['lat', 'lng'], 'properties': {'lat': {'type': 'number', 'description': 'Latitude looked up.'}, 'lng': {'type': 'number', 'description': 'Longitude looked up.'}}, 'description': 'The point looked up, for a point lookup.', 'additionalProperties': False}, 'neighbourhood': {'type': 'object', 'required': ['id', 'name', 'contact', 'links', 'stations'], 'properties': {'id': {'type': 'string', 'description': "Neighbourhood id; pass it with force as neighbourhood_id to the search tools' area 'neighbourhood'."}, 'url': {'type': 'string', 'description': "The team's page on the force website."}, 'name': {'type': 'string', 'description': 'Neighbourhood name.'}, 'links': {'type': 'array', 'items': {'type': 'object', 'required': ['title', 'url'], 'properties': {'url': {'type': 'string', 'description': 'Link URL.'}, 'title': {'type': 'string', 'description': 'Link title.'}, 'description': {'type': 'string', 'description': 'Link description.'}}, 'description': 'One link the force publishes for the team.', 'additionalProperties': False}, 'description': 'Links the force publishes for the team; empty when none.'}, 'centre': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': "The neighbourhood's centre point.", 'additionalProperties': False}, 'contact': {'type': 'array', 'items': {'type': 'object', 'required': ['channel', 'value'], 'properties': {'value': {'type': 'string', 'description': 'Address, number or account URL.'}, 'channel': {'type': 'string', 'description': 'Channel, such as email, telephone or facebook.'}}, 'description': 'One team-level contact channel.', 'additionalProperties': False}, 'description': 'Team-level contact channels; empty when none.'}, 'stations': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'Station name.'}, 'type': {'type': 'string', 'description': 'Station or base type.'}, 'address': {'type': 'string', 'description': 'Street address.'}, 'postcode': {'type': 'string', 'description': 'Postcode.'}, 'description': {'type': 'string', 'description': 'Opening hours or other detail.'}}, 'description': 'One police station or base the team works from.', 'additionalProperties': False}, 'description': 'Police stations and bases listed for the team; empty when none.'}, 'population': {'type': 'number', 'description': 'Resident population; absent when given as 0.'}, 'description': {'type': 'string', 'description': 'The team or area description, as plain text.'}}, 'description': 'The neighbourhood policing team and its public channels, as the force publishes them; an optional field is absent when unpublished, and all text is force-written.', 'additionalProperties': False}}, 'additionalProperties': False}
ukcrime_get_crime_outcomes
Get UK Crime Outcome Histories
Fetch the full police outcome history of up to 25 crimes by persistent_id — the 64-character id on crimes from ukcrime_search_crimes and ukcrime_search_outcomes. Returns each crime with every outcome, oldest first, and lists the ids data.police.uk does not hold. Anti-social behaviour records carry no persistent id.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['persistent_ids'], 'properties': {'persistent_ids': {'type': 'array', 'items': {'type': 'string', 'pattern': '^[0-9a-f]{64}$', 'description': 'A 64-character hexadecimal persistent id.'}, 'maxItems': 25, 'minItems': 1, 'description': '1â\x80\x9325 persistent ids from the persistent_id field of ukcrime_search_crimes or ukcrime_search_outcomes results. A comma- or space-separated string is also accepted; ids are lower-cased and repeats dropped.'}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['crimes', 'not_found', 'failed', 'attribution', 'data_note']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['rate_limited', 'pacer_shed', 'upstream_unavailable', 'retry_deadline_exceeded'], 'description': 'Machine-readable failure mode. Declared by this tool: `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `upstream_unavailable`: data.police.uk is not answering. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'crimes': {'type': 'array', 'items': {'type': 'object', 'required': ['persistent_id', 'id', 'category', 'month', 'history_available', 'outcomes'], 'properties': {'id': {'type': 'string', 'description': 'data.police.uk crime id.'}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM.'}, 'context': {'type': 'string', 'description': 'Force-written extra detail, when any.'}, 'category': {'type': 'string', 'description': 'Category slug.'}, 'location': {'type': 'object', 'required': ['location_id', 'street_name'], 'properties': {'type': {'enum': ['Force', 'BTP'], 'type': 'string', 'description': "'BTP': a British Transport Police station record; 'Force': a territorial force's."}, 'subtype': {'type': 'string', 'description': 'Station or premises type, when published.'}, 'map_point': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': 'Anonymised point covering at least eight addresses, not where it happened. Absent when unpublished.', 'additionalProperties': False}, 'location_id': {'type': 'string', 'description': "Map point id; pass it as location_id with area 'location'."}, 'street_name': {'type': 'string', 'description': 'Street as published: "On or near â\x80¦".'}}, 'description': 'Absent when the crime has no location.', 'additionalProperties': False}, 'outcomes': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'name', 'month'], 'properties': {'code': {'type': 'string', 'description': 'Outcome code, such as under-investigation.'}, 'name': {'type': 'string', 'description': 'Outcome as published.'}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM.'}}, 'description': 'One police outcome.', 'additionalProperties': False}, 'description': 'Every police outcome recorded for the crime, oldest first.'}, 'persistent_id': {'type': 'string', 'description': 'The persistent id this record was fetched by.'}, 'history_available': {'type': 'boolean', 'description': 'False when data.police.uk publishes no outcome history for this crime (seen on Northern Ireland records); outcomes is then empty.'}}, 'description': 'One crime and its outcome history.', 'additionalProperties': False}, 'description': 'The crimes found, in the order their ids were given.'}, 'failed': {'type': 'array', 'items': {'type': 'object', 'required': ['persistent_id', 'error'], 'properties': {'error': {'type': 'string', 'description': 'Why the lookup failed upstream.'}, 'persistent_id': {'type': 'string', 'description': 'The persistent id.'}}, 'description': 'One failed lookup.', 'additionalProperties': False}, 'description': 'Ids whose lookup still failed after retries for a reason other than a missing crime (outage, timeout, rate limit). Empty when none.'}, 'guidance': {'type': 'string', 'description': 'What to do about ids in not_found or failed; absent when every id resolved.'}, 'data_note': {'type': 'string', 'description': 'What these records can and cannot say; read it first.'}, 'not_found': {'type': 'array', 'items': {'type': 'string', 'description': 'A persistent id.'}, 'description': 'Ids data.police.uk holds no crime for.'}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution.'}}, 'additionalProperties': False}
ukcrime_list_reference
List UK Police Reference Data
Decode the vocabulary the other ukcrime tools take: police force ids, crime category slugs, a force's neighbourhood ids, and data availability — the published months, and which forces published stop and search in each. Use it when a force, category, neighbourhood id or month is unknown; name_contains filters forces and neighbourhoods by name. The Metropolitan Police has about 680 neighbourhoods, so filter by name there; to get the force and neighbourhood covering a latitude and longitude, call ukcrime_find_neighbourhood instead.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['topic'], 'properties': {'force': {'type': 'string', 'pattern': '^\\s*[A-Za-z](?:[A-Za-z\\s&_-]*[A-Za-z])?\\s*$', 'maxLength': 100, 'description': "Force id such as 'leicestershire', or its name such as 'Leicestershire Police'; case-insensitive, spaces, underscores and hyphens match each other, '&' matches 'and', and a trailing 'Police', 'Police Service' or 'Constabulary' is optional. Required for topic 'neighbourhoods'. On 'availability', where 'btp' (British Transport Police) is also accepted, adds the months this force did and did not publish stop and search. Not accepted on 'forces' or 'categories'."}, 'month': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': "Month as YYYY-MM. Topic 'availability' only: return just that month's row."}, 'topic': {'enum': ['forces', 'categories', 'availability', 'neighbourhoods'], 'type': 'string', 'description': "What to list: 'forces' (force ids), 'categories' (crime category slugs), 'availability' (published months and stop-and-search publication), or 'neighbourhoods' (one force's neighbourhood ids; needs force)."}, 'name_contains': {'type': 'string', 'maxLength': 100, 'description': "Words that must all appear in the name, in any order â\x80\x94 case, accents and punctuation ignored, so the value needs at least one letter or digit. Topics 'forces' and 'neighbourhoods' only."}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['topic', 'attribution']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['force_required', 'unknown_force', 'invalid_filter', 'rate_limited', 'pacer_shed', 'upstream_unavailable', 'retry_deadline_exceeded'], 'description': "Machine-readable failure mode. Declared by this tool: `force_required`: topic 'neighbourhoods' without force. `unknown_force`: force matches no listed force id or name, or more than one, or is 'btp' on topic 'neighbourhoods', or data.police.uk lists no neighbourhoods for it. `invalid_filter`: name_contains on 'categories' or 'availability', month off 'availability', or force on 'forces' or 'categories'. `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `upstream_unavailable`: data.police.uk is not answering. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler."}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'force': {'type': 'string', 'description': "Topic 'neighbourhoods': the force whose neighbourhoods are listed."}, 'topic': {'enum': ['forces', 'categories', 'availability', 'neighbourhoods'], 'type': 'string', 'description': 'The topic listed; its list field below is the one present.'}, 'forces': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string', 'description': 'Force id the other tools take as force.'}, 'gaps': {'type': 'string', 'description': 'Known coverage gaps, each ending with the date verified. Absent when none.'}, 'name': {'type': 'string', 'description': 'Force name as published.'}}, 'description': 'One police force.', 'additionalProperties': False}, 'description': "Topic 'forces': the forces data.police.uk lists, plus British Transport Police ('btp'), which ukcrime_search_stops takes with area 'force' and ukcrime_search_crimes with area 'force_unplaced'."}, 'notice': {'type': 'string', 'description': 'Why a list is empty â\x80\x94 a name filter that matched nothing, or a month that is not published â\x80\x94 and what to do instead.'}, 'categories': {'type': 'array', 'items': {'type': 'object', 'required': ['slug', 'name'], 'properties': {'name': {'type': 'string', 'description': 'Display name, also accepted as category.'}, 'slug': {'type': 'string', 'description': 'Slug the category input takes; all-crime means every category.'}}, 'description': 'One crime category.', 'additionalProperties': False}, 'description': "Topic 'categories': every crime category."}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution for data.police.uk data.'}, 'availability': {'type': 'object', 'required': ['latest_month', 'earliest_month', 'months'], 'properties': {'force': {'type': 'string', 'description': 'The force the next two lists describe, when force was given.'}, 'months': {'type': 'array', 'items': {'type': 'object', 'required': ['month', 'stop_search_forces_published', 'stop_search_not_published'], 'properties': {'month': {'type': 'string', 'description': 'Published month, YYYY-MM.'}, 'stop_search_not_published': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Force ids that did not publish stop and search.'}, 'stop_search_forces_published': {'type': 'number', 'description': 'Forces, BTP included, that published stop and search.'}}, 'description': 'One published month.', 'additionalProperties': False}, 'description': 'Published months, newest first: one row when month was given, none when it is not published.'}, 'latest_month': {'type': 'string', 'description': 'Newest published month, YYYY-MM; the searches default to it.'}, 'earliest_month': {'type': 'string', 'description': 'Oldest month served, YYYY-MM (a rolling 36 months).'}, 'force_stop_search_missing_months': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Listed months in which this force did not.'}, 'force_stop_search_published_months': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Listed months in which this force published stop and search.'}}, 'description': "Topic 'availability': the published-month window and stop-and-search publication by month.", 'additionalProperties': False}, 'neighbourhoods': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string', 'description': 'Id the other tools take as neighbourhood_id; case-sensitive.'}, 'name': {'type': 'string', 'description': 'Neighbourhood name as published.'}}, 'description': 'One neighbourhood.', 'additionalProperties': False}, 'description': "Topic 'neighbourhoods': the force's neighbourhoods, sorted by name."}}, 'additionalProperties': False}
ukcrime_search_crimes
Search UK Street-Level Crimes
Search street-level crimes recorded in one month, or with month_from a range of up to 12 months, inside an area — a point with a 1-mile radius, a polygon, a snapped location_id from an earlier result, or a police neighbourhood — or list the crimes a force could not place on the map (area 'force_unplaced'). Returns the total, counts by category and by latest police outcome, the busiest map points, each month's total for a range, and a page of crimes, each with the persistent_id that ukcrime_get_crime_outcomes takes; for what police resolved in a month, whenever the crime was recorded, use ukcrime_search_outcomes. Locations are anonymised map points, not crime sites. data.police.uk can refuse an area holding more than about 10,000 crimes, whatever the category — then search smaller polygons.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['area'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': "Latitude, WGS84 decimal degrees, for area 'point'."}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': "Longitude, WGS84 decimal degrees, for area 'point'."}, 'area': {'enum': ['point', 'polygon', 'location', 'neighbourhood', 'force_unplaced'], 'type': 'string', 'description': "Area to search: 'point' (lat and lng; a 1-mile radius), 'polygon' (polygon), 'location' (location_id), 'neighbourhood' (force and neighbourhood_id), or 'force_unplaced' (force alone: the crimes that force could not place on the map). An area field the chosen area does not use is rejected."}, 'force': {'type': 'string', 'pattern': '^\\s*[A-Za-z](?:[A-Za-z\\s&_-]*[A-Za-z])?\\s*$', 'maxLength': 100, 'description': "Force id such as 'leicestershire', or its name such as 'Leicestershire Police' (ukcrime_list_reference topic 'forces' lists both); case-insensitive, spaces, underscores and hyphens match each other, '&' matches 'and', and a trailing 'Police', 'Police Service' or 'Constabulary' is optional. For area 'neighbourhood' (with neighbourhood_id) and 'force_unplaced' (alone), where 'btp' (British Transport Police) is also accepted."}, 'limit': {'type': 'integer', 'default': 25, 'maximum': 200, 'minimum': 1, 'description': 'Crimes on this page, 1â\x80\x93200. Default 25.'}, 'month': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': 'Month as YYYY-MM, or the last month of the range with month_from. Omitted: the latest published month, echoed as month in the result.'}, 'offset': {'type': 'integer', 'default': 0, 'maximum': 9007199254740991, 'minimum': 0, 'description': 'Rows to skip before this page; pass next_offset from the previous result. Default 0.'}, 'polygon': {'type': 'array', 'items': {'type': 'object', 'required': ['lat', 'lng'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': 'Latitude, WGS84 decimal degrees.'}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': 'Longitude, WGS84 decimal degrees.'}}, 'description': 'One polygon vertex as { lat, lng }.'}, 'maxItems': 2500, 'minItems': 3, 'description': "For area 'polygon': 3â\x80\x932,500 vertices as { lat, lng } objects, or the string 'lat,lng:lat,lng:â\x80¦'. The ring closes itself (the last vertex joins the first). [lng, lat] pairs are not accepted."}, 'category': {'type': 'string', 'maxLength': 100, 'description': "Crime category slug such as 'burglary', or its display name such as 'Violence and sexual offences'; case-insensitive, and spaces, underscores and hyphens match each other ('vehicle_crime' finds 'vehicle-crime'). Omitted: every category (all-crime). ukcrime_list_reference topic 'categories' lists them."}, 'month_from': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': 'First month of a range, YYYY-MM, searched through month â\x80\x94 up to 12 months, with a total for each in by_month. Omitted: month alone.'}, 'location_id': {'type': 'string', 'pattern': '^\\d{1,12}$', 'description': "For area 'location': location.location_id from an earlier result â\x80\x94 one anonymised map point."}, 'neighbourhood_id': {'type': 'string', 'pattern': '^[^/\\\\?#]+$', 'maxLength': 100, 'description': "For area 'neighbourhood', with force: a neighbourhood id from ukcrime_list_reference topic 'neighbourhoods', or from ukcrime_find_neighbourhood for a point. Case-sensitive; only trimmed."}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['month', 'area', 'category', 'total', 'by_category', 'by_outcome', 'crimes', 'attribution', 'data_note', 'truncated', 'shown', 'cap']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'Page limit applied.'}, 'area': {'type': 'object', 'required': ['type'], 'properties': {'lat': {'type': 'number', 'description': "Latitude, for 'point'."}, 'lng': {'type': 'number', 'description': "Longitude, for 'point'."}, 'type': {'enum': ['point', 'polygon', 'location', 'neighbourhood', 'force_unplaced', 'force'], 'type': 'string', 'description': 'The area arm searched.'}, 'force': {'type': 'string', 'description': 'Force id, when the area names one.'}, 'location_id': {'type': 'string', 'description': "Map point, for 'location'."}, 'vertex_count': {'type': 'number', 'description': "Polygon vertices; the boundary's, for 'neighbourhood'."}, 'located_force': {'type': 'string', 'description': "Force covering the point, or the location's map point, when located."}, 'located_forces': {'type': 'array', 'items': {'type': 'string', 'description': 'Force id.'}, 'description': "For 'polygon': forces its bounding-box centre and outermost vertices were located in, sorted; a point whose lookup failed adds none. Absent when none was located."}, 'neighbourhood_id': {'type': 'string', 'description': "Neighbourhood id, for 'neighbourhood'."}, 'located_neighbourhood': {'type': 'string', 'description': "Neighbourhood covering the point, or the location's map point, when located."}}, 'description': 'The area as the server searched it.', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['invalid_area', 'month_not_published', 'month_out_of_range', 'invalid_month_range', 'unknown_category', 'unknown_force', 'unknown_neighbourhood', 'unknown_location', 'area_too_large', 'range_too_large', 'range_incomplete', 'upstream_unavailable', 'rate_limited', 'pacer_shed', 'retry_deadline_exceeded'], 'description': "Machine-readable failure mode. Declared by this tool: `invalid_area`: the area's required fields are missing, or a field it does not use is present. `month_not_published`: month or month_from is after the latest published month. `month_out_of_range`: month or month_from is before the 36-month window. `invalid_month_range`: month_from is after month, or the range spans more than 12 months. `unknown_category`: category matches no category slug or name. `unknown_force`: force matches no listed force id or name, or more than one, or is 'btp' on area 'neighbourhood'. `unknown_neighbourhood`: the force has no neighbourhood with this id (ids are case-sensitive). `unknown_location`: data.police.uk holds no map point with this location_id. `area_too_large`: the area is too large to answer: data.police.uk can refuse one holding more than about 10,000 crimes. `range_too_large`: the range's months hold more records than one call keeps for a range. `range_incomplete`: the months of the range could not all be fetched within the time one call allows. `upstream_unavailable`: data.police.uk is not answering. `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler."}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'month': {'type': 'string', 'description': 'The month searched, or the last month of the range, YYYY-MM.'}, 'shown': {'type': 'number', 'description': 'Rows on this page.'}, 'total': {'type': 'number', 'description': 'Crimes matched in the area over the month or range.'}, 'crimes': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'category', 'month'], 'properties': {'id': {'type': 'string', 'description': 'data.police.uk crime id.'}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM.'}, 'context': {'type': 'string', 'description': 'Force-written extra detail, when any.'}, 'outcome': {'type': 'object', 'required': ['name', 'month'], 'properties': {'name': {'type': 'string', 'description': 'Outcome as published.'}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM.'}}, 'description': 'Latest police outcome. Absent when unpublished, always for anti-social behaviour.', 'additionalProperties': False}, 'category': {'type': 'string', 'description': 'Category slug.'}, 'location': {'type': 'object', 'required': ['location_id', 'street_name'], 'properties': {'type': {'enum': ['Force', 'BTP'], 'type': 'string', 'description': "'BTP': a British Transport Police station record; 'Force': a territorial force's."}, 'subtype': {'type': 'string', 'description': 'Station or premises type, when published.'}, 'map_point': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': 'Anonymised point covering at least eight addresses, not where it happened. Absent when unpublished.', 'additionalProperties': False}, 'location_id': {'type': 'string', 'description': "Map point id; pass it as location_id with area 'location'."}, 'street_name': {'type': 'string', 'description': 'Street as published: "On or near â\x80¦".'}}, 'description': 'Absent for crimes the force could not place.', 'additionalProperties': False}, 'persistent_id': {'type': 'string', 'description': 'Id ukcrime_get_crime_outcomes takes. Absent when unpublished, always for anti-social behaviour.'}}, 'description': 'One crime.', 'additionalProperties': False}, 'description': 'This page of matched crimes: oldest month first over a range, then by category, then location_id, then id.'}, 'notice': {'type': 'string', 'description': 'Defaulted month, coverage gaps, why a result is empty, and how to page on.'}, 'by_month': {'type': 'array', 'items': {'type': 'object', 'required': ['month', 'total'], 'properties': {'month': {'type': 'string', 'description': 'Month, YYYY-MM.'}, 'total': {'type': 'number', 'description': 'Matched records in this month, after every filter.'}}, 'description': 'One month of the range.', 'additionalProperties': False}, 'description': 'Crimes matched in each month of the range, oldest first; their totals sum to total. Present only when month_from was given.'}, 'category': {'type': 'object', 'required': ['slug', 'name'], 'properties': {'name': {'type': 'string', 'description': 'Category display name.'}, 'slug': {'type': 'string', 'description': 'Category slug searched; all-crime means every category.'}}, 'description': 'The crime category searched.', 'additionalProperties': False}, 'data_note': {'type': 'string', 'description': 'What these records can and cannot say; read it first.'}, 'truncated': {'type': 'boolean', 'description': 'True when more rows remain after this page.'}, 'by_outcome': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': "Matched crimes by latest police outcome, most first; anti-social behaviour is always '(not recorded)'."}, 'month_from': {'type': 'string', 'description': 'First month of the range searched, YYYY-MM; present only when month_from was given.'}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution.'}, 'by_category': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched crimes by category slug, most first.'}, 'next_offset': {'type': 'number', 'description': 'Pass as offset for the next page; absent on the last page.'}, 'top_locations': {'type': 'array', 'items': {'type': 'object', 'required': ['location_id', 'street_name', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched crimes here.'}, 'map_point': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': 'Anonymised map point, not where crimes happened.', 'additionalProperties': False}, 'location_id': {'type': 'string', 'description': "Pass as location_id with area 'location'."}, 'street_name': {'type': 'string', 'description': 'Street as published.'}}, 'description': 'One map point and its crime count.', 'additionalProperties': False}, 'description': "Up to 10 map points holding the most matched crimes. Absent for area 'force_unplaced'."}}, 'additionalProperties': False}
ukcrime_search_outcomes
Search UK Police Outcomes
List the police outcomes recorded in one month inside an area — a point with a 1-mile radius, a polygon, a location_id, or a neighbourhood — for crimes recorded that month or any earlier one. Returns the total, counts by outcome and by the month each crime was recorded, and a page of outcomes, each with its crime and persistent_id. Use it for what police resolved in a month; ukcrime_search_crimes gives the latest outcome of the crimes recorded in a month instead. Court results are not published; the result says when a force publishes no outcomes.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['area'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': "Latitude, WGS84 decimal degrees, for area 'point'."}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': "Longitude, WGS84 decimal degrees, for area 'point'."}, 'area': {'enum': ['point', 'polygon', 'location', 'neighbourhood'], 'type': 'string', 'description': "Area to search: 'point' (lat and lng; a 1-mile radius), 'polygon' (polygon), 'location' (location_id), or 'neighbourhood' (force and neighbourhood_id). An area field the chosen area does not use is rejected."}, 'force': {'type': 'string', 'pattern': '^\\s*[A-Za-z](?:[A-Za-z\\s&_-]*[A-Za-z])?\\s*$', 'maxLength': 100, 'description': "For area 'neighbourhood', with neighbourhood_id: a force id such as 'leicestershire', or its name such as 'Leicestershire Police' (ukcrime_list_reference topic 'forces' lists both); case-insensitive, spaces, underscores and hyphens match each other, '&' matches 'and', and a trailing 'Police', 'Police Service' or 'Constabulary' is optional."}, 'limit': {'type': 'integer', 'default': 20, 'maximum': 200, 'minimum': 1, 'description': 'Outcomes on this page, 1â\x80\x93200. Default 20.'}, 'month': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': 'Month as YYYY-MM. Omitted: the latest published month, echoed as month in the result.'}, 'offset': {'type': 'integer', 'default': 0, 'maximum': 9007199254740991, 'minimum': 0, 'description': 'Rows to skip before this page; pass next_offset from the previous result. Default 0.'}, 'polygon': {'type': 'array', 'items': {'type': 'object', 'required': ['lat', 'lng'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': 'Latitude, WGS84 decimal degrees.'}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': 'Longitude, WGS84 decimal degrees.'}}, 'description': 'One polygon vertex as { lat, lng }.'}, 'maxItems': 2500, 'minItems': 3, 'description': "For area 'polygon': 3â\x80\x932,500 vertices as { lat, lng } objects, or the string 'lat,lng:lat,lng:â\x80¦'. The ring closes itself (the last vertex joins the first). [lng, lat] pairs are not accepted."}, 'category': {'type': 'string', 'maxLength': 100, 'description': "Count only outcomes for crimes in this category: a slug such as 'burglary' or a display name such as 'Violence and sexual offences'; case-insensitive, and spaces, underscores and hyphens match each other ('vehicle_crime' finds 'vehicle-crime'). Omitted or 'all-crime': every category. ukcrime_list_reference topic 'categories' lists them."}, 'location_id': {'type': 'string', 'pattern': '^\\d{1,12}$', 'description': "For area 'location': location.location_id from an earlier result â\x80\x94 one anonymised map point."}, 'neighbourhood_id': {'type': 'string', 'pattern': '^[^/\\\\?#]+$', 'maxLength': 100, 'description': "For area 'neighbourhood', with force: a neighbourhood id from ukcrime_list_reference topic 'neighbourhoods', or from ukcrime_find_neighbourhood for a point. Case-sensitive; only trimmed."}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['month', 'area', 'total', 'unfiltered_total', 'by_outcome', 'by_crime_month', 'outcomes', 'attribution', 'data_note', 'truncated', 'shown', 'cap']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'Page limit applied.'}, 'area': {'type': 'object', 'required': ['type'], 'properties': {'lat': {'type': 'number', 'description': "Latitude, for 'point'."}, 'lng': {'type': 'number', 'description': "Longitude, for 'point'."}, 'type': {'enum': ['point', 'polygon', 'location', 'neighbourhood', 'force_unplaced', 'force'], 'type': 'string', 'description': 'The area arm searched.'}, 'force': {'type': 'string', 'description': 'Force id, when the area names one.'}, 'location_id': {'type': 'string', 'description': "Map point, for 'location'."}, 'vertex_count': {'type': 'number', 'description': "Polygon vertices; the boundary's, for 'neighbourhood'."}, 'located_force': {'type': 'string', 'description': "Force covering the point, or the location's map point, when located."}, 'located_forces': {'type': 'array', 'items': {'type': 'string', 'description': 'Force id.'}, 'description': "For 'polygon': forces its bounding-box centre and outermost vertices were located in, sorted; a point whose lookup failed adds none. Absent when none was located."}, 'neighbourhood_id': {'type': 'string', 'description': "Neighbourhood id, for 'neighbourhood'."}, 'located_neighbourhood': {'type': 'string', 'description': "Neighbourhood covering the point, or the location's map point, when located."}}, 'description': 'The area as the server searched it.', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['invalid_area', 'month_not_published', 'month_out_of_range', 'unknown_category', 'unknown_force', 'unknown_neighbourhood', 'unknown_location', 'area_too_large', 'upstream_unavailable', 'rate_limited', 'pacer_shed', 'retry_deadline_exceeded'], 'description': "Machine-readable failure mode. Declared by this tool: `invalid_area`: the area's required fields are missing, or a field it does not use is present. `month_not_published`: month is after the latest published month. `month_out_of_range`: month is before the 36-month window. `unknown_category`: category matches no category slug or name. `unknown_force`: force matches no listed force id or name, or more than one, or is 'btp' (British Transport Police has no neighbourhoods). `unknown_neighbourhood`: the force has no neighbourhood with this id (ids are case-sensitive). `unknown_location`: data.police.uk holds no map point with this location_id. `area_too_large`: the area holds more than 10,000 outcomes, which data.police.uk refuses to answer. `upstream_unavailable`: data.police.uk is not answering. `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler."}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'month': {'type': 'string', 'description': 'The month searched â\x80\x94 when the outcomes were recorded â\x80\x94 YYYY-MM.'}, 'shown': {'type': 'number', 'description': 'Rows on this page.'}, 'total': {'type': 'number', 'description': 'Outcomes matched, after the category filter.'}, 'notice': {'type': 'string', 'description': 'Defaulted month, coverage gaps, why a result is empty, and how to page on.'}, 'category': {'type': 'object', 'required': ['slug', 'name'], 'properties': {'name': {'type': 'string', 'description': 'Category display name.'}, 'slug': {'type': 'string', 'description': 'Category slug.'}}, 'description': "The crime category counted; absent when every category was (no category, or 'all-crime').", 'additionalProperties': False}, 'outcomes': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'name', 'month', 'crime'], 'properties': {'code': {'type': 'string', 'description': 'Outcome code, such as under-investigation or unable-to-prosecute.'}, 'name': {'type': 'string', 'description': 'Outcome as published.'}, 'crime': {'type': 'object', 'required': ['id', 'category', 'month'], 'properties': {'id': {'type': 'string', 'description': 'data.police.uk crime id.'}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM; can be years before the outcome.'}, 'context': {'type': 'string', 'description': 'Force-written extra detail, when any.'}, 'category': {'type': 'string', 'description': 'Category slug.'}, 'location': {'type': 'object', 'required': ['location_id', 'street_name'], 'properties': {'type': {'enum': ['Force', 'BTP'], 'type': 'string', 'description': "'BTP': a British Transport Police station record; 'Force': a territorial force's."}, 'subtype': {'type': 'string', 'description': 'Station or premises type, when published.'}, 'map_point': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': 'Anonymised point covering at least eight addresses, not where it happened. Absent when unpublished.', 'additionalProperties': False}, 'location_id': {'type': 'string', 'description': "Map point id; pass it as location_id with area 'location'."}, 'street_name': {'type': 'string', 'description': 'Street as published: "On or near â\x80¦".'}}, 'description': 'Absent when the crime has no location.', 'additionalProperties': False}, 'persistent_id': {'type': 'string', 'description': 'Id ukcrime_get_crime_outcomes takes for the full history. Absent when unpublished.'}}, 'description': 'The crime this outcome was recorded for.', 'additionalProperties': False}, 'month': {'type': 'string', 'description': 'Month recorded, YYYY-MM.'}}, 'description': 'One police outcome and its crime.', 'additionalProperties': False}, 'description': "This page of matched outcomes, sorted by the crime's month, newest first, then crime id."}, 'data_note': {'type': 'string', 'description': 'What these records can and cannot say; read it first.'}, 'truncated': {'type': 'boolean', 'description': 'True when more rows remain after this page.'}, 'by_outcome': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'name', 'count'], 'properties': {'code': {'type': 'string', 'description': 'Outcome code.'}, 'name': {'type': 'string', 'description': 'Outcome as published.'}, 'count': {'type': 'number', 'description': 'Matched outcomes.'}}, 'description': 'An outcome and its count.', 'additionalProperties': False}, 'description': 'Matched outcomes by outcome, most first.'}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution.'}, 'next_offset': {'type': 'number', 'description': 'Pass as offset for the next page; absent on the last page.'}, 'by_crime_month': {'type': 'array', 'items': {'type': 'object', 'required': ['month', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched outcomes.'}, 'month': {'type': 'string', 'description': 'Crime month, YYYY-MM.'}}, 'description': 'A crime month and its count.', 'additionalProperties': False}, 'description': 'Matched outcomes by the month their crime was recorded, newest first.'}, 'unfiltered_total': {'type': 'number', 'description': 'Outcomes recorded in the area and month before the category filter.'}}, 'additionalProperties': False}
ukcrime_search_stops
Search UK Police Stop and Search
Search police stop and search records for one month, or with month_from a range of up to 12 months, inside an area — a point with a 1-mile radius, a polygon, a location_id from an earlier result, or a police neighbourhood — or across a whole force with area 'force', which includes stops the force could not place. Returns the total and counts by search type, self-defined and officer-defined ethnicity, outcome, object of search, legislation, age range, gender, whether the outcome was linked to the object of search, and whether more than outer clothing was removed, each month's total for a range, and a page of stops. filters narrow the counts and the page together, so filtering one field and reading another's breakdown gives a cross-tab. Forces skip months and some publish none; the result names each force it finds for the area that did not publish, with the months it skipped.
Nur Lesen Externer Zugriff Idempotent
Eingabeschema
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['area'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': "Latitude, WGS84 decimal degrees, for area 'point'."}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': "Longitude, WGS84 decimal degrees, for area 'point'."}, 'area': {'enum': ['point', 'polygon', 'location', 'neighbourhood', 'force'], 'type': 'string', 'description': "Area to search: 'point' (lat and lng; a 1-mile radius), 'polygon' (polygon), 'location' (location_id), 'neighbourhood' (force and neighbourhood_id), or 'force' (force alone: every stop the force published for the month or range, placed or not). An area field the chosen area does not use is rejected."}, 'force': {'type': 'string', 'pattern': '^\\s*[A-Za-z](?:[A-Za-z\\s&_-]*[A-Za-z])?\\s*$', 'maxLength': 100, 'description': "Force id such as 'leicestershire', or its name such as 'Leicestershire Police' (ukcrime_list_reference topic 'forces' lists both); case-insensitive, spaces, underscores and hyphens match each other, '&' matches 'and', and a trailing 'Police', 'Police Service' or 'Constabulary' is optional. For area 'neighbourhood' (with neighbourhood_id) and 'force' (alone), where 'btp' (British Transport Police) is also accepted."}, 'limit': {'type': 'integer', 'default': 15, 'maximum': 200, 'minimum': 1, 'description': 'Stops on this page, 1â\x80\x93200. Default 15.'}, 'month': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': 'Month as YYYY-MM, or the last month of the range with month_from. Omitted: the latest published month, echoed as month in the result.'}, 'offset': {'type': 'integer', 'default': 0, 'maximum': 9007199254740991, 'minimum': 0, 'description': 'Rows to skip before this page; pass next_offset from the previous result. Default 0.'}, 'filters': {'type': 'array', 'items': {'type': 'object', 'required': ['field', 'value'], 'properties': {'field': {'enum': ['type', 'self_defined_ethnicity', 'officer_defined_ethnicity', 'outcome', 'object_of_search', 'legislation', 'age_range', 'gender', 'outcome_linked_to_object_of_search', 'removal_of_more_than_outer_clothing'], 'type': 'string', 'description': 'Stop field to match.'}, 'value': {'anyOf': [{'type': 'string', 'maxLength': 200, 'minLength': 1}, {'type': 'boolean'}], 'description': "Value to match exactly, case-insensitively, as the breakdowns show it: 'true' or 'false' for outcome_linked_to_object_of_search and removal_of_more_than_outer_clothing (a JSON true or false reads the same), and '(not recorded)' for stops with no value."}}, 'description': 'Keep only stops whose field equals value.', 'additionalProperties': False}, 'maxItems': 8, 'description': 'Up to 8 filters, all of which a stop must match; they narrow the counts and the page together. Fields: type, self_defined_ethnicity, officer_defined_ethnicity, outcome, object_of_search, legislation, age_range, gender, outcome_linked_to_object_of_search, removal_of_more_than_outer_clothing.'}, 'polygon': {'type': 'array', 'items': {'type': 'object', 'required': ['lat', 'lng'], 'properties': {'lat': {'type': 'number', 'maximum': 90, 'minimum': -90, 'description': 'Latitude, WGS84 decimal degrees.'}, 'lng': {'type': 'number', 'maximum': 180, 'minimum': -180, 'description': 'Longitude, WGS84 decimal degrees.'}}, 'description': 'One polygon vertex as { lat, lng }.'}, 'maxItems': 2500, 'minItems': 3, 'description': "For area 'polygon': 3â\x80\x932,500 vertices as { lat, lng } objects, or the string 'lat,lng:lat,lng:â\x80¦'. The ring closes itself (the last vertex joins the first). [lng, lat] pairs are not accepted."}, 'month_from': {'type': 'string', 'pattern': '^\\d{4}-(0[1-9]|1[0-2])$', 'description': 'First month of a range, YYYY-MM, searched through month â\x80\x94 up to 12 months, with a total for each in by_month. Omitted: month alone.'}, 'location_id': {'type': 'string', 'pattern': '^\\d{1,12}$', 'description': "For area 'location': location.location_id from an earlier result â\x80\x94 one anonymised map point."}, 'neighbourhood_id': {'type': 'string', 'pattern': '^[^/\\\\?#]+$', 'maxLength': 100, 'description': "For area 'neighbourhood', with force: a neighbourhood id from ukcrime_list_reference topic 'neighbourhoods', or from ukcrime_find_neighbourhood for a point. Case-sensitive; only trimmed."}}, 'additionalProperties': False}
Ausgabeschema
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['month', 'area', 'filters', 'total', 'unfiltered_total', 'unplaced', 'by_type', 'by_self_defined_ethnicity', 'by_officer_defined_ethnicity', 'by_outcome', 'by_object_of_search', 'by_legislation', 'by_age_range', 'by_gender', 'by_outcome_linked_to_object_of_search', 'by_removal_of_more_than_outer_clothing', 'stops', 'attribution', 'data_note', 'truncated', 'shown', 'cap']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'Page limit applied.'}, 'area': {'type': 'object', 'required': ['type'], 'properties': {'lat': {'type': 'number', 'description': "Latitude, for 'point'."}, 'lng': {'type': 'number', 'description': "Longitude, for 'point'."}, 'type': {'enum': ['point', 'polygon', 'location', 'neighbourhood', 'force_unplaced', 'force'], 'type': 'string', 'description': 'The area arm searched.'}, 'force': {'type': 'string', 'description': 'Force id, when the area names one.'}, 'location_id': {'type': 'string', 'description': "Map point, for 'location'."}, 'vertex_count': {'type': 'number', 'description': "Polygon vertices; the boundary's, for 'neighbourhood'."}, 'located_force': {'type': 'string', 'description': "Force covering the point, or the location's map point, when located."}, 'located_forces': {'type': 'array', 'items': {'type': 'string', 'description': 'Force id.'}, 'description': "For 'polygon': forces its bounding-box centre and outermost vertices were located in, sorted; a point whose lookup failed adds none. Absent when none was located."}, 'neighbourhood_id': {'type': 'string', 'description': "Neighbourhood id, for 'neighbourhood'."}, 'located_neighbourhood': {'type': 'string', 'description': "Neighbourhood covering the point, or the location's map point, when located."}}, 'description': 'The area as the server searched it.', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['invalid_area', 'month_not_published', 'month_out_of_range', 'invalid_month_range', 'unknown_force', 'unknown_neighbourhood', 'area_too_large', 'range_too_large', 'range_incomplete', 'upstream_unavailable', 'rate_limited', 'pacer_shed', 'retry_deadline_exceeded'], 'description': "Machine-readable failure mode. Declared by this tool: `invalid_area`: the area's required fields are missing, or a field it does not use is present. `month_not_published`: month or month_from is after the latest published month. `month_out_of_range`: month or month_from is before the 36-month window. `invalid_month_range`: month_from is after month, or the range spans more than 12 months. `unknown_force`: force matches no listed force id or name, or more than one, or is 'btp' on area 'neighbourhood'. `unknown_neighbourhood`: the force has no neighbourhood with this id (ids are case-sensitive). `area_too_large`: the area holds more stops than data.police.uk will answer for. `range_too_large`: the range's months hold more records than one call keeps for a range. `range_incomplete`: the months of the range could not all be fetched within the time one call allows. `upstream_unavailable`: data.police.uk is not answering. `rate_limited`: data.police.uk is rate-limiting this server for longer than this call can wait. `pacer_shed`: too many requests to data.police.uk are already queued in this server. `retry_deadline_exceeded`: data.police.uk did not answer within the time one call allows. Other values are possible when a failure originates below the handler."}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'month': {'type': 'string', 'description': 'The month searched, or the last month of the range, YYYY-MM.'}, 'shown': {'type': 'number', 'description': 'Rows on this page.'}, 'stops': {'type': 'array', 'items': {'type': 'object', 'required': ['datetime'], 'properties': {'type': {'type': 'string', 'description': 'Person search, vehicle search, or both.'}, 'gender': {'type': 'string', 'description': 'Gender.'}, 'outcome': {'type': 'string', 'description': 'Outcome.'}, 'datetime': {'type': 'string', 'description': 'When the stop happened, UTC ISO 8601 as published.'}, 'location': {'type': 'object', 'required': ['location_id', 'street_name'], 'properties': {'type': {'enum': ['Force', 'BTP'], 'type': 'string', 'description': "'BTP': a British Transport Police station record; 'Force': a territorial force's."}, 'subtype': {'type': 'string', 'description': 'Station or premises type, when published.'}, 'map_point': {'type': 'object', 'required': ['latitude', 'longitude'], 'properties': {'latitude': {'type': 'number', 'description': 'Latitude, WGS84.'}, 'longitude': {'type': 'number', 'description': 'Longitude, WGS84.'}}, 'description': 'Anonymised point covering at least eight addresses, not where it happened. Absent when unpublished.', 'additionalProperties': False}, 'location_id': {'type': 'string', 'description': "Map point id; pass it as location_id with area 'location'."}, 'street_name': {'type': 'string', 'description': 'Street as published: "On or near â\x80¦".'}}, 'description': 'Absent for stops the force could not place.', 'additionalProperties': False}, 'age_range': {'type': 'string', 'description': 'Age range.'}, 'legislation': {'type': 'string', 'description': 'Power the search was made under.'}, 'operation_name': {'type': 'string', 'description': 'Policing operation the stop was part of.'}, 'involved_person': {'type': 'boolean', 'description': 'Whether a person was searched.'}, 'object_of_search': {'type': 'string', 'description': 'What the officer was searching for.'}, 'self_defined_ethnicity': {'type': 'string', 'description': 'Ethnicity as the person defined it.'}, 'officer_defined_ethnicity': {'type': 'string', 'description': 'Ethnicity as the officer perceived it.'}, 'outcome_linked_to_object_of_search': {'type': 'boolean', 'description': 'Whether the outcome related to the object searched for.'}, 'removal_of_more_than_outer_clothing': {'type': 'boolean', 'description': 'Whether more than outer clothing was removed.'}}, 'description': 'One stop and search, values as published; a field is absent when not recorded.', 'additionalProperties': False}, 'description': 'This page of matched stops, oldest first, then by location_id.'}, 'total': {'type': 'number', 'description': 'Stops matched after filters, over the month or range.'}, 'notice': {'type': 'string', 'description': 'Defaulted month, coverage gaps, why a result is empty, and how to page on.'}, 'by_type': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by search type, most first.'}, 'filters': {'type': 'array', 'items': {'type': 'object', 'required': ['field', 'value'], 'properties': {'field': {'enum': ['type', 'self_defined_ethnicity', 'officer_defined_ethnicity', 'outcome', 'object_of_search', 'legislation', 'age_range', 'gender', 'outcome_linked_to_object_of_search', 'removal_of_more_than_outer_clothing'], 'type': 'string', 'description': 'Field matched.'}, 'value': {'type': 'string', 'description': 'Value matched.'}}, 'description': 'One applied filter.', 'additionalProperties': False}, 'description': 'Filters applied, case-insensitively; empty when none.'}, 'by_month': {'type': 'array', 'items': {'type': 'object', 'required': ['month', 'total'], 'properties': {'month': {'type': 'string', 'description': 'Month, YYYY-MM.'}, 'total': {'type': 'number', 'description': 'Matched records in this month, after every filter.'}, 'force_published': {'type': 'boolean', 'description': 'Whether every force found for the area published stop and search this month; absent on the same terms as the top-level force_published.'}}, 'description': 'One month of the range.', 'additionalProperties': False}, 'description': 'Stops matched in each month of the range, oldest first; their totals sum to total. Present only when month_from was given.'}, 'unplaced': {'type': 'number', 'description': "Matched stops with no location â\x80\x94 the force's unplaced stops, for area 'force'."}, 'by_gender': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by gender, most first.'}, 'data_note': {'type': 'string', 'description': 'What these records can and cannot say; read it first.'}, 'truncated': {'type': 'boolean', 'description': 'True when more rows remain after this page.'}, 'by_outcome': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': "Matched stops by outcome, most first; '(not recorded)' is often the largest."}, 'month_from': {'type': 'string', 'description': 'First month of the range searched, YYYY-MM; present only when month_from was given.'}, 'attribution': {'type': 'string', 'description': 'Open Government Licence attribution.'}, 'next_offset': {'type': 'number', 'description': 'Pass as offset for the next page; absent on the last page.'}, 'by_age_range': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by age range, most first.'}, 'by_legislation': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by legislation, most first.'}, 'force_published': {'type': 'boolean', 'description': "Whether every force found for the area (the one it names, or each located at a point, a polygon's centre and outermost vertices, or a location's map point) published stop and search this month, or in every month of a range: false when any month was missed. Otherwise absent when no force was found, when a month has no row in the publication list, or when none of those found is missing yet a polygon point could not be looked up."}, 'unfiltered_total': {'type': 'number', 'description': 'Stops in the area over the month or range, before filters.'}, 'by_object_of_search': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by object of search, most first.'}, 'by_self_defined_ethnicity': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by ethnicity as the person defined it, most first.'}, 'by_officer_defined_ethnicity': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': 'Matched stops by ethnicity as the officer perceived it, most first.'}, 'by_outcome_linked_to_object_of_search': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': "Matched stops by whether the outcome was linked to the object of search ('true', 'false' or '(not recorded)'), most first."}, 'by_removal_of_more_than_outer_clothing': {'type': 'array', 'items': {'type': 'object', 'required': ['value', 'count'], 'properties': {'count': {'type': 'number', 'description': 'Matched records.'}, 'value': {'type': 'string', 'description': "As published; '(not recorded)' when absent."}}, 'description': 'A value and its count.', 'additionalProperties': False}, 'description': "Matched stops by whether more than outer clothing was removed ('true', 'false' or '(not recorded)' where the force sent no value, as some do for vehicle-only searches), most first."}}, 'additionalProperties': False}
Hinzugefügt
ukcrime_find_neighbourhood
3. October 2026 02:40
Hinzugefügt
ukcrime_search_stops
3. October 2026 02:40
Hinzugefügt
ukcrime_get_crime_outcomes
3. October 2026 02:40
Hinzugefügt
ukcrime_search_outcomes
3. October 2026 02:40
Hinzugefügt
ukcrime_search_crimes
3. October 2026 02:40
Hinzugefügt
ukcrime_list_reference
3. October 2026 02:40