# NYC DOB & HPD Violations, Permits & Property Data Scraper (`jungle_synthesizer/nyc-dob-hpd-violations-permits-property-scraper`) Actor

Scrape NYC building violations, permits, and property data from 7 open city datasets (DOB violations, ECB violations, HPD housing violations, permits, job filings, PLUTO property profile, LL84 energy benchmarking) joined on BIN/BBL into a single building-risk profile per address.

- **URL**: https://apify.com/jungle\_synthesizer/nyc-dob-hpd-violations-permits-property-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Real estate, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## NYC DOB & HPD Violations, Permits & Property Data Scraper

Scrape NYC building violations, permits, and property data from 7 NYC Open Data Socrata datasets, joined on BIN/BBL into a single per-building risk profile.

### What This Scraper Does

This actor queries the NYC Open Data portal (data.cityofnewyork.us) across 7 Socrata SODA v2 endpoints and merges them on NYC Building Identification Number (BIN) and Borough-Block-Lot (BBL) to produce a comprehensive building risk profile per address. No rendering or authentication required — pure public JSON API.

#### Datasets Covered

| Dataset | Endpoint | What It Contains |
|---------|----------|-----------------|
| DOB Violations | 3h2n-5cm9 | Active/dismissed building violations from the NYC Department of Buildings |
| ECB Violations | 6bgk-3dad | Environmental Control Board violations with severity and penalty amounts |
| HPD Housing Violations | wvxf-dwi5 | Housing maintenance violations (class A/B/C) from Housing Preservation & Development |
| DOB Permit Issuance | ipu4-2q9a | Construction and alteration permits with contractor and owner details |
| DOB Job Application Filings | ic3t-wcy2 | Job application filings with cost estimates and work descriptions |
| PLUTO Property Tax Lots | 64uk-42ks | Property ownership, year built, floor count, assessed value |
| LL84 Energy Benchmarking | usc3-8zwd | Annual energy benchmarking data (site/source EUI, ENERGY STAR score, GHG emissions) |

### Use Cases

- **PropTech / Lender due diligence**: Join violations + permits + ownership into a single building risk profile
- **Real estate underwriting**: Identify buildings with active hazardous violations or outstanding ECB penalties
- **Contractor lead generation**: Find buildings with expired permits or open violations needing remediation
- **ESG analysis**: Pull LL84 energy benchmarking data alongside property profiles
- **Compliance monitoring**: Track building violation status changes over time

### Input Configuration

| Field | Type | Description |
|-------|------|-------------|
| `maxItems` | integer | Maximum buildings to return (default: 10) |
| `binList` | array | Explicit BIN list for direct lookup (overrides date-range mode) |
| `bblList` | array | Explicit BBL list — resolved to BINs via LL84 dataset |
| `dateFrom` | string | Start date for violation/permit filter, YYYY-MM-DD (date-range mode) |
| `dateTo` | string | End date for violation/permit filter, YYYY-MM-DD (optional, defaults to today) |
| `datasets` | array | Which datasets to include (leave empty for all 7) |
| `socrataAppToken` | string | Optional Socrata app token for higher rate limits |

### Operating Modes

**BIN lookup mode** (recommended for targeted queries): Provide `binList` with one or more BIN numbers. The actor fetches all matching records across all requested datasets for those BINs.

**BBL lookup mode**: Provide `bblList` with 10-digit Borough-Block-Lot strings. The actor resolves BINs via the LL84 dataset then fetches all datasets.

**Date-range mode** (when neither binList nor bblList are provided): The actor seeds from DOB violations filtered by date range, collects unique BINs, then fans out to all requested datasets. Use `maxItems` to cap the number of buildings returned.

### Output Schema

Each record represents one unique building (BIN). Fields from all datasets are flattened onto the record. When multiple violations or permits exist for a building, only the most recent row is included per dataset (plus composite counts).

**Key composite fields:**
- `active_violation_count` — Total open violations across DOB, ECB, and HPD
- `open_permit_count` — Active/issued permits
- `total_penalties_outstanding` — Sum of ECB penalty amounts
- `building_risk_score` — Composite 0–100 score (weighted by violation count, severity, and penalties)

### Rate Limits

