# Philadelphia Crime Data Scraper (`parseforge/philadelphia-crime-data-scraper`) Actor

Scrapes Philadelphia Police Department incident reports from the public open data portal. Returns each incident as a flat row with dispatch date, district, crime type, and location coordinates. Filter by date range, district code, or crime type.

- **URL**: https://apify.com/parseforge/philadelphia-crime-data-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Other, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Philadelphia Crime Data Scraper

**Scrape Philadelphia crime incident reports from the PPD public data portal, up to a million per run.** Every record includes the dispatch date, district, crime type, and location coordinates. Export to CSV, JSON, Excel, or XML.

The Philadelphia Police Department publishes incident data on its open data portal, but browsing it page by page or downloading massive static files is slow and inflexible. This Actor reads the live feed directly, letting you pull only the reports you need by date range, district, or crime type. You get a clean, flat dataset without writing any code or managing API keys.

| Who uses it | What they scrape Philadelphia Police Department for |
|---|---|
| Local journalists | Tracking crime trends in specific Philadelphia neighborhoods for a story. |
| Academic researchers | Building a time-series dataset of incident types for a criminology study. |
| Community organizers | Monitoring incident counts in their district to support grant applications. |
| Real estate analysts | Assessing public safety patterns when evaluating Philadelphia property markets. |

### What it does

This Actor collects Philadelphia crime incident reports from the PPD public data portal and returns each one as a flat row with dispatch date, district, crime type, and location.

- 📅 **Date range filter:** Set a start and end date to pull only incidents dispatched within a specific window.
- 🏛️ **District filter:** Narrow results to a single PPD district code, such as 01 or 12.
- 🔍 **Crime type search:** Filter by a substring of the crime description, like 'Theft' or 'Assault'.
- 📊 **Flat row output:** Every incident is returned as one row, ready for analysis in any spreadsheet or database.

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

### What you can do with Philadelphia Police Department data

**📰 Report on neighborhood safety.**

A local journalist sets a district and a three-month date range to collect incident data for a story on rising theft in Kensington.

**🎓 Build a longitudinal crime dataset.**

A graduate researcher runs the Actor monthly with a broad date range to compile a multi-year dataset for a spatial analysis of violent crime.

**🏘️ Support a community grant proposal.**

A neighborhood association pulls one year of incidents for their district to include public safety statistics in a funding application.

**🏠 Evaluate a rental market.**

A real estate analyst collects six months of incident data across several districts to compare safety profiles before recommending investment properties.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key needed** | Reads the public data feed directly with no registration or authentication. |
| **Flexible filtering** | Combine date, district, and crime type filters to isolate exactly the incidents you care about. |
| **Scalable collection** | Pull up to a million records in a single run for large-scale analysis. |
| **Structured output** | Every record follows a fixed schema, making it easy to merge with other datasets. |

### How it compares

No other Store actor targets Philadelphia Police Department the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Philadelphia Crime Data Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Philadelphia Police Department 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 optional date range, district, and crime type filters that are applied as each incident is read so only matching reports reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "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](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Philadelphia Crime Data Scraper](https://apify.com/parseforge/philadelphia-crime-data-scraper?fpr=vmoqkp).
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](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Philadelphia Police Department through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/philadelphia-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 that your date range is valid and that the district code or crime type filter is not too restrictive. Try running with only a date range first, then add filters one at a time.

**The run stopped before reaching my maxItems limit.**

The Actor stops when it has read all available incidents matching your filters. If fewer incidents exist in the source than your maxItems value, the run will finish early.

**My date filter is not working as expected.**

Ensure you are using YYYY-MM-DD format without any extra characters. The filter applies to the dispatch\_date field, not the report date.

**I entered a district code but got incidents from other districts.**

District codes are two-digit strings like '01' or '12'. Enter the code exactly as it appears in the PPD system, including any leading zero.

**The crime type filter returned unexpected results.**

The filter is a substring match. Searching for 'Assault' will also return 'Aggravated Assault' and 'Simple Assault'. Use a more specific term to narrow results.

### FAQ

| Question | Answer |
|---|---|
| Where does the data come from? | The Actor reads from the Philadelphia Police Department's public open data portal, which publishes incident reports on an ongoing basis. |
| Do I need an API key or a City of Philadelphia account? | No. The Actor accesses the public data feed directly. No registration, API key, or authentication is required. |
| How many records can I pull in one run? | The free tier allows up to 10 incidents. Paid plans can pull up to 1,000,000 records per run. |
| Can I filter by a specific neighborhood? | The Actor filters by PPD district code, not by neighborhood name. You can find the district code that covers your area of interest and use that. |
| What date format should I use for the start and end date? | Use YYYY-MM-DD format, for example 2024-01-15. The filter applies to the dispatch date field. |
| How does the crime type filter work? | It performs a case-sensitive substring match on the text\_general\_code field. Entering 'Theft' will return all incidents where the crime description contains that word. |
| What export formats are supported? | You can export your dataset in CSV, JSON, Excel, or XML format from the Apify platform. |
| Does this Actor include victim or suspect information? | No. The data contains incident-level details like dispatch date, location, and crime type, but no personally identifiable information about individuals. |
| How often is the source data updated? | The PPD updates its open data portal regularly. Run the Actor on a schedule to capture new incidents as they are published. |
| Can I get the coordinates for mapping? | Yes. Each incident record includes latitude and longitude fields that you can use for geospatial analysis and mapping. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) 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 of Philadelphia. 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.

# Actor input Schema

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

Free: 10 items. Paid: up to 1,000,000.

## `startDate` (type: `string`):

YYYY-MM-DD lower bound on dispatch\_date.

## `endDate` (type: `string`):

YYYY-MM-DD upper bound.

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

PPD district code (e.g. 01, 12).

## `crimeType` (type: `string`):

Substring match on text\_general\_code.

## Actor input object example

```json
{
  "maxItems": 10
}
```

# Actor output Schema

## `results` (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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/philadelphia-crime-data-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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/philadelphia-crime-data-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 '{
  "maxItems": 10
}' |
apify call parseforge/philadelphia-crime-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/philadelphia-crime-data-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/pecAR9z7eB1qbSixd/builds/cFigxEFWkD86ea9oe/openapi.json
