# Property Violations Scraper: Distressed Buildings (`parselab/us-property-violations-distress-signals-scraper`) Actor

Scrape building, housing and code violations from Chicago, New York, San Francisco and Austin in one format. Get date, category, status, severity, address and coordinates, or rank properties by open violations to find distressed buildings. Export to CSV or Excel.

- **URL**: https://apify.com/parselab/us-property-violations-distress-signals-scraper.md
- **Developed by:** [ParseLab](https://apify.com/parselab) (community)
- **Categories:** Real estate, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $14.25 / 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?

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

## Property Violations Scraper: Code Violations and Distressed Buildings in Four US Cities

This property violations scraper reads the building, housing and code violations that Chicago, New York City, San Francisco and Austin publish as open data, and gives you one clean table in one format. Each row is a violation with the date, the category, the description, the status, whether it is still open, the severity (New York classes A, B and C), the address, the ZIP code, the neighborhood, the property id and the coordinates.

The properties mode adds what the cities do not give: it groups violations by address and ranks the buildings with the most open violations, with a distress score, the number of class B and class C violations in New York, the units affected and the most common categories. That is the list that landlords, investors, lenders, insurers, contractors and tenant groups look for.

The summary mode counts violations by category, status, severity, neighborhood, month, day or ZIP code.

### What can you do with this property violations scraper?

- Get the latest code violations of four cities in one format
- Find buildings with many open violations, ranked by a distress score
- Keep only open violations or only hazardous ones in New York (class B and C)
- Search the violation text for heat, mold, rodents, roof, stairs, fence or vacant
- Filter by street, ZIP code or neighborhood
- Count violations by category, neighborhood or month
- Find which categories grow in a place
- Export to CSV or Excel, or send new violations to your own tools

### What data can you extract?

| Mode | One row is | Highlights |
|---|---|---|
| Violations | One violation | City, violation id, date, category, code, description, status, open flag, severity and class (New York), rent impairing flag (New York), inspection result and department (Chicago), address, unit, ZIP code, neighborhood, property id, coordinates, link to the source dataset |
| Properties | One address | Rank, address, ZIP code, neighborhood, number of violations, open violations, open share, class B and class C violations (New York), units affected, distress score, top categories, first and last violation, coordinates |
| Summary | One group in one city | Group (category, status, severity, neighborhood, month, day or ZIP code), violations, share, open violations, open share, properties affected, top categories, top areas, first and last date |

### How to scrape property violations

1. Choose **Violations**, **Properties** or **Summary**.
2. Pick the cities and the period with **Days back** or exact dates.
3. Add filters: open only, severity, words in the violation, street or ZIP code.
4. Set **Max Items** and click **Start**.
5. Export the dataset as CSV, Excel or from the Apify console.

### Input example

```json
{
  "mode": "properties",
  "cities": ["nyc", "chicago"],
  "daysBack": 60,
  "openOnly": true,
  "minViolationsPerProperty": 3,
  "sampleSize": 30000,
  "maxItems": 100
}
```

### Property output example

```json
{
  "city": "Chicago",
  "address": "5600 S Wood St",
  "violations": 46,
  "openViolations": 46,
  "distressScore": 138,
  "topCategories": [{ "name": "Repair Exterior Wall", "count": 1 }]
}
```

### How much does it cost to scrape property violations?

You pay per result: $19 per 1,000 rows plus a tiny start fee. The free plan returns up to 10 rows per run. A property or summary row counts many violations, so those reports cost only a few cents.

### Tips for better results

- The properties mode counts the violations it reads, newest first, up to the number you set per city. New York has thousands per week, so raise the sample size for longer periods.
- The distress score is a simple rule: open violations count three, closed ones count one, and in New York class C adds five and class B adds two. It ranks buildings. It is not an appraisal.
- Status words differ by city. A violation is open when its status says open, active, pending or failed, and closed when it says complied, closed or resolved.
- New York classes are defined by the city: A is not hazardous, B is hazardous and C is immediately hazardous.
- Chicago does not publish ZIP codes or neighborhoods in this dataset. Use the address or coordinates.
- A building has one address but many units. New York rows list the apartment, and the properties mode counts the units affected.
- Names of owners, tenants, complainants and inspectors are not collected.
- Cities load new violations on their own schedule, usually daily.

### Who uses this data?

- **Real estate investors and lenders** find buildings in trouble.
- **Contractors and repair services** find buildings that must fix violations.
- **Insurers and brokers** measure the condition of a portfolio.
- **Tenant groups, lawyers and journalists** follow landlords and neighborhoods.
- **City researchers** measure enforcement over time.

### Automate and connect

Schedule the Actor every week for the last 7 days and send the properties list to Google Sheets, Slack, Zapier, Make or n8n, or trigger a webhook when a run ends.

### FAQ

**Do I need an account or a login?**
No. The Actor works without any login.

**Which cities are covered?**
Chicago, New York City, San Francisco and Austin.

**Can you add my city?**
Open an issue with the city and its violations dataset and it can be considered.

**Does it give owner names?**
No. Names of owners and people are not collected.

**How current is the data?**
The Actor reads the city portals when you run it. They are usually updated daily.

### Legal note

This Actor collects information that is publicly visible on the website. Check the source site's terms and your local rules before using the data. A violation is an official finding that may be corrected or disputed.

### Support

Missing a field or found a bug? Open an issue from the Actor page.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000.

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

Violations returns one row per code violation. Properties groups violations by address and ranks the properties with the most open violations. Summary counts violations by category, status, severity, neighborhood, month, day or ZIP code.

## `cities` (type: `array`):

Cities to read: chicago, nyc, sf, austin. Leave empty for Chicago, New York City and San Francisco.

## `daysBack` (type: `integer`):

Violations dated in the last number of days. Ignored when you set a start date.

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

Start date in the form 2026-09-30. It overrides the number of days.

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

End date in the form 2026-10-31.

## `openOnly` (type: `boolean`):

Keep violations that are still open, active or pending.

## `severities` (type: `array`):

New York City housing violations are class A (not hazardous), B (hazardous) or C (immediately hazardous). Type a, b or c, or a word such as hazardous.

## `searchTerms` (type: `array`):

Words searched in the violation text, for example heat, mold, rodents, fence, roof, stairs or vacant. Each word is an alternative.

## `streetContains` (type: `array`):

Part of the street name, for example Broadway or Market.

## `zipCodes` (type: `array`):

New York City, San Francisco and Austin. ZIP codes or their first digits.

## `minViolationsPerProperty` (type: `integer`):

Properties mode. Keep addresses with at least this many violations in the period. The default is 2.

## `minOpenViolationsPerProperty` (type: `integer`):

Properties mode. Keep addresses with at least this many open violations. The default is 1.

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

Summary mode. What to count.

## `sampleSize` (type: `integer`):

Properties and summary modes. How many violations to read in each city before counting, newest first.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "violations",
  "cities": [
    "chicago",
    "nyc",
    "sf"
  ],
  "daysBack": 30,
  "openOnly": false,
  "minViolationsPerProperty": 2,
  "minOpenViolationsPerProperty": 1,
  "groupBy": "category",
  "sampleSize": 20000
}
```

# Actor output Schema

## `overview` (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,
    "cities": [
        "chicago",
        "nyc",
        "sf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/us-property-violations-distress-signals-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,
    "cities": [
        "chicago",
        "nyc",
        "sf",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("parselab/us-property-violations-distress-signals-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,
  "cities": [
    "chicago",
    "nyc",
    "sf"
  ]
}' |
apify call parselab/us-property-violations-distress-signals-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parselab/us-property-violations-distress-signals-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/v689rWG5adSLgpeac/builds/3ScHZBb7UX16diKlv/openapi.json
