# US Code Violations – Distressed Property Leads (11 Cities) (`neobuster/us-code-violations`) Actor

Code and housing violations from official open data of 11 US cities (NYC, Chicago, SF, Seattle, Austin, Boston, Pittsburgh…): address, violation, status, date and case link. Filter by category (unsafe, vacant, no permit…), ZIP, open only.

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

## Pricing

from $2.00 / 1,000 code violations

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

## US Code Violations – Distressed Property Leads (11 Cities)

Get **code, building and housing violations** from the official open data of **11 US cities**: New York City (HPD and DOB), Chicago, San Francisco, Seattle, Austin, Boston, Pittsburgh, Cincinnati, New Orleans, Montgomery County (MD) and Cambridge (MA). Each record has the **property address**, violation type and description, status (open or closed), date and a link to the city's case page, in one format for every city. **$2 per 1,000 violations.**

### What you get

- **Distressed-property leads for investors and wholesalers:** properties with unsafe-building, vacant-building, trash and weeds, or no-heat violations, by city and ZIP.
- **Leads for contractors:** roofs, siding, windows, electrical, plumbing or pest violations that the owner must fix.
- **Property and tenant research:** every open violation at an address before you buy or rent.
- **Absentee-owner signal (Boston):** the violation's mailing address, often different from the property.
- **Daily monitoring:** schedule `withinDays: 1` or `2` to get each day's new violations.

### Cities and sources

