# Code Violations & Distressed Property Leads (`automatadesk/code-violations-distressed-properties`) Actor

Distressed property leads from official open data: Chicago building violations, NYC HPD housing violations, Detroit blight tickets with owner name and mailing address. Filter by date, keyword, open/unpaid.

- **URL**: https://apify.com/automatadesk/code-violations-distressed-properties.md
- **Developed by:** [Automata Desk](https://apify.com/automatadesk) (community)
- **Categories:** Real estate, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 violation records

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

## Code Violations & Distressed Property Leads (Chicago, NYC, Detroit)

Find **distressed properties** from official city enforcement data, normalized into one table:

- **Chicago:** Department of Buildings violations (open violations, inspector comments)
- **New York City:** HPD housing maintenance code violations (class A/B/C, open status, BBL)
- **Detroit:** blight tickets (ordinance, balance due, **property owner name and mailing address**, parcel ID)

All data comes from the cities' official open-data portals (data.cityofchicago.org, data.cityofnewyork.us, City of Detroit ArcGIS open data).

### Who uses this

- **Real estate investors and wholesalers:** properties with open violations or unpaid blight fines are classic motivated-seller signals.
- **Contractors** (masonry, roofing, plumbing, heating, demolition): owners who must fix cited problems.
- **Property managers and lenders:** monitor portfolio or collateral addresses.
- **Journalists and researchers:** housing-conditions analysis.

### Input

| Field | Example | Notes |
|---|---|---|
| cities | `["chicago","nyc","detroit"]` | |
| since | `2026-09-01` | Default: last 30 days |
| openOnly | `true` | Open violations / balance due |
| keyword | `VACANT` | Matches the violation description |
| nycClass | `["C"]` | NYC immediately hazardous |
| maxResults | `300` | Split across cities |

### Output (normalized)

```json
{"sourceCity":"detroit","violationId":"26078724DAH","date":"2026-10-16","address":"15845 BENTLER","zip":"48223","description":"Failure to obtain certificate of registration for rental property","status":"NO PAYMENT APPLIED","fineOrBalance":80.0,"ownerName":"GODDARD PROPERTY INVESTMENTS LLC","ownerMailing":"22511 TELEGRAPH, SOUTHFIELD, MI","parcelId":"22110895."}
```

Tip: pair Chicago results with our **Cook County Property Owner Finder** to get owner mailing addresses.

### Pricing

Pay per event: **$0.003 per violation record ($3 per 1,000)**, plus a tiny start fee.

### Notes

Data appears **as published by each city** and may lag, be corrected, or contain errors. A violation is not proof of distress. Verify before acting, and follow fair-housing and marketing laws (TCPA, CAN-SPAM). Not legal advice.

# Actor input Schema

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

Supported: chicago, nyc (HPD housing violations), detroit (blight tickets)

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

Default: last 30 days

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

Chicago & NYC: open violations. Detroit: balance due > 0

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

e.g. VACANT, ROOF, RENTAL, HEAT

## `nycClass` (type: `array`):

A (non-hazardous), B (hazardous), C (immediately hazardous), I (orders)

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

Total across cities (split evenly)

## Actor input object example

```json
{
  "cities": [
    "chicago",
    "nyc",
    "detroit"
  ],
  "openOnly": true,
  "maxResults": 100
}
```

# 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 = {
    "cities": [
        "chicago",
        "nyc",
        "detroit"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatadesk/code-violations-distressed-properties").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",
        "detroit",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("automatadesk/code-violations-distressed-properties").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",
    "detroit"
  ]
}' |
apify call automatadesk/code-violations-distressed-properties --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatadesk/code-violations-distressed-properties"
        }
    }
}
```

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/YL7X3aRMe2ao8mQ4z/builds/9TilRW8ywuTEF3fCX/openapi.json
