# Philly311 Service Requests - City Service & Response Data (`j0401/philly-311`) Actor

Philly311 service requests (public open data, 5.9M requests, 2014-today): service type and code, responsible agency, request, update and close timestamps, expected completion, status note, plus address, ZIP and geocode where supplied.

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

## Pricing

from $0.03 / 1,000 philly311 service request records

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?

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

## Philly311 Service Requests - City Service & Response Data

Every non-emergency service request a Philadelphia resident has filed with the City, **5,942,159** of them, from 2014 through today.

Refuse and recycling, street light outages, potholes, illegal dumping, graffiti, abandoned vehicles, vacant lots, tree problems, property maintenance, and the large *Information Request* stream that accounts for more than half the corpus.

```
Closed   5,844,270
Open        97,889
```

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold** Pay-per-event: you are charged per record delivered, and nothing for the query.

### What you get

| Field | Meaning |
|---|---|
| `requestId` | The request |
| `serviceName` / `serviceType` / `serviceCode` | What was asked for - 140 service types, `Information Request` 3,339,272 / `Abandoned Vehicle` 275,788 / `Illegal Dumping` 240,415 / `Rubbish Collection` 231,202 / `Graffiti Removal` 151,002 / `Street Light Outage` 130,248 |
| `agency` | Who handles it - `Philly311 Contact Center` 1,786,438 / `Streets Department` 1,525,925 / `License & Inspections` 862,279 / `Police Department` 387,540 and 64 more |
| `requestedDate` / `updatedDate` / `closedDate` | The lifecycle, to the second at the source |
| `expectedDate` | The promised completion date (38.3% of requests) |
| `status` / `statusNotes` | `Closed` / `Open`, with the free-text note (`Question Answered`, `Inspected`, ) on 65.7% |
| `address` / `zip` / `latitude` / `longitude` | Where, when the citizen supplied it |
| `serviceNotice` / `mediaUrl` | The service notice, and a photo where one was attached |

### Modes

- **`rows`** (default) - requests matching your filters.
- **`aggregate`** - one count row per group: by service name, service type, agency or status.

### Example inputs

**Potholes reported this week** - `serviceType` is a substring match; `recentDays` keeps only the last N days.

```json
{ "serviceType": "Pothole Repair", "recentDays": 7 }
```

**Street lights still out** - `service` matches the service name and `status` is `Closed` or `Open`.

```json
{ "service": "Street Light Outage", "status": "Open", "maxResults": 25 }
```

**A neighbourhood's graffiti reports** - `zip` is a prefix match; it is present on 43% of requests, so this answers over the geolocated subset.

```json
{ "serviceType": "Graffiti Removal", "zip": "19132", "maxResults": 25 }
```

**Open versus closed** - one count per status.

```json
{ "mode": "aggregate", "groupBy": "status" }
```

### Two thirds of these requests have no location

This is the thing to know before you build on the address fields:

| Field | Populated |
|---|---|
| `requestedDate` / `updatedDate` | 100% / 100% |
| `serviceName` / `serviceType` / `agency` | 100% / 100% / 100% |
| `closedDate` | 98.4% |
| `statusNotes` | 65.7% |
| `address` | 46.4% |
| `latitude` / `longitude` | 45.0% |
| `zip` | 43.1% |
| `expectedDate` | 38.3% |

That is a property of how the City runs 311, not a defect in this actor. A large share of requests are citywide questions - *"Information Request"* alone is 56% of the corpus - which have no property attached. So a query for *"potholes in ZIP 19132"* is answering over the **geolocated ~45%** of requests, and it will undercount. Nothing here presents that subset as the whole.

### The other Philly311 table is dead

A second, similarly-named service, `philly311__public_cases`, is still published and holds 4,219,410 rows. It is **frozen at 2023-04-12** - an earlier and smaller slice of the same data, abandoned in place when the City moved.

It is dangerous precisely because it looks alive: its own metadata does not flag it, and a query against it for the last two years returns nothing rather than an error. This actor reads the live table, which carries 5,942,159 requests through this week and adds a `serviceType` column the old one lacks.

### Source

> **Counts below are a live snapshot** - the layer is edited continuously, so exact figures move between reads. The order of magnitude and the ratios are stable.

City of Philadelphia, published on the City's ArcGIS open-data service as `PUBLIC_CASES_FC` - public open data, no login and no key. Requests range from 2014-01-01 to the current day.

### Example output

