# NYC DOB Permits, Violations & Complaints Scraper (`talcoe/nyc-open-data-dob`) Actor

Pulls NYC Department of Buildings permits, violations, job filings and complaints, filterable by borough, block or contractor, priced per result.

- **URL**: https://apify.com/talcoe/nyc-open-data-dob.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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.

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

### What does NYC DOB Permits, Violations & Complaints Scraper do?

It pulls building permits, DOB violations, job application filings and complaints from the NYC Department of Buildings, filtered by borough, tax block or contractor business name. Every record carries the address, block, lot, BIN, status and date up front, plus dataset specific fields like job type, business name, violation type or complaint category. Pricing is per result returned.

### Data source

Public JSON APIs on the NYC Open Data Socrata portal (data.cityofnewyork.us): DOB NOW Approved Permits, DOB Violations, DOB NOW Job Application Filings and DOB Complaints Received, updated by the city on an ongoing basis, no login required.

### Why use it?

- Lead generation: find recently permitted construction jobs and the contractors filing them, by borough or block.
- Due diligence: check open violations and complaints on a building before a purchase or lease.
- Compliance monitoring: track a contractor's active permits and violation history across boroughs.
- Replaces manually paging through the NYC Building Information System or Socrata's raw dataset browser.

### How to use it

1. Open the Actor and pick a record type: permits, violations, job filings or complaints.
2. Set a borough, tax block or contractor name to narrow the results, and a max results cap.
3. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
4. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new records automatically.

### Input

| Field | Description |
|---|---|
| `recordType` | Which dataset to pull: `permits`, `violations`, `jobFilings` or `complaints`. Default `permits`. |
| `borough` | Manhattan, Bronx, Brooklyn, Queens or Staten Island. Leave blank for all boroughs. |
| `block` | Tax block number. Matches with or without leading zeros. Not used for complaints. |
| `contractorName` | Filter by applicant, filing representative or owner business name. Permits and job filings only. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs. |

Example input:

```json
{
    "recordType": "permits",
    "borough": "Manhattan",
    "block": "",
    "contractorName": "",
    "maxResults": 50
}
```

### Output

Every record has a `recordType`, `id` and the fields for that dataset. A permit record looks like:

```json
{
    "id": "permit:M01248246-I1:M01248246-I1-EW-SP",
    "recordType": "permit",
    "borough": "Manhattan",
    "address": "12 EAST 52 STREET",
    "block": "1287",
    "lot": "62",
    "bin": "1035477",
    "status": "Signed-off",
    "date": "2025-09-19T00:00:00",
    "jobType": "Sprinklers",
    "businessName": "STALWART PLUMBING CORP",
    "ownerBusinessName": "PR",
    "jobDescription": "REMOVAL OF SPRINKLER HEADS AND RELATED PIPING AS SHOWN ON DRAWINGS. NO CHANGE TO USE, EGRESS OR OCCUANCY.",
    "filingReason": "Initial Permit",
    "estimatedJobCosts": 20000,
    "expirationDate": "2026-06-06T00:00:00",
    "jobFilingNumber": "M01248246-I1",
    "workPermit": "M01248246-I1-EW-SP",
    "trackingNumber": "912522473",
    "latitude": 40.759481,
    "longitude": -73.975581,
    "scrapedAt": "2026-09-30T09:01:39.959Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key, safe for deduplication between runs |
| `recordType` | `permit`, `violation`, `jobFiling` or `complaint` |
| `borough` | Manhattan, Bronx, Brooklyn, Queens or Staten Island |
| `address` | House number and street |
| `block` / `lot` / `bin` | NYC tax block, lot and building identification number |
| `status` | Permit, violation, filing or complaint status as published by DOB |
| `date` | Main date for the record, in ISO format |
| `businessName` | Applicant, filing representative or contractor firm (permits and job filings) |
| `violationType`, `complaintCategory`, ... | Extra fields specific to the chosen record type |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Older BIS era permits are not included; permits come from the current DOB NOW system.
- Some fields are occasionally blank or inconsistent in the source data (DOB is the publisher, not this Actor).
- `block` filtering is not available for the complaints dataset, which the city does not publish with a block field.
- `contractorName` filtering only applies where DOB publishes a business name (permits and job filings).

### FAQ

**Is this legal?** The Actor reads NYC Open Data's public Socrata API, the same data anyone can browse or download for free without a login, and stores only business information the city publishes for that purpose. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

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

Which NYC Department of Buildings dataset to pull records from.

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

Limit results to one NYC borough. Leave blank for all boroughs.

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

Filter by tax block number, matches with or without leading zeros. Not used for complaints, which do not carry a block field.

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

Filter by applicant, filing representative or owner business name. Supported for permits and job filings only.

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

Hard stop for the run. You are billed per result, so this caps the cost.

## `proxyConfiguration` (type: `object`):

Apify proxy is recommended for larger runs.

## Actor input object example

```json
{
  "recordType": "permits",
  "borough": "",
  "block": "",
  "contractorName": "",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "recordType": "permits",
    "borough": "",
    "block": "",
    "contractorName": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/nyc-open-data-dob").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 = {
    "recordType": "permits",
    "borough": "",
    "block": "",
    "contractorName": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/nyc-open-data-dob").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 '{
  "recordType": "permits",
  "borough": "",
  "block": "",
  "contractorName": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/nyc-open-data-dob --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talcoe/nyc-open-data-dob"
        }
    }
}
```

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/lnlMn3yZsa7e6bcVl/builds/4uUR8eXY8UYLIcv3R/openapi.json
