# CA Police Incidents - SF, Oakland & LA NIBRS Crime (`j0401/ca-crime`) Actor

Anonymous police incident feeds for SF, Oakland & LA (public data): crimes happening, where, recent trends. Filter by category/area/date/keyword; LA adds NIBRS flags (DV/hate/gang/victim-shot). For underwriting & safety analysis.

- **URL**: https://apify.com/j0401/ca-crime.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 california police incident records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## CA Police Incidents - SF, Oakland & LA (anonymous)

San Francisco, Oakland and Los Angeles each publish their **police incident feed** as open data (city Socrata, free public data). This actor turns them into a queryable, charged-per-record API - **for underwriting, claims, neighborhood-safety and due-diligence analysis.**

> **Important:** all three feeds are **anonymous incident records** - no personal names. This is a geographic / statistical crime layer, not an individual-screening tool.

### What it covers

**San Francisco** (`city: sf`) - SFPD Incident Reports, 2018-present, rolling (~1.06M records): crime category / subcategory / description, resolution (arrest / open / closed), police district, analysis neighborhood, date, lat/lon.

**Oakland** (`city: oakland`) - CrimeWatch, 2008-present, rolling (~1.28M records): crimetype (e.g. `BURG - AUTO`, `STOLEN VEHICLE`, `PETTY THEFT`, `DOMESTIC VIOLENCE`), description, police beat, address. No coordinates.

**Los Angeles** (`city: la`) - LAPD NIBRS Offenses, 2024-present, rolling live (~466k records): the richest feed - NIBRS crime code + description, crime-against (property/person/society), premise, weapon, disposition, LAPD area, lat/lon, and flags for **victim shot / domestic violence / hate crime / gang-related / transit-related**.

### Typical questions

- "What crimes happened in the Mission (SF) last month?"
- "Car break-ins / stolen vehicles in Oakland by beat - recent trend?"
- "Domestic-violence or hate-crime incidents in Southeast LA this year?"
- "Which categories dominate this city right now?"

### Low cost

**From $0.001 per record** - billed only for the rows you use, with a per-run charge cap so a broad query can't surprise-bill.

Three cities, three very different datasets, one schema. SF's feed is rich (coordinates, ~1.06M incidents); Oakland's is thin (no coordinates, ~1.28M rows back to 2008); LA publishes under the national NIBRS standard with a different column set - and its table carries **rows dated back to the year 1800**, which we exclude automatically on every pull. Category matching, coordinate handling and exact-vs-substring semantics are handled per city, then normalized onto one query surface so a date-windowed or area-filtered scan reads identically across all three. You query one clean incident surface across SF, Oakland or LA; the three-city schema archaeology stays on our side.

### Inputs

| Input | What it does |
|---|---|
| `city` | `sf` (default) / `oakland` / `la` |
| `category` | SF category / Oakland crimetype / LA NIBRS description |
| `dateFrom` / `dateTo` | incident date window |
| `area` | SF neighborhood / Oakland beat / LA area name |
| `district` | SF police district |
| `keyword` | incident description substring |
| `domesticViolence` / `hateCrime` / `gangRelated` / `victimShot` | LA-only flag filters (yes/no) |
| `aggregate` / `groupBy` | one row per group (category / area / district / year) with a count |
| `maxResults` | cap records (default 200) |

**Default run = the ~200 most recent SF incidents** - a live "what's happening now in SF" feed.

### Source

- [SFPD Incident Reports](https://data.sfgov.org/Public-Safety/Police-Department-Incident-Reports-2018-to-Present/wg3w-h783) - official, daily refresh.
- [Oakland CrimeWatch Data](https://data.oaklandca.gov/) - official, rolling.
- [LAPD NIBRS Offenses](https://data.lacity.org/) - official, rolling.

# Actor input Schema

## `city` (type: `string`):

sf = SFPD Incident Reports (2018-present, rolling daily). oakland = CrimeWatch (2008-present, rolling). la = LAPD NIBRS Offenses (2024+, rolling live, richest flags).

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

SF: incident category (e.g. 'Assault', 'Larceny Theft', 'Burglary'). Oakland: crimetype enum (e.g. 'BURG - AUTO', 'STOLEN VEHICLE', 'PETTY THEFT', 'DOMESTIC VIOLENCE'). LA: NIBRS description substring (e.g. 'Burglary', 'Grand Theft').

## `dateFrom` (type: `string`):

Only incidents on/after this date.

## `dateTo` (type: `string`):

Only incidents on/before this date.

## `area` (type: `string`):

SF: analysis neighborhood (e.g. 'Mission'). Oakland: police beat (e.g. '77'). LA: NIBRS area name (e.g. 'Southeast', 'Pacific', 'Rampart').

## `district` (type: `string`):

SF only: police district (e.g. 'Mission', 'Park', 'Southern').

## `keyword` (type: `string`):

Substring match against the incident description.

## `domesticViolence` (type: `string`):

LA only: filter to (or exclude) domestic-violence incidents.

## `hateCrime` (type: `string`):

LA only: filter to (or exclude) hate-crime incidents.

## `gangRelated` (type: `string`):

LA only: filter to (or exclude) gang-related incidents.

## `victimShot` (type: `string`):

LA only: filter to (or exclude) incidents where a victim was shot.

## `aggregate` (type: `boolean`):

When on, returns one summary row per group (category / area / district / year) with an incident count.

## `groupBy` (type: `string`):

category / area / district (SF) / year (SF).

## `maxResults` (type: `integer`):

Cap records pushed (0 = a reasonable ceiling). Default = the ~50 most recent SF incidents.

## Actor input object example

```json
{
  "city": "sf",
  "aggregate": false,
  "groupBy": "category",
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

California police incident records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/ca-crime").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/ca-crime").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 '{}' |
apify call j0401/ca-crime --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/ca-crime"
        }
    }
}
```

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/0SjbEoxQoIhqlUzBF/builds/DlBXbVefSYvWSPHP2/openapi.json
