# Uk Police Crime By Location Scraper (`bigibyte/uk-police-crime-by-location-scraper`) Actor

Collect street-level UK crime records by coordinates or custom area for any given month. Filter by crime category, limit your dataset size, and easily download structured results in JSON, CSV, or Excel for local research, mapping, and analysis

- **URL**: https://apify.com/bigibyte/uk-police-crime-by-location-scraper.md
- **Developed by:** [BigiByte](https://apify.com/bigibyte) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Police Crime by Location Scraper

![UK Police Crime by Location Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/uk-police-crime-by-location-scraper-cover.png)

Collect street-level crime records from across the United Kingdom using geographic coordinates or a custom area. Choose a crime category and reporting month, retrieve structured location and crime information, and export your results in JSON, CSV, Excel, or other supported formats for neighbourhood research, mapping, and analysis.

### What This Actor Does

The **UK Police Crime by Location Scraper** collects publicly available street-level crime records from the UK Police data service.

Search around a specific latitude and longitude or define a custom polygon to retrieve crime records for a selected month. Results can include crime categories, street names, geographic coordinates, location information, and outcome details when available.

The actor removes duplicate records using `crimeId`, respects your `maxItems` limit, and records request errors where possible so that a failed request does not necessarily stop the entire run.

### Scraping Modes

- **Street-Level Search (`street`):** Retrieve crime records near a specified latitude and longitude for a selected month. The standard search covers an area of approximately one mile around the supplied point.
- **Custom Area Search (`poly`):** Retrieve crime records within a custom geographic polygon using a sequence of latitude and longitude coordinates. This mode is less tested, so small areas are recommended.

### Input Examples

**1. Search Crimes Near a Location**

```json
{
  "mode": "street",
  "lat": 52.629729,
  "lng": -1.131592,
  "date": "2024-01",
  "category": "all-crime",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

**2. Search Within a Custom Polygon**

```json
{
  "mode": "poly",
  "poly": "52.2,0.5:52.8,0.2:52.1,0.88",
  "date": "2024-01",
  "category": "all-crime",
  "maxItems": 25
}
```

#### Input Parameters

| Parameter | Type | Description |
|---|---|---|
| `mode` | String | Select `street` for coordinate-based searches or `poly` for custom polygon searches. |
| `lat` | Number | Latitude of the search location in street mode. |
| `lng` | Number | Longitude of the search location in street mode. |
| `poly` | String | Custom polygon coordinates in `lat,lng:lat,lng:...` format for polygon mode. |
| `date` | String | Reporting month in `YYYY-MM` format. |
| `category` | String | Crime category to retrieve, such as `all-crime`. |
| `maxItems` | Integer | Maximum number of records to save. Default: 100. Hard maximum: 1,000. |
| `requestDelayMs` | Integer | Delay between requests in milliseconds. Default: 1,000. |

### Output Example

Each successful crime record is saved as a separate dataset item.

```json
{
  "category": "anti-social-behaviour",
  "location_type": "Force",
  "location": {
    "latitude": "52.637556",
    "street": {
      "id": 1738177,
      "name": "On or near St Peters Lane"
    },
    "longitude": "-1.135305"
  },
  "context": "",
  "outcome_status": null,
  "persistent_id": "",
  "crimeId": 116209060,
  "location_subtype": "",
  "month": "2024-01",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

#### Output Fields

| Field | Description |
|---|---|
| `category` | Crime category assigned to the record. |
| `location_type` | Type of location associated with the record. |
| `location` | Nested location information, including coordinates and street details. |
| `location.latitude` | Latitude of the recorded crime location. |
| `location.longitude` | Longitude of the recorded crime location. |
| `location.street.id` | Identifier for the associated street. |
| `location.street.name` | Street description or nearby location name. |
| `context` | Additional contextual information, when available. |
| `outcome_status` | Associated outcome information, when available. |
| `persistent_id` | Persistent crime record identifier, when provided. |
| `crimeId` | Crime record ID. |
| `location_subtype` | More specific location classification, when available. |
| `month` | Reporting month in `YYYY-MM` format. |
| `scrapedAt` | Timestamp indicating when the record was collected. |

### Use Cases

- **Neighbourhood Research:** Explore reported crime categories around a property or geographic location for a selected month.
- **Crime Mapping:** Collect street names and geographic coordinates for GIS applications, interactive maps, and heatmaps.
- **Crime Category Analysis:** Focus on specific categories such as burglary, vehicle crime, or anti-social behaviour.
- **Location-Based Research:** Compare crime records across different neighbourhoods and geographic areas.
- **Historical Crime Analysis:** Collect monthly records to study changes in reported crime categories over time.
- **Custom Area Research:** Use polygon searches to investigate a small geographic area instead of relying on a single search point.

### Usage and Limits

- **Two search modes:** Choose coordinate-based street searches or custom polygon searches.
- **Monthly data:** Each search requires a reporting month in `YYYY-MM` format.
- **Crime categories:** Select a category such as `all-crime` or another supported category.
- **Maximum records:** Collect up to 1,000 records per run using `maxItems`.
- **Duplicate prevention:** Records are deduplicated using `crimeId`.
- **Request pacing:** The default delay is 1,000 milliseconds.
- **Single-response collection:** Each location and month search uses one response. There is no page cursor or multi-page pagination.
- **Polygon searches:** Custom polygon mode is less tested. Start with a small geographic area.

The source documents a request rate of approximately 15 requests per second, with bursts of up to 30. The actor's default one-second delay is intentionally more conservative. Follow the source's published usage guidance and avoid unnecessary request volume.

### Frequently Asked Questions

**1. What is the UK Police Crime by Location Scraper?**

It is a data collection tool for retrieving publicly available street-level crime records across the UK using geographic coordinates or custom polygon areas.

**2. Can I search crimes near a specific location?**

Yes. Select `street` mode and provide the location's latitude and longitude using `lat` and `lng`.

**3. Can I search a custom geographic area?**

Yes. Select `poly` mode and provide polygon coordinates using the format `lat,lng:lat,lng:...`. Small areas are recommended because this mode is less tested.

**4. Can I select a specific crime category?**

Yes. Use the `category` parameter to select the crime category you want to collect. The example uses `all-crime`.

**5. How do I select a reporting period?**

Provide the `date` parameter in `YYYY-MM` format. Each search retrieves records for the selected month.

**6. How many records can I collect per run?**

The maximum is 1,000 records per run. Use `maxItems` to control how many records are saved.

**7. Can I export the crime records?**

Yes. You can export the collected dataset in JSON, CSV, Excel, and other formats supported by Apify.

**8. Can I schedule recurring crime data collection?**

Yes. Use Apify schedules to run the actor automatically for your selected location, category, and reporting month.

### Related Tools

Explore other BigiByte tools for public data and geographic research:

- **Baton Rouge Property Information Scraper** – Collect property address and location records for geographic research.
- **Baton Rouge Tax Roll Scraper** – Retrieve public property tax roll and assessment records.
- **New Jersey Construction Permits Scraper** – Collect government-published construction permit records.

BigiByte develops custom web scrapers, data extraction tools, and APIs for businesses and developers.

Visit [BigiByte](https://bigibyte.com) to explore our services or discuss your data collection requirements.

### Trademark Notice

UK Police, and related names and trademarks belong to their respective owners. They are referenced solely to identify the source of the data. This actor does not imply affiliation, sponsorship, endorsement, or partnership with the UK Police or its associated organizations.

### Disclaimer

This actor is an independent data collection toole.uk or UK law enforcement organizations. Crime data availability, accuracy, classification, and completeness depend on the original source. Collected records should not be treated as a complete account of all crime or as a guarantee of current neighbourhood safety. Users are responsible for reviewing applicable licensing conditions, attribution requirements, privacy obligations, and source terms before using or redistributing collected information.

### Is Web Scraping Legal?

This actor extracts publicly accessible information without bypassing login screens, paywalls, or technical security layers. While collecting public web data is widely permitted, compliance depends on how data is gathered and used:

- **Personal Data:** Follow applicable privacy laws, including GDPR and CCPA, when collecting or processing personal information.
- **Copyrighted Content:** Check whether collected material is protected by copyright and whether you have permission to reuse or redistribute it.
- **Platform Terms and Rate Limits:** Respect the source's terms of use, request limits, and applicable data licensing requirements.

This information is provided for general guidance only and does not constitute legal advice. For more information, read [Apify's guide to web scraping legality](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

Street-level crimes within about 1 mile of lat/lng for a month, or a custom polygon area.

## `lat` (type: `number`):

Latitude for street mode (WGS84).

## `lng` (type: `number`):

Longitude for street mode (WGS84).

## `poly` (type: `string`):

Custom area as lat,lng:lat,lng:... (used when mode is poly).

## `date` (type: `string`):

Crime month as YYYY-MM.

## `category` (type: `string`):

Crime category slug such as all-crime, burglary, or anti-social-behaviour.

## `maxItems` (type: `integer`):

Stop after this many successful rows. Hard max is 1000.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait before each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "street",
  "lat": 52.629729,
  "lng": -1.131592,
  "poly": "52.2,0.5:52.8,0.2:52.1,0.88",
  "date": "2024-01",
  "category": "all-crime",
  "maxItems": 100,
  "userAgent": "ActorResearch/1.0",
  "requestDelayMs": 1000,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "lat": 52.629729,
    "lng": -1.131592,
    "date": "2024-01",
    "category": "all-crime"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bigibyte/uk-police-crime-by-location-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "lat": 52.629729,
    "lng": -1.131592,
    "date": "2024-01",
    "category": "all-crime",
}

# Run the Actor and wait for it to finish
run = client.actor("bigibyte/uk-police-crime-by-location-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "lat": 52.629729,
  "lng": -1.131592,
  "date": "2024-01",
  "category": "all-crime"
}' |
apify call bigibyte/uk-police-crime-by-location-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bigibyte/uk-police-crime-by-location-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/G3qkdGCXdTVlJUtQB/builds/XN2Nc2WRXD9vpVAsA/openapi.json
