# Detroit BSEED Permits, Inspections & Blight Tickets (`j0401/detroit-bseed`) Actor

Fifteen Detroit BSEED datasets in one actor: permits, inspections, rental registrations, compliance certificates, business licences and 909k blight tickets. Filter by date, ZIP, council district, parcel, address, type or status; aggregate by the same dimensions.

- **URL**: https://apify.com/j0401/detroit-bseed.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 detroit bseed 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

## Detroit BSEED Permits, Inspections & Blight Tickets

Fifteen public datasets from Detroit's Buildings, Safety Engineering and Environmental Department (BSEED) in one actor - **1.31 million records** covering permits, inspections, rental registrations, compliance certificates, business licences and blight enforcement.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold**

Pay only for the records you receive. A 50-record search costs $0.0025 at the entry tier.

### Datasets

| `corpus` | Records | Date field |
|---|---|---|
| `blight-tickets` | 909,816 | ticket issued |
| `trades-permits` | 121,233 | issued |
| `building-permits` | 47,741 | issued |
| `rental-registrations` | 44,510 | issued |
| `demolition-inspections` | 40,146 | inspection |
| `plan-reviews` | 39,870 | submitted |
| `commercial-compliance` | 27,776 | latest inspection |
| `rental-compliance` | 23,341 | current registration issued |
| `demolition-permits` | 16,281 | issued |
| `presale-inspections` | 15,597 | inspection |
| `residential-compliance` | 12,609 | issued |
| `commercial-certs` | 2,948 | issued |
| `occupancy-certificates` | 1,960 | issued |
| `vacant-property` | 1,536 | issued |
| `business-licenses` | 1,475 | expiration |

Counts measured 2026-10-21.

### Search

```json
{
  "corpus": "blight-tickets",
  "dateFrom": "2025-01-01",
  "dateTo": "2025-12-31",
  "zip": "48207",
  "maxResults": 500
}
```

Filters: `dateFrom` / `dateTo` (the dataset's own date field), `zip`, `councilDistrict`, `neighborhood`, `parcelId`, `address` (case-insensitive substring), `type` and `status`. Filters that a dataset does not carry are rejected with a message naming the field, never silently ignored.

Where the dataset carries them, records include the property address, parcel, neighbourhood, council district, ZIP, coordinates, the party of record and the type/status. A `details` object carries the remaining non-contact source columns for that dataset.

### Aggregate

```json
{
  "corpus": "building-permits",
  "dateFrom": "2025-01-01",
  "mode": "aggregate",
  "groupBy": "zip"
}
```

One row per group with `groupCount` and `totalMatched`. Dimensions: `zip`, `councilDistrict`, `neighborhood`, `type`, `status`, `parcelId`. Rollups above 5,000 groups fail loudly.

### Data notes

- **Impossible dates are flagged, not dropped.** The city source contains a small number of impossible event dates (blight tickets range from 1824 to 8535). Those records are delivered with `dateSuspect: true` so a date filter or downstream model can decide what to do with them.
- **Public records only.** Personal contact details and owner mailing addresses are not emitted. Property-owner names and contractor names of record are public and stay.
- Freshness is checked against each layer's last data edit before any record is delivered; a stale layer fails the run instead of returning quietly old data.
- `bseed_lead_clearance_reports` is frozen at 2022-01-07 at the source and is not included.

# Actor input Schema

## `corpus` (type: `string`):

Which BSEED layer to read. Each has its own date field, filters and record shape.

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

search = matching records. aggregate = one row per group. Leave blank: aggregate when groupBy is set, otherwise search.

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

Dimension for mode=aggregate. Defaults to zip.

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

Records to deliver in search mode (default 50, max 25000).

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

Start of the record's own date field, YYYY-MM-DD (issued / inspection / submitted / expiration, depending on the dataset).

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

End date, YYYY-MM-DD.

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

Five-digit Detroit ZIP, e.g. "48207".

## `councilDistrict` (type: `string`):

Detroit council district, e.g. "5".

## `neighborhood` (type: `string`):

Detroit neighbourhood name.

## `parcelId` (type: `string`):

Detroit parcel number.

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

Case-insensitive substring of the property address, e.g. "Woodward".

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

Permit / registration / inspection / licence type or plan-review task. Exact match; not every dataset has a type.

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

Inspection result, plan-review status, compliance indicator or ticket disposition. Exact match; not every dataset has a status.

## Actor input object example

```json
{
  "corpus": "trades-permits",
  "maxResults": 50
}
```

# Actor output Schema

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

Detroit BSEED records or aggregate rows - 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/detroit-bseed").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/detroit-bseed").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/detroit-bseed --silent --output-dataset

```

## MCP server setup

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

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/3LDfuNDFgxZrrbxP4/builds/CMoAx2FY2AK8vhXbR/openapi.json
