# US Code Violations - 9 Cities, Official Open Data (`repeatable_stonecrop_tvc/us-code-violations`) Actor

Get property and building code violations from Chicago, NYC, Los Angeles, San Francisco, Austin, Seattle, New Orleans, Cincinnati and Orlando official open-data portals. Filter by date, keyword and open status. Address, coordinates, official description. No owner or inspector names.

- **URL**: https://apify.com/repeatable_stonecrop_tvc/us-code-violations.md
- **Developed by:** [Proudfit Data](https://apify.com/repeatable_stonecrop_tvc) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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: 9 Cities, Official Open Data

**Get property and building code violations from nine official US city open-data portals** — Chicago, New York City, Los Angeles, San Francisco, Austin, Seattle, New Orleans, Cincinnati and Orlando — in one clean feed. Filter by date, keyword (roof, mold, vacant, fire, electrical) and open status. You get the address, coordinates, official description, status, code and a link to the source dataset.

There is no API key, no login and no scraping of third-party sites: each city is queried through its **public Socrata open-data API**. **Owner, complainant and inspector names are never returned.**

### What can this Actor do?

- 🏘️ **Uniform schema** across 9 jurisdictions (address, date, type, status, description, coordinates)
- 🔎 **Keyword filters** on the official description, for example roof, mold, vacant, fire
- 📬 **Open / active cases only**, so you can build work lists for contractors and property teams
- 📅 **Schedule it daily** with *Filed in the last 1 day*
- ✅ **No personal data**: owner, complainant, inspector-name, phone and email fields are deliberately not mapped. Free-text complaint comments that often contain those details (for example Orlando) are dropped

### Cities included

Chicago, New York City (HPD housing maintenance), Los Angeles (LADBS open cases), San Francisco (DBI notices of violation), Austin, Seattle, New Orleans, Cincinnati and Orlando.

### How to use it

1. Pick the **cities** (Chicago, NYC and Austin by default).
2. Set **Filed in the last N days** (7 is a good default; 1 for a daily schedule).
3. Optionally add **keywords** and turn on **Only open / active cases**.
4. Run it, then download **CSV, Excel or JSON** or call it from the API, Make, Zapier or n8n.

### Input example: recent open violations in Chicago, NYC and Austin

```json
{
  "cities": [
    "chicago",
    "new-york-city",
    "austin"
  ],
  "issuedWithinDays": 7,
  "onlyOpen": true,
  "maxItemsPerCity": 20,
  "maxItems": 50
}
```

### Output example

```json
{
  "city": "Chicago",
  "state": "IL",
  "violation_id": "7569850",
  "case_number": "14961095",
  "violation_date": "2026-11-17",
  "status": "OPEN",
  "violation_code": "CN190019",
  "violation_type": "CONSERVATION",
  "description": "ARRANGE PREMISE INSPECTION",
  "address": "5621 S CARPENTER ST",
  "zip": null,
  "latitude": 41.7917456519,
  "longitude": -87.6510199501,
  "source_url": "https://data.cityofchicago.org/d/22u3-xenr",
  "scraped_at": "2026-11-18T20:00:00+00:00"
}
```

### How much does it cost?

**$3 per 1,000 violations** ($0.003 per record) plus a tiny start fee. A weekly pull of 2,000 violations costs about $6. No proxy or browser costs. Cap spend with *Max violations* or the run's maximum cost.

### Use cases

- **Contractor lead lists** (roof, electrical, plumbing, vacant-building work)
- **Property-condition monitoring** for investors, lenders and proptech
- **Companion feed to US building permits** in the same cities
- **Neighborhood quality research** with official violation dates and coordinates

### FAQ

**Where does the data come from?** From each city's official open-data portal, queried through the public Socrata SODA API. Dataset identifiers are listed in the Actor source and in each row's `source_url`.

**Are owner names included?** No. We do not map owner, applicant, complainant or inspector-name fields. Orlando's free-text case comments, which often contain a complainant's phone and email, are not output.

**Why is the description short in some cities?** Los Angeles and Orlando publish a short official type rather than a long narrative. Chicago, NYC, San Francisco, Seattle and New Orleans usually include a fuller official description.

**Why do some cities lack coordinates or a ZIP?** That is how the official dataset is published. Address is always filled when the portal provides one.

### Other public-data Actors from the same publisher

| Actor | What it gives you |
|---|---|
| [US Building Permits Scraper](https://apify.com/repeatable_stonecrop_tvc/us-building-permits) | New permits from 13 US city open-data portals, contractor company and project value |
| [US Code Violations](https://apify.com/repeatable_stonecrop_tvc/us-code-violations) | Property and building code violations from 9 US city open-data portals |
| [UK Government Tenders Scraper](https://apify.com/repeatable_stonecrop_tvc/uk-public-tenders) | Find a Tender + Contracts Finder tenders and awards in one feed |
| [EU Tenders Scraper (TED)](https://apify.com/repeatable_stonecrop_tvc/eu-ted-tenders) | Open calls, awards and winners across the EU/EEA |
| [France BOAMP Tenders](https://apify.com/repeatable_stonecrop_tvc/france-boamp-tenders) | French public tenders and awards from the official BOAMP API |
| [Brazil PNCP Tenders](https://apify.com/repeatable_stonecrop_tvc/brazil-pncp-tenders) | Brazilian public procurement notices from the official PNCP API |
| [French Company Search](https://apify.com/repeatable_stonecrop_tvc/france-company-search) | SIRENE/RNE company data with revenue, NAF codes and labels |
| [Poland KRS Company Register](https://apify.com/repeatable_stonecrop_tvc/poland-krs-companies) | Daily new Polish companies and KRS lookups |
| [Spain BORME Companies](https://apify.com/repeatable_stonecrop_tvc/spain-borme-companies) | New Spanish companies and mercantile acts from the official gazette |
| [GLEIF LEI Lookup](https://apify.com/repeatable_stonecrop_tvc/gleif-lei-lookup) | Global Legal Entity Identifier search and lookup (official GLEIF API) |

# Actor input Schema

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

Which official city open-data portals to pull code violations from. Each is queried through its public Socrata API.

## `issuedWithinDays` (type: `integer`):

Only violations dated in the last N days. Ignored if 'Filed from' is set.

## `issuedFrom` (type: `string`):

Optional start date. Overrides 'Filed in the last N days'.

## `issuedTo` (type: `string`):

Optional end date (inclusive). Defaults to today.

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

Optional. Keep only violations whose official description contains ANY of these words (case-insensitive), e.g. roof, mold, vacant, fire, electrical.

## `onlyOpen` (type: `boolean`):

Skip violations whose status looks closed, complied or completed. Portals use different status words; this is best-effort.

## `maxItemsPerCity` (type: `integer`):

Cap per city so one large portal does not use up the whole run.

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

Upper limit for the run (controls your cost). Default 50.

## Actor input object example

```json
{
  "cities": [
    "chicago",
    "new-york-city",
    "austin"
  ],
  "issuedWithinDays": 7,
  "keywords": [],
  "onlyOpen": false,
  "maxItemsPerCity": 20,
  "maxItems": 50
}
```

# 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",
        "new-york-city",
        "austin"
    ],
    "issuedWithinDays": 7,
    "maxItemsPerCity": 20,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("repeatable_stonecrop_tvc/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": [
        "chicago",
        "new-york-city",
        "austin",
    ],
    "issuedWithinDays": 7,
    "maxItemsPerCity": 20,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("repeatable_stonecrop_tvc/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": [
    "chicago",
    "new-york-city",
    "austin"
  ],
  "issuedWithinDays": 7,
  "maxItemsPerCity": 20,
  "maxItems": 50
}' |
apify call repeatable_stonecrop_tvc/us-code-violations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,repeatable_stonecrop_tvc/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/xElGsaQLihVnGQiLf/builds/8eJ6kOMUioegP0iic/openapi.json
