# Code Violation Property Leads: Distressed Houses & Owners (`nerolabs/code-violation-leads`) Actor

Properties just cited for code violations in NYC, LA, Chicago, SF, Austin, Seattle and Cincinnati, one row per property, scored 0 to 100 as distressed leads with open, hazardous and repeat violations, NYC owner. $0.01 each.

- **URL**: https://apify.com/nerolabs/code-violation-leads.md
- **Developed by:** [Adam Pearce](https://apify.com/nerolabs) (community)
- **Categories:** Lead generation, Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 scored distressed properties

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

## Code Violation Property Leads: Distressed Houses & Owners

Find **distressed properties** the week they are cited. This actor reads the official code violation feeds of 7 big US cities (New York City, Los Angeles, Chicago, San Francisco, Austin, Seattle, Cincinnati), rolls every violation up to **one row per property**, and scores each property **0 to 100 as a distressed property lead**: how many violations, how many are still open, how many are hazardous, signs like vacant, unsafe, foreclosure, fire damage or overgrown, and how often the city cited it in the last 12 months. In New York City it adds the **owner name**, units, year built and assessed value from the city's tax lot file.

Built for **real estate investors, wholesalers, house flippers and cash buyers** who mail or call owners of neglected properties, and for **repair contractors** (roofers, pest control, mold, plumbing, cleanouts, property managers) who sell the fix. You pay **$0.01 per property returned**, not per violation, so a building with 200 citations costs one cent.

### What you get for each property

- `leadScore` (0 to 100) and `leadReasons` in plain words ("12 violations in the window. All still open. 3 hazardous (top class). Repeat problem: 18 more violations in the 12 months before.")
- `distressSignals`: vacant, unsafe, foreclosure, fire_damage, demolition, vacate_order, overgrown, trash_debris, no_heat_water, pests, mold_leaks, roof, windows_doors, work_without_permit, lead_paint, rent_impairing, repeat_offender, short_term_rental
- `address`, `zip`, `parcelId` (NYC BBL, LA parcel, Austin parcel ID, SF block/lot), `latitude`, `longitude`
- `violationsInWindow`, `openViolations`, `hazardousViolations`, `seriousViolations`, `unitsCited`, `violationsLast12Months`, `firstViolationDate`, `lastViolationDate`
- `unpaidPenaltiesUsd` and `citedParty` (NYC DOB/ECB: the person or company the city fined and what is still owed)
- NYC only: `ownerName`, `residentialUnits`, `yearBuilt`, `buildingClass`, `assessedValueUsd`
- `topViolations`: up to 5 of the worst, each with date, open or closed, hazard class, category, the city's own wording and record ID
- `sources`: which city feeds the property appeared in

#### Sample row (shortened)

```json
{
  "leadScore": 85,
  "leadReasons": "45 violations in the window. All still open. 2 hazardous (top class). Distress signs: mold leaks, unsafe, no heat water, windows doors, pests, vacant. Cited in the last 7 days.",
  "distressSignals": ["mold_leaks", "unsafe", "no_heat_water", "windows_doors", "pests", "vacant"],
  "city": "Chicago",
  "state": "IL",
  "address": "8105 S PAULINA ST",
  "violationsInWindow": 45,
  "openViolations": 45,
  "hazardousViolations": 2,
  "violationsLast12Months": 45,
  "lastViolationDate": "2026-10-30",
  "topViolations": [{ "date": "2026-10-30", "open": true, "hazard": "high", "category": "CONSERVATION", "description": "STOP ODORS RPR DFT SEWAGE SYS : OPEN SEWER PIPING THROUGHOUT BASEMENT. DANGEROUS AND HAZARDOUS." }]
}
```

### How to use it

1. Pick your **cities** (or leave all 7) and **days to look back** (7 for a weekly feed, 30 for a first list).
2. Narrow it: `minViolations` (3+ finds the worst-kept buildings), `openOnly`, `hazardousOnly`, `distressSignals` (for example only `vacant`, `foreclosure`, `fire_damage`), `zipCodes`, `keywords` such as `roof` or `mold`.
3. Investors in NYC: set `maxResidentialUnits` to 4 to keep 1 to 4 family houses and skip big apartment blocks.
4. Already working some addresses? Paste them in `excludeAddresses` or link a CSV or Google Sheet in `excludeListUrl`; they are never returned or charged.
5. Turn on **monitor mode** and schedule the actor daily or weekly: each run returns only properties you have not seen before, with an optional webhook to your CRM, Zapier, Make or n8n.

Default run (all 7 cities, 30 days, 25 properties) finishes in about 30 seconds.

### Pricing

**$0.01 per property returned** (Bronze $0.009, Silver $0.008, Gold and up $0.007), plus Apify's tiny start fee. Properties dropped by your filters, your skip list or monitor mode are never charged. The 12 month repeat count and the NYC owner join are free. Example: 5,000 scored properties a month across 7 cities = $50 a month.

### Cities, sources and limits

| City | Feed (official open data portal) | Hazard class | Owner name | Notes |
|---|---|---|---|---|
| New York City | HPD Housing Maintenance Code Violations + DOB/ECB Violations + PLUTO tax lots | yes (HPD A/B/C, DOB class 1 to 3) | yes (PLUTO) | unpaid ECB penalties, vacate orders |
| Los Angeles | LADBS Code Enforcement Cases (open) | case type | no | foreclosure registry (FRP) and vacant building (VEIP) cases flagged |
| Chicago | Building Violations | text | no | open vs complied |
| San Francisco | DBI Notices of Violation | unsafe building flag | no | work without permit flag |
| Austin | Code Complaint Cases | structure condition | no | repeat offender and short-term rental flags |
| Seattle | Code Complaints and Violations | emergency and vacate orders | no | noise, tree and construction-hours complaints are skipped |
| Cincinnati | Code Enforcement (city and Hamilton County) | barricade and demolition | no | abandoned vehicle cases skipped |

- Every feed is the city's own published open data; nothing is scraped. Each run checks every feed's newest record first and skips (and flags) any feed more than 14 days old.
- NYC publishes far more violations than the other cities (about 2,000 a day), so up to 60,000 records per feed per run are read, newest first, and each city gets a fair share of your `maxLeads`.
- The 12 month count is asked from each city for the properties returned, by parcel, BBL or address as that city publishes it; an address written two ways can count as two.
- Names are public record as published by each city. Use them for business outreach only and follow the rules where you market (TCPA for calls and texts, CAN-SPAM for email, do-not-call and do-not-mail lists, and any state rules on contacting owners in distress or foreclosure).
- City of Chicago: "This site provides applications using data that has been modified for use from its original source, www.cityofchicago.org, the official website of the City of Chicago. The City of Chicago makes no claims as to the content, accuracy, timeliness, or completeness of any of the data provided at this site. The data provided at this site is subject to change at any time. It is understood that the data provided at this site is being used at one's own risk."

More cities are added only when their feed is checked fresh. Ask in the Issues tab for yours.

### For AI agents

Call it through the Apify MCP server (`nerolabs/code-violation-leads`). Inputs are plain fields (`cities`, `withinDays`, `minViolations`, `openOnly`, `hazardousOnly`, `distressSignals`, `zipCodes`, `maxResidentialUnits`, `maxLeads`, `monitorMode`); output is one JSON row per property with the fields above, and a `SUMMARY` record in the default key-value store (each feed's newest record date, counts per city and per distress sign, warnings). Charging is one `scored-property` event per row.

### Related Nero Labs actors

- [New Building Permit Leads](https://apify.com/nerolabs/building-permit-leads): permits just issued in 7 cities, scored for contractors.
- [Google Sheets Export & Import](https://apify.com/nerolabs/google-sheets-export): send these leads straight into a Sheet.
- [Dataset Filter & Transform](https://apify.com/nerolabs/dataset-filter-transform): reshape the rows for your CRM or mail house.

# Actor input Schema

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

Which city code violation feeds to read: chicago, nyc, los_angeles, san_francisco, austin, seattle, cincinnati. Empty means all 7. Each comes from that city's official open data portal and is updated daily. NYC reads two feeds (HPD housing violations and DOB/ECB building violations) and adds the owner from the city tax lot file.

## `withinDays` (type: `integer`):

Violations issued in the last N days (1 to 90). 7 for a weekly alert, 30 for a first list.

## `minViolations` (type: `integer`):

Only properties cited this many times in the window. 3 or more finds the worst-kept buildings.

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

Skip properties whose violations in the window are all closed or complied.

## `hazardousOnly` (type: `boolean`):

Keep only properties with a top-class violation (NYC HPD class C, NYC DOB class 1, unsafe building flags, emergency or vacate orders, LA vacant or nuisance cases, Cincinnati barricade or demolition).

## `distressSignals` (type: `array`):

Keep only properties showing at least one of these signs, read from the violation text and city flags: vacant, unsafe, fire_damage, foreclosure, demolition, vacate_order, overgrown, trash_debris, no_heat_water, pests, mold_leaks, roof, windows_doors, work_without_permit, lead_paint, rent_impairing, repeat_offender, short_term_rental. Empty keeps all.

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

Only properties in these 5 digit ZIP codes. Empty means the whole city.

## `keywords` (type: `array`):

Keep properties whose violation text contains any of these words, for example 'roof', 'boiler', 'vacant'.

## `excludeKeywords` (type: `array`):

Drop properties whose violation text contains any of these words, for example 'elevator', 'sign'.

## `maxResidentialUnits` (type: `integer`):

NYC only: skip buildings with more homes than this, from the city tax lot file. 4 keeps 1 to 4 family houses for investors. Other cities do not publish units.

## `includeHistory` (type: `boolean`):

For each property returned, ask the city how many violations it had in the last 365 days. Repeat problems raise the lead score. No extra charge.

## `includeNycOwner` (type: `boolean`):

NYC only: owner name, units, year built, building class and assessed value from the city tax lot file (PLUTO). No extra charge.

## `excludeAddresses` (type: `array`):

Addresses or parcel numbers (NYC BBL, Austin parcel ID, LA parcel, SF block/lot) already in your CRM. They are never returned or charged.

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

A CSV or Google Sheet link whose first column holds addresses or parcel numbers to skip. Sheets must be shared as 'Anyone with the link can view'.

## `minLeadScore` (type: `integer`):

Only properties scoring at least this (0 to 100). 50 or more is a strong distressed lead.

## `maxLeads` (type: `integer`):

Most properties to return, best scored first. You pay only for properties returned.

## `monitorMode` (type: `boolean`):

Remember properties already returned for this watch name and return only new ones. Schedule it daily or weekly for a fresh lead feed.

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

Name for this monitor's memory, so different searches do not share one list.

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

Optional. POSTs the run summary as JSON when the run finishes (in monitor mode only when there are new properties).

## Actor input object example

```json
{
  "cities": [
    "chicago",
    "nyc",
    "los_angeles",
    "san_francisco",
    "austin",
    "seattle",
    "cincinnati"
  ],
  "withinDays": 30,
  "minViolations": 1,
  "openOnly": false,
  "hazardousOnly": false,
  "includeHistory": true,
  "includeNycOwner": true,
  "minLeadScore": 0,
  "maxLeads": 25,
  "monitorMode": false,
  "watchName": "default"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "cities": [
        "chicago",
        "nyc",
        "los_angeles",
        "san_francisco",
        "austin",
        "seattle",
        "cincinnati"
    ],
    "withinDays": 30,
    "maxLeads": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("nerolabs/code-violation-leads").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 = {
    "cities": [
        "chicago",
        "nyc",
        "los_angeles",
        "san_francisco",
        "austin",
        "seattle",
        "cincinnati",
    ],
    "withinDays": 30,
    "maxLeads": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("nerolabs/code-violation-leads").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 '{
  "cities": [
    "chicago",
    "nyc",
    "los_angeles",
    "san_francisco",
    "austin",
    "seattle",
    "cincinnati"
  ],
  "withinDays": 30,
  "maxLeads": 25
}' |
apify call nerolabs/code-violation-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nerolabs/code-violation-leads"
        }
    }
}
```

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/d4aTaudJ9TGc1Nhd9/builds/PRPvjsgRu6i1PUhPQ/openapi.json