| City | Official dataset | Status | License |
|---|---|---|---|
| New York City | [HPD Housing Maintenance Code Violations](https://data.cityofnewyork.us/d/wvxf-dwi5), [DOB Violations](https://data.cityofnewyork.us/d/3h2n-5cm9) | Open / closed | NYC Open Data Law |
| Chicago | [Building Violations](https://data.cityofchicago.org/d/22u3-xenr) | Open / complied | City of Chicago Data Terms of Use |
| San Francisco | [DBI Notices of Violation](https://data.sfgov.org/d/nbtm-fbw5) | Active / not active | PDDL |
| Seattle | [Code Complaints and Violations](https://data.seattle.gov/d/ez4a-iug7) | Case status | Public Domain |
| Austin | [Code Complaint Cases](https://data.austintexas.gov/d/6wtj-zbtb) | Active / pending / closed | Public Domain |
| Boston | [Building and Property Violations](https://data.boston.gov/dataset/building-and-property-violations1) | Open / closed, mailing address | PDDL |
| Pittsburgh | [PLI Violations](https://data.wprdc.org/dataset/pittsburgh-pli-violations-report) | Case status (published about a month after inspection) | CC0 |
| Cincinnati | [Code Enforcement](https://data.cincinnati-oh.gov/d/cncm-znd6) | Open / closed | Public Domain |
| New Orleans | [Code Enforcement All Violations](https://data.nola.gov/d/3ehi-je3s) | Not published | CC0 |
| Montgomery County, MD | [Housing Code Violations](https://data.montgomerycountymd.gov/d/k9nj-z35d) | Open / closed | Public Domain |
| Cambridge, MA | [Housing Code Violations](https://data.cambridgema.gov/d/f8su-kv88) | Cited / corrected | PDDL |

Records the cities mark as unfounded, duplicate or voided are left out.

### Sample output

```json
{
  "id": "BOS-V927543-105.1",
  "city": "BOS",
  "cityName": "Boston, MA",
  "caseNumber": "V927543",
  "violationDate": "2026-11-19",
  "recordType": "Building and property violation",
  "violationType": "Failure to Obtain Permit",
  "codeSection": "105.1",
  "categories": ["work-without-permit"],
  "status": "Open",
  "isOpen": true,
  "address": "343 River ST",
  "addressCity": "Mattapan",
  "zip": "02126",
  "source": "City of Boston Building and Property Violations"
}
```

All fields: `id`, `city`, `cityName`, `state`, `caseNumber`, `violationDate`, `recordType`, `violationType`, `description`, `codeSection`, `categories`, `status`, `isOpen`, `address`, `unit`, `addressCity`, `zip`, `latitude`, `longitude`, `parcelId`, `mailingAddress`, `caseUrl`, `source`, `sourceUrl`.

### How to use

1. Pick **cities** (or leave empty for all) and the period (default: last 30 days).
2. Optionally choose **categories** (unsafe / structural, vacant, work without permit, trash and weeds, pests, no heat, electrical, plumbing, fire safety, roof and exterior, interior, zoning), **ZIP codes**, a **keyword**, or **Only open violations**.
3. Click **Start**, then download the results as CSV, JSON or Excel from the **Storage** tab.

```json
{ "cities": ["CHI", "NYC"], "categories": ["unsafe-structure", "vacant"], "openOnly": true, "withinDays": 30 }
```

### Pricing

**$2 per 1,000 violations**, pay only for violations delivered.
Example: 500 open violations in one city ≈ $1.

### Fair billing

- You are charged only for **unique, valid results delivered** to your dataset. Duplicates and records that fail validation are never charged.
- Results are delivered and charged in small batches while the run progresses. If a run stops early (an error, an abort, or your maximum cost per run), you keep, and pay only for, the results already delivered.
- If the Actor detects that the data source has changed (more than 5% of records fail validation), it stops **before** delivering more and the run fails, so you are not charged for broken data.
- If Apify restarts or you resurrect a run, results already delivered in that run are not charged again.
- Your **maximum cost per run** setting is always respected.
- If you think you were charged incorrectly, open an issue in the **Issues** tab with the run ID. We confirm within 48 hours, state the cause and list the affected runs, so you can use it as evidence when asking Apify support for compensation.

### Use with AI agents (MCP)

This Actor works as a tool for AI agents (Claude, Cursor, Copilot…) through the Apify MCP server at `https://mcp.apify.com`. Every input field has a description, and the default input returns a small result set so agents can try it quickly and cheaply.

### Data & compliance

- **Source:** each city's official open-data portal (table above), queried live. Nothing is scraped from websites and there are no logins.
- The Actor collects **publicly available data only**. It does **not** collect owner names, e-mail addresses or phone numbers; inspector names in the Austin data are not read.
- Licenses: NYC Open Data Law (no use restrictions); Seattle, Austin, Cincinnati and Montgomery County: Public Domain; New Orleans and Pittsburgh: CC0; San Francisco, Boston and Cambridge: Open Data Commons PDDL; Chicago: City of Chicago Data Terms of Use (notice below). Every record keeps its official `source` and `sourceUrl`.
- **You are responsible** for using the data in line with applicable law (for example fair-housing, telemarketing and do-not-call rules when contacting owners).
- Removal requests: open an issue or contact us via the developer profile. We respond within 24 hours.

### FAQ & limitations

- **Does it include owner names?** No. The cities' violation datasets do not publish them. Use the address or `parcelId` with your county's property records.
- **Why is the status empty for New Orleans?** Its violations dataset publishes no status; "Only open violations" leaves New Orleans out.
- **Why are Pittsburgh's newest records a month old?** The City publishes violations after the inspection is processed, about a month later.
- **Are complaints included?** Seattle, Austin and Cincinnati publish complaints and cases together with violations; `recordType` and `status` tell them apart. Complaints the city closed as unfounded or duplicate are left out.
- **Are the categories exact?** They are tagged from the city's violation type and description, so a few records can be tagged too broadly or missed. Use `keyword` for anything specific.

### Data source notice

> 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.

### Changelog

See [CHANGELOG.md](CHANGELOG.md).

# Changelog

This Actor's version history is a separate document: https://apify.com/neobuster/us-code-violations/changelog.md

# Actor input Schema

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

Cities to search. Leave empty for all.

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

Violations dated in the last N days (1-365). Ignored when 'From date' is set.

## `violationsAfter` (type: `string`):

Optional exact start date (YYYY-MM-DD).

## `violationsBefore` (type: `string`):

Optional end date (YYYY-MM-DD). The range can be at most 365 days.

## `categories` (type: `array`):

Keep violations matching any of these categories (from the violation type and description). Leave empty for all.

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

Optional text to find in the violation type, description, code section or address.

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

Keep violations at these 5-digit ZIP codes (not available for Chicago, NYC DOB, New Orleans and Cincinnati).

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

Keep only violations or cases the city still marks as open (New Orleans publishes no status and is left out).

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

Stop after this many violations (newest first; cities share the limit in turn). 0 = no limit.

## Actor input object example

```json
{
  "cities": [
    "CHI"
  ],
  "withinDays": 30,
  "openOnly": false,
  "maxResults": 20
}
```

# Actor output Schema

## `violations` (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": [
        "CHI"
    ],
    "withinDays": 30,
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("neobuster/us-code-violations").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": ["CHI"],
    "withinDays": 30,
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("neobuster/us-code-violations").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": [
    "CHI"
  ],
  "withinDays": 30,
  "maxResults": 20
}' |
apify call neobuster/us-code-violations --silent --output-dataset

```

## MCP server setup

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

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/jgimCV5hnWqbmaa96/builds/jkCR6sWsIRPBhNjcH/openapi.json