The NYC Socrata API allows 1,000 rows/query anonymously. For large runs, provide a Socrata app token (`socrataAppToken`) via the free registration at [data.cityofnewyork.us](https://data.cityofnewyork.us/login). The actor uses a 300ms delay between requests to respect the crawl-delay in robots.txt.

### Example Output

```json
{
  "bin": "1007611",
  "bbl": "1004990020",
  "boro": "1",
  "house_number": "94",
  "street": "PRINCE STREET",
  "zip": "10012",
  "lat": 40.7245729,
  "lng": -73.9987806,
  "dob_violation_number": "V083183LANDMK84-0109",
  "dob_violation_type": "LANDMK-LANDMARK",
  "dob_violation_category": "V-DOB VIOLATION - ACTIVE",
  "dob_violation_issue_date": "1983-08-31",
  "pluto_owner": "94 PRINCE STREET CORP",
  "pluto_year_built": 1858,
  "pluto_num_floors": 5,
  "pluto_units_total": 3,
  "pluto_building_class": "K4",
  "pluto_assessed_value": 1051200,
  "active_violation_count": 4,
  "open_permit_count": 0,
  "total_penalties_outstanding": 0,
  "building_risk_score": 12
}
````

# Actor input Schema

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

Please describe how you plan to use the data extracted by this crawler.

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

Provide any feedback or suggestions for improvements.

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

Provide your email address so we can get in touch with you.

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

Maximum number of building records to return. Each record is one unique BIN/BBL with all joined dataset rows attached.

## `binList` (type: `array`):

List of NYC Building Identification Numbers (BINs) to look up. Leave empty to use date-range mode.

## `bblList` (type: `array`):

List of Borough-Block-Lot identifiers (BBLs) to look up. Leave empty to use date-range mode.

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

Filter violations/permits issued on or after this date (YYYY-MM-DD). Used in date-range mode when binList/bblList are empty.

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

Filter violations/permits issued on or before this date (YYYY-MM-DD). Defaults to today when not set.

## `datasets` (type: `array`):

Which NYC datasets to include. Valid values are dob\_violations, ecb\_violations, hpd\_violations, permits, job\_filings, pluto, ll84. Leave empty to include all.

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

Optional Socrata application token for higher rate limits (>1000 requests/hour). Register free at data.cityofnewyork.us.

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "binList": [],
  "bblList": [],
  "dateFrom": "2025-01-01",
  "datasets": []
}
```

# 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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "binList": [],
    "bblList": [],
    "dateFrom": "2025-01-01",
    "dateTo": "",
    "datasets": [],
    "socrataAppToken": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/nyc-dob-hpd-violations-permits-property-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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "binList": [],
    "bblList": [],
    "dateFrom": "2025-01-01",
    "dateTo": "",
    "datasets": [],
    "socrataAppToken": "",
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/nyc-dob-hpd-violations-permits-property-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "binList": [],
  "bblList": [],
  "dateFrom": "2025-01-01",
  "dateTo": "",
  "datasets": [],
  "socrataAppToken": ""
}' |
apify call jungle_synthesizer/nyc-dob-hpd-violations-permits-property-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/nyc-dob-hpd-violations-permits-property-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "NYC DOB & HPD Violations, Permits & Property Data Scraper",
        "description": "Scrape NYC building violations, permits, and property data from 7 open city datasets (DOB violations, ECB violations, HPD housing violations, permits, job filings, PLUTO property profile, LL84 energy benchmarking) joined on BIN/BBL into a single building-risk profile per address.",
        "version": "0.1",
        "x-build-id": "PsWGoWncuWQSuR3TH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jungle_synthesizer~nyc-dob-hpd-violations-permits-property-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jungle_synthesizer-nyc-dob-hpd-violations-permits-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~nyc-dob-hpd-violations-permits-property-scraper/runs": {
            "post": {
                "operationId": "runs-sync-jungle_synthesizer-nyc-dob-hpd-violations-permits-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~nyc-dob-hpd-violations-permits-property-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-jungle_synthesizer-nyc-dob-hpd-violations-permits-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "maxItems"
                ],
                "properties": {
                    "sp_intended_usage": {
                        "title": "What is the intended usage of this data?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Please describe how you plan to use the data extracted by this crawler."
                    },
                    "sp_improvement_suggestions": {
                        "title": "How can we improve this crawler for you?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide any feedback or suggestions for improvements."
                    },
                    "sp_contact": {
                        "title": "Contact Email",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide your email address so we can get in touch with you."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "type": "integer",
                        "description": "Maximum number of building records to return. Each record is one unique BIN/BBL with all joined dataset rows attached.",
                        "default": 10
                    },
                    "binList": {
                        "title": "BIN List",
                        "type": "array",
                        "description": "List of NYC Building Identification Numbers (BINs) to look up. Leave empty to use date-range mode.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "bblList": {
                        "title": "BBL List",
                        "type": "array",
                        "description": "List of Borough-Block-Lot identifiers (BBLs) to look up. Leave empty to use date-range mode.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dateFrom": {
                        "title": "Date From",
                        "type": "string",
                        "description": "Filter violations/permits issued on or after this date (YYYY-MM-DD). Used in date-range mode when binList/bblList are empty."
                    },
                    "dateTo": {
                        "title": "Date To",
                        "type": "string",
                        "description": "Filter violations/permits issued on or before this date (YYYY-MM-DD). Defaults to today when not set."
                    },
                    "datasets": {
                        "title": "Datasets",
                        "type": "array",
                        "description": "Which NYC datasets to include. Valid values are dob_violations, ecb_violations, hpd_violations, permits, job_filings, pluto, ll84. Leave empty to include all.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "socrataAppToken": {
                        "title": "Socrata App Token",
                        "type": "string",
                        "description": "Optional Socrata application token for higher rate limits (>1000 requests/hour). Register free at data.cityofnewyork.us."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
