Custom Connector
UK Police Data Connector
UK
The UK Police Data Connector facilitates seamless integration with the UK Police Data API, providing access to police-related data including neighbourhood teams, upcoming events, street-level crime and outcome data, and nearest police stations for UK police forces. It acts as a proxy for force details, crime data, neighbourhood information, and stop-and-search records.
Overview
Integration Overview
This document provides a detailed guide for each integration point, its purpose, configuration, and workflow support using the UK Police Data Connector on Google Cloud Platform.
- listForces. List all UK police forces.
- getForce. Details for a specific police force.
- getForceSeniorOfficers. Senior officers for a police force.
- getStreetLevelCrimes. Street-level crime data for an area or polygon.
- getCrimesStreetDates. Available dates for street-level crime data.
- getStreetLevelOutcomes. Street-level crime outcomes for a location.
- getCrimesAtLocation. Crimes at a specific location.
- getCrimesNoLocation. Crimes without specific location data.
- getCrimeCategories. Available crime categories.
- getCrimeLastUpdated. Last-updated date for crime data.
- getOutcomesForCrime. Outcomes for a specific crime.
- listNeighbourhoods. Neighbourhoods for a police force.
- getNeighbourhood. Details for a specific neighbourhood.
- getNeighbourhoodBoundary. Geographic boundary for a neighbourhood.
- getNeighbourhoodTeam. Team members for a neighbourhood.
- getNeighbourhoodEvents. Upcoming events for a neighbourhood.
- getNeighbourhoodPriorities. Policing priorities for a neighbourhood.
- locateNeighbourhood. Locate a neighbourhood by coordinates.
- getStopAndSearchesByArea. Stop-and-search records for an area.
- getStopAndSearchesAtLocation. Stop-and-search records at a location.
- getStopAndSearchesNoLocation. Stop-and-search records without location.
- getStopAndSearchesByForce. Stop-and-search records for a force.
Documentation
Detailed Integration Documentation
List All Police Forces
| Action | listForces |
|---|---|
| Purpose | Retrieves a comprehensive list of all UK police forces. The primary entry point for police-force data. |
| Parameters | Required: None. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with id and name. Failure: HTTP 404/500 with error message. |
| Workflow example | Execute listForces, then use the result to select a force for crime-data queries. |
Get Specific Police Force
| Action | getForce |
|---|---|
| Purpose | Retrieves details for a specific UK police force. |
| Parameters | Required: id (police force ID, e.g. metropolitan). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON object with id and name. Failure: error details (invalid-id). |
| Workflow example | Execute getForce with id=metropolitan, then use the details for reporting. |
Get Senior Officers
| Action | getForceSeniorOfficers |
|---|---|
| Purpose | Retrieves senior officers for a specific police force. |
| Parameters | Required: id (police force ID). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with name, rank, bio. Failure: error details (invalid-id). |
| Workflow example | Execute getForceSeniorOfficers with id=metropolitan, then display leadership info in a dashboard. |
Get Street-Level Crimes
| Action | getStreetLevelCrimes |
|---|---|
| Purpose | Retrieves street-level crime data for a specified area or polygon. |
| Parameters | Required: at least one of lat/lng or poly. Optional: lat, lng, poly (lat,lng:lat,lng:…), date (YYYY-MM). |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of crime objects (id, category, location, date). Failure: error details (invalid-parameters). |
| Workflow example | Execute getStreetLevelCrimes with lat=51.5074, lng=-0.1278, date=2023-01, then map crime locations. |
Get Available Crime Dates
| Action | getCrimesStreetDates |
|---|---|
| Purpose | Retrieves available dates for street-level crime data. |
| Parameters | Required: None. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of strings (e.g. [“2023-01”, “2023-02”]). Failure: HTTP 500. |
| Workflow example | Execute getCrimesStreetDates, then select a valid date for crime queries. |
Get Street-Level Outcomes
| Action | getStreetLevelOutcomes |
|---|---|
| Purpose | Retrieves street-level crime outcomes for a specified location. |
| Parameters | Required: at least one of location_id, lat/lng, or poly. Optional: location_id, lat, lng, poly, date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with crime_id, outcome, date. Failure: error details (invalid-parameters). |
| Workflow example | Execute getStreetLevelOutcomes with lat, lng, and date, then analyze outcomes in BigQuery. |
Get Crimes at Location
| Action | getCrimesAtLocation |
|---|---|
| Purpose | Retrieves crimes at a specific location. |
| Parameters | Required: at least one of location_id or lat/lng. Optional: location_id, lat, lng, date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of crime objects. Failure: error details (invalid-location). |
| Workflow example | Execute getCrimesAtLocation with location_id and date, then visualize in a dashboard. |
Get Crimes with No Location
| Action | getCrimesNoLocation |
|---|---|
| Purpose | Retrieves crimes without specific location data, for force-wide analysis. |
| Parameters | Required: category, force. Optional: date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of crime objects. Failure: error details (invalid-category). |
| Workflow example | Execute getCrimesNoLocation with category=burglary, force=metropolitan, date=2023-01. |
Get Crime Categories
| Action | getCrimeCategories |
|---|---|
| Purpose | Retrieves available crime categories. |
| Parameters | Required: None. Optional: date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with url and name. Failure: HTTP 500. |
| Workflow example | Execute getCrimeCategories with date=2023-01, then populate a category selector. |
Get Last Updated Date
| Action | getCrimeLastUpdated |
|---|---|
| Purpose | Retrieves the last-updated date for crime data. |
| Parameters | Required: None. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON object with date. Failure: HTTP 500. |
| Workflow example | Execute getCrimeLastUpdated to verify data freshness before querying. |
Get Outcomes for Crime
| Action | getOutcomesForCrime |
|---|---|
| Purpose | Retrieves outcomes for a specific crime. |
| Parameters | Required: persistent_id (crime ID). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with crime_id, outcome, date. Failure: error details (invalid-crime-id). |
| Workflow example | Execute getOutcomesForCrime with persistent_id, then display resolution details. |
List Neighbourhoods
| Action | listNeighbourhoods |
|---|---|
| Purpose | Retrieves a list of neighbourhoods for a specific police force. |
| Parameters | Required: force (police force ID). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with id, name, force. Failure: error details (invalid-force). |
| Workflow example | Execute listNeighbourhoods with force=leicestershire, then populate a neighbourhood selector. |
Get Neighbourhood Details
| Action | getNeighbourhood |
|---|---|
| Purpose | Retrieves details for a specific neighbourhood. |
| Parameters | Required: force, id. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON object with id, name, force. Failure: error details (invalid-neighbourhood). |
| Workflow example | Execute getNeighbourhood with force and id, then display neighbourhood details. |
Get Neighbourhood Boundary
| Action | getNeighbourhoodBoundary |
|---|---|
| Purpose | Retrieves the geographic boundary for a neighbourhood. |
| Parameters | Required: force, id. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with latitude and longitude. Failure: error details (invalid-neighbourhood). |
| Workflow example | Execute getNeighbourhoodBoundary, then use the boundary data for mapping. |
Get Neighbourhood Team
| Action | getNeighbourhoodTeam |
|---|---|
| Purpose | Retrieves team members for a neighbourhood. |
| Parameters | Required: force, id. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with name, rank, contact_details. Failure: error details (invalid-neighbourhood). |
| Workflow example | Execute getNeighbourhoodTeam, then display team member details in a community portal. |
Get Neighbourhood Events
| Action | getNeighbourhoodEvents |
|---|---|
| Purpose | Retrieves upcoming events for a neighbourhood. |
| Parameters | Required: force, id. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with title, date, location. Failure: error details (invalid-neighbourhood). |
| Workflow example | Execute getNeighbourhoodEvents, then display events in a calendar application. |
Get Neighbourhood Priorities
| Action | getNeighbourhoodPriorities |
|---|---|
| Purpose | Retrieves policing priorities for a neighbourhood. |
| Parameters | Required: force, id. Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with issue and action. Failure: error details (invalid-neighbourhood). |
| Workflow example | Execute getNeighbourhoodPriorities, then display priorities in a public portal. |
Locate Neighbourhood by Coordinates
| Action | locateNeighbourhood |
|---|---|
| Purpose | Locates a neighbourhood by geographic coordinates. |
| Parameters | Required: q (lat,lng, e.g. 51.500617,-0.124629). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON object with id, name, force. Failure: error details (invalid-coordinates). |
| Workflow example | Execute locateNeighbourhood with q, then use the result for further queries. |
Get Stop and Searches by Area
| Action | getStopAndSearchesByArea |
|---|---|
| Purpose | Retrieves stop-and-search records for a specified area. |
| Parameters | Required: at least one of lat/lng or poly. Optional: lat, lng, poly, date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with type, datetime, location, outcome. Failure: error details (invalid-parameters). |
| Workflow example | Execute getStopAndSearchesByArea with lat, lng, date, then analyze in BigQuery. |
Get Stop and Searches at Location
| Action | getStopAndSearchesAtLocation |
|---|---|
| Purpose | Retrieves stop-and-search records at a specific location. |
| Parameters | Required: location_id. Optional: date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with type, datetime, location, outcome. Failure: error details (invalid-location). |
| Workflow example | Execute getStopAndSearchesAtLocation with location_id and date, then store results for reporting. |
Get Stop and Searches with No Location
| Action | getStopAndSearchesNoLocation |
|---|---|
| Purpose | Retrieves stop-and-search records without specific location data. |
| Parameters | Required: force. Optional: date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with type, datetime, outcome. Failure: error details (invalid-force). |
| Workflow example | Execute getStopAndSearchesNoLocation with force and date for force-wide trends. |
Get Stop and Searches by Force
| Action | getStopAndSearchesByForce |
|---|---|
| Purpose | Retrieves stop-and-search records for a specific police force. |
| Parameters | Required: force. Optional: date. |
| Configuration | Configure the base URL via CONNECTOR_ENV_UKPOLICEDATA_BASE_URL (e.g. https://data.police.uk/api). |
| Output | Successful: JSON array of objects with type, datetime, location, outcome. Failure: error details (invalid-force). |
| Workflow example | Execute getStopAndSearchesByForce with force and date for force-level reporting. |
Example Workflow: Crime and Neighbourhood Analysis
| Retrieve police forces | Use listForces and identify a target force (e.g. metropolitan). |
|---|---|
| Query neighbourhoods | Execute listNeighbourhoods with force=metropolitan and select a neighbourhood. |
| Fetch crime data | Use getStreetLevelCrimes with lat, lng, and date to retrieve and map crimes. |
| Analyze outcomes | Execute getStreetLevelOutcomes and store results in BigQuery for trend analysis. |
| Enhance UI | Use getNeighbourhoodEvents and getNeighbourhoodPriorities to power a community-engagement UI. |
Support
For technical support, contact custom-connectors-support@isolutions.sa.