**One request** - `service=Miscellaneous`, `status=Open` returns records like this one:

```json
{
  "platform": "philly-311",
  "source": "philadelphia-311-service-requests",
  "mode": "rows",
  "groupKey": "",
  "groupCount": "",
  "groupBy": "",
  "requestId": "19953928",
  "status": "Open",
  "statusNotes": "",
  "serviceName": "Miscellaneous",
  "serviceType": "Miscellaneous",
  "serviceCode": "SR-MI01",
  "agency": "Philly311 Contact Center",
  "serviceNotice": "",
  "requestedDate": "2026-09-22",
  "updatedDate": "2026-09-22",
  "expectedDate": "",
  "closedDate": "",
  "address": "",
  "zip": "",
  "latitude": "",
  "longitude": "",
  "mediaUrl": "",
  "sourceUpdatedAt": "2026-09-23"
}
```

**`mode=aggregate`, `groupBy=status`** - one row per group:

```
Closed   5,844,270
Open        97,889
```

**Which services dominate** - `mode=aggregate`, `groupBy=serviceType`:

```
Information Request         3,339,272
Abandoned Vehicle             275,788
Illegal Dumping               240,415
Rubbish Collection            231,202
Graffiti Removal              151,002
Street Light Outage           130,248
```

**Who does the work** - `mode=aggregate`, `groupBy=agency`:

```
Philly311 Contact Center      1,786,438
Streets Department            1,525,925
License & Inspections           862,279
Police Department               387,540
Community Life Improvement      248,078
```

### Output

Every record carries the same key set regardless of mode - the request fields plus the aggregate columns (`groupKey`, `groupCount`, `groupBy`), which are `""` outside aggregate mode. Every record carries `sourceUpdatedAt`, the date the City last edited the layer.

### Related actors

- **Philadelphia L\&I Violations** - the code violations and inspections that many of these requests turn into.
- **Philadelphia Building Permits** - permits for the construction work residents complain about.

# Actor input Schema

## `service` (type: `string`):

Substring match on the service name, e.g. 'Street Defect' (potholes), 'Graffiti Removal', 'Street Light Outage'. Blank = any.

## `serviceType` (type: `string`):

Substring match on the service type. 140 types exist, e.g. 'Pothole Repair', 'Rubbish Collection'. Blank = any.

## `agency` (type: `string`):

Substring match on the agency responsible, e.g. 'Streets', 'Police', 'Licenses'. Blank = any.

## `address` (type: `string`):

Substring match on the reported address. Present on 46% of requests - a query using this is answering over the geolocated subset. Blank = any.

## `zip` (type: `string`):

ZIP or ZIP prefix. Present on 43% of requests. Blank = any.

## `serviceCode` (type: `string`):

Substring match on the service code, e.g. 'SR-IR01'. Blank = any.

## `statusNote` (type: `string`):

Substring match on the free-text status note, e.g. 'Answered', 'Inspected'. Blank = any.

## `status` (type: `string`):

Request status. 'Closed' 5,844,270 / 'Open' 97,889. Blank = any.

## `requestedFrom` (type: `string`):

Earliest request date, YYYY-MM-DD. Blank = any.

## `requestedTo` (type: `string`):

Latest request date, YYYY-MM-DD. Blank = any.

## `recentDays` (type: `integer`):

Only requests filed in the last N days. Ignored when 'Requested date from' is set. 0 = off.

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

rows = service requests matching your filters (default). aggregate = one count row per group (see groupBy).

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

Which dimension to aggregate over (mode=aggregate). Blank = serviceType. Every group is returned - aggregate mode is not cut off by maxResults.

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

Cap the number of records pushed in rows mode (0 = default 50; up to 2,000 per run). Each record is metered individually, so there is no per-run charge cap. Aggregate mode returns every group.

## Actor input object example

```json
{
  "service": "",
  "serviceType": "",
  "agency": "",
  "address": "",
  "zip": "",
  "serviceCode": "",
  "statusNote": "",
  "status": "",
  "requestedFrom": "",
  "requestedTo": "",
  "recentDays": 0,
  "mode": "rows",
  "groupBy": "",
  "maxResults": 50
}
```

# Actor output Schema

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

Philly311 service requests - 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/philly-311").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/philly-311").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/philly-311 --silent --output-dataset

```

## MCP server setup

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

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/BwaBjApsVvda6k5lY/builds/Tk8Hhp3prXEMVqejN/openapi.json
