ParseForge Scrapers

San Francisco Crime Data Scraper

parseforge/san-francisco-crime-data-scraper

OtherNews & mediaLead generation

Scrapes San Francisco crime incident records from the SFPD public dataset. Returns each incident as a flat row with category, district, neighborhood, and date. Filter by date range, category, district, or neighborhood.

Run this scraper See the API call
Total users
2
Monthly active
1
Total runs
95
Bookmarked
0
Rating
Not rated yet
Last modified
12 days ago

Overview

ParseForge

San Francisco Crime Data Scraper

Scrape San Francisco crime reports from SFPD data, up to a million records per run. Every incident comes with its category, district, neighborhood, and date. No login or API key. Export to CSV, JSON, Excel, or XML.

San Francisco's official crime data portal is built for analysts, not for bulk export. This Actor reads the public SFPD incident dataset directly, filtered by date range, category, district, or neighborhood, and returns each matching record in one fixed schema.

Who uses it What they scrape San Francisco Crime Data for
Local journalists Which neighborhoods saw the most reported incidents last month
Urban researchers How crime patterns shift across police districts over time
Real estate analysts Which areas have rising or falling incident counts
Community advocates What categories dominate in a specific neighborhood
Data engineers A clean, scheduled feed of SF crime records into a warehouse

What it does

This Actor collects San Francisco crime incident records from the SFPD public dataset and returns each one as a flat row.

  • πŸ“… Date range filter: set a start and end date to pull only incidents in that window.
  • 🏷️ Category match: filter by incident category such as Assault or Larceny.
  • πŸ—ΊοΈ District and neighborhood: narrow results to one SFPD district or analysis neighborhood.
  • πŸ“¦ Bulk export: collect up to one million records per run, then export to CSV, JSON, Excel, or XML.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with San Francisco Crime Data data

πŸ“ˆ Track neighborhood crime trends.

A local newsroom runs the Actor weekly for a set of neighborhoods and charts incident counts to spot emerging hotspots.

πŸ—ΊοΈ Compare police districts.

An urban researcher pulls a year of records for two districts and compares category mix to understand enforcement differences.

🏠 Screen rental locations.

A real estate analyst filters by neighborhood and date range to check recent incident volume before recommending a property.

πŸ“Š Feed a public dashboard.

A data engineer schedules daily runs and loads the flat CSV into a warehouse that powers a community crime map.

Why choose this scraper

What you get
No API key Reads the public SFPD dataset directly, no registration or OAuth
Fixed schema Every record returns the same flat fields for easy joins
Scheduled runs Set a daily or weekly run to track new incidents automatically
Large volume Collect up to one million records per run

How it compares

No other Store actor targets San Francisco Crime Data the same way, so the honest comparison is with the alternatives teams actually weigh.

San Francisco Crime Data Scraper Build it in-house By hand
Setup Run it now, zero config Days of engineering None, but hours per pull
When San Francisco Crime Data changes Maintained for you You fix it You re-learn the page
Proxies, retries, anti-bot Built in Your problem Browser only
Output Fixed JSON schema, CSV/Excel export Whatever you build Copy-paste
Cost Pay per result Engineering time Analyst hours

Configure the run

Drive the Actor with an optional date range, incident category, police district, and neighborhood. Filters run as each record is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
  "maxItems": 10
}

A larger pull:

{
  "maxItems": 200
}

Pricing

Pay-per-result: $0.021 per result collected. You pay only for the results written to your dataset.

Results collected Approximate cost
100 results $2.10
1,000 results $21.00
10,000 results $210.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the San Francisco Crime Data Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to San Francisco Crime Data through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/san-francisco-crime-data-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check your filters. A date range that is too narrow, a misspelled category, or a district name that does not match the official SFPD naming can return zero records. Try removing filters one at a time.

Why is my date filter not working?

Make sure the start and end dates are in YYYY-MM-DD format. If the end date is before the start date, the Actor will return nothing.

Why did the run stop before reaching my max records?

The Actor stops when it has read all records that match your filters. If the dataset has fewer matching incidents than your max, you will get all of them.

Why is the category filter returning unexpected results?

The category field is a substring match. Searching for 'theft' will also match 'grand theft' and 'petty theft'. Use a more specific term if you need exact matches.

Can I get the raw dataset instead of filtered rows?

Yes. Leave all filter fields empty and set max records to a high number to collect the full published dataset.

FAQ

Question Answer
Where does the data come from? The Actor reads the public San Francisco Police Department incident dataset published by the City and County of San Francisco.
Do I need an API key or login? No. The Actor reads the public dataset directly, so no registration or authentication is required.
How many records can I get in one run? You can set the maximum records field to any number up to one million per run.
Can I filter by date? Yes. Use the start date and end date fields to limit results to a specific window, in YYYY-MM-DD format.
Can I filter by crime type? Yes. The incident category field accepts a substring match, so you can enter Assault, Larceny, or any other category.
Can I filter by neighborhood or district? Yes. Use the police district field for SFPD district names and the neighborhood field for analysis neighborhood names.
What format is the output? The Actor returns a flat dataset that you can export to CSV, JSON, Excel, or XML from the Apify platform.
Is the data real-time? The dataset is updated by the city on a regular schedule. The Actor reads the latest published version on each run.
Can I schedule this Actor? Yes. You can set a daily or weekly schedule in Apify to collect new incidents automatically.
Does this include every crime in San Francisco? It includes incidents reported to and published by the SFPD in the public dataset. Some sensitive or ongoing cases may be excluded by the city.

Related actors

Browse the full ParseForge collection for more scrapers.

πŸ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by City and County of San Francisco. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

Input

FieldTypeWhat it doesDefault
maxItems integer How many crime records to collect per run. 10
startDate string YYYY-MM-DD lower bound. not set
endDate string YYYY-MM-DD upper bound. not set
category string Substring match (e.g. Assault, Larceny). not set
policeDistrict string SFPD district name. not set
neighborhood string Analysis neighborhood name. not set

Pricing

from $19.00 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.019 to $0.021

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST Β· run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~san-francisco-crime-data-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run San Francisco Crime Data Scraper on Apify All scrapers