# Code Violations Scraper — City Code Enforcement Leads (`intelscrape/code-violations`) Actor

Municipal city code-enforcement / code-violation public records for contractor and investor leads. Soft CTA to Building Permit Scraper. Confirm live Store pricing before runs.

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

## Pricing

from $2.00 / 1,000 dataset items

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Code Violations Scraper — City Code Enforcement Leads

![Actor Banner](https://api.apify.com/v2/key-value-stores/PyvJzfQg02FD3RYhd/records/code-violations-banner.png)

> 🇨🇳 **中文简介 (Chinese — China & Singapore):**
> 要找美国市政 **city code enforcement / code violation** 做物业与本地服务拓客？本 Actor 抓取公开违规记录相关字段，方便承包商与投资者跟进。同一买家可再跑 **Building Permit Scraper** 拿同城施工许可。当前 Store 计费以 Actor 页为准（可能为免费/试用档）——请以运行前定价面板为准。适合中美跨境地产与本地服务团队。现在试跑，把线索导出到 CRM。

> 🇸🇬 **Ringkasan Melayu (Singapore):**
> Nak lead **city code enforcement** / code violation bandar AS? Actor ini scrape rekod awam pelanggaran untuk kontraktor dan pelabur. Pasangkan dengan Building Permit Scraper untuk lead bina di bandar sama. Semak panel harga Store sebelum run. Sesuai untuk pasukan hartanah di Singapura. Cuba di Apify sekarang.

#### 🤖 NEW: Connect This To Your AI! (MCP)

Want city code-enforcement leads inside Claude, Cursor, or ChatGPT? Use the **[Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace)** — Model Context Protocol access to Code Violations + **Building Permit Scraper** in one AI workflow.

#### 🏆 Featured Bots by IntelScrape

1. **[Code Violations Scraper](https://apify.com/intelscrape/code-violations)** — City Code Enforcement Leads
2. **[Building Permit Scraper](https://apify.com/intelscrape/building-permit-scraper)** — Roofing, Solar & HVAC Leads
3. **[Skip Trace PRO](https://apify.com/intelscrape/skip-trace-pro)** — Name, Address, Phone & Email People Lookup
4. **[TruePeopleSearch Scraper](https://apify.com/intelscrape/truepeoplesearch-scraper)** — Phone & Email Matches
5. **[TikTok Scraper](https://apify.com/intelscrape/tiktok-scraper)** — Emails & Influencer Leads
6. **[Google Maps No-Website Leads](https://apify.com/intelscrape/website-Leads)** — Local Businesses Without a Website
7. **[UCC Lien Scraper](https://apify.com/intelscrape/ucc-lien-scraper)** — Florida & New Jersey Filings
8. **[Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace)** — Use Skip Trace inside Claude, Cursor, ChatGPT

***

⚡ **Use this Actor in n8n — no code**

Use the official **Apify** node. Actor ID: `IntelScrape/code-violations`.

***

![price](https://img.shields.io/badge/price-see_Store-e83e8c) ![billing-see\_Store\_panel](https://img.shields.io/badge/billing-see_Store_panel-2ea44f) ![API key](https://img.shields.io/badge/API_key-not_required-blue) ![coverage-US\_municipal](https://img.shields.io/badge/coverage-US_municipal-8a2be2)

**City code enforcement / municipal code-violation leads** for contractor outreach and distressed-property screens.\
**Confirm the live Store pricing panel before you run — this Actor may be on a free/trial tariff.**

> **Honest coverage & billing (read this):** Source is **public municipal violation-style pages/feeds we wire in code** (open data where available). **Billing follows the live Apify Store pricing panel** (may show FREE or PPE). Do not assume a fixed per-item rate without checking. Demo/synthetic rows if offered are not production leads.

***

> 🧭 Built for **contractors, property investors, and local-service sales teams** hunting **city code enforcement** and housing/building violations.

> ⭐ **Store rating is driven by daily power users.** If this Actor saves you time, please [leave a review](https://apify.com/intelscrape/code-violations).

> ⚖️ **Lawful business use only.** Public data only. You are responsible for compliance with site terms and applicable law.

> 📌 *Examples in this README are **fictional** unless stated otherwise.*

***

### 🕵️‍♂️ Why Choose Us vs. "Cheaper" Competitors?

| Feature | This Actor | Thin stubs |
| :--- | :--- | :--- |
| **Query fit** | City code enforcement / municipal violations | Generic “leads” fluff |
| **Same buyer** | Soft CTA → Building Permit Scraper | Dead-end |
| **Honest billing** | Documented Store panel | Vague |
| **AI / n8n** | MCP + Actor ID | Often none |

### What a result looks like

| address | violation | status | url |
| :--- | :--- | :--- | :--- |
| 100 Main St | Overgrown lot | Open | https://example.city.gov/... |

### Quick start

```json
{
  "states": ["TX"],
  "maxResults": 50,
  "daysBack": 90,
  "openOnly": true
}
```

Demo when available:

```json
{
  "demoMode": true,
  "maxItems": 5
}
```

***

### Soft CTA — pair with Building Permit Scraper

Code violations flag **distressed / enforcement** properties; newly issued **building permits** flag **active construction spend**. Same buyer (roofing, HVAC, remodel, investors).

Run **[Building Permit Scraper](https://apify.com/intelscrape/building-permit-scraper)** on the same markets:

- Multi-city pack: `cities: ["Chicago","Austin","Miami"]`
- Keyword filter: `keyword: "roof"` / `"solar"` / `"HVAC"`
- Owner phones: pipe addresses into **[Skip Trace PRO](https://apify.com/intelscrape/skip-trace-pro)**

City / state filters on this Actor already let you pack a metro; add permit scans for HOT remodel leads on the same schedule.

### Input / Output / Pricing

See live Actor input schema and Store pricing panel. Output: Apify dataset. **PPE prices unchanged** by this reshape (metadata/README only).

### Legal

Lawful business research only. Not affiliated with the source platforms.

# Actor input Schema

## `states` (type: `array`):

Pick one or more states. Each option lists the jurisdictions covered.

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

Maximum violations to return.

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

0 = no date filter.

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

Drop violations already closed or complied.

## Actor input object example

```json
{
  "states": [
    "IL"
  ],
  "maxResults": 100,
  "daysBack": 90,
  "openOnly": false
}
```

# Actor output Schema

## `violations` (type: `string`):

Distressed-property code violation rows in the default dataset.

# 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 = {
    "states": [
        "IL"
    ],
    "maxResults": 100,
    "daysBack": 90,
    "openOnly": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("intelscrape/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 = {
    "states": ["IL"],
    "maxResults": 100,
    "daysBack": 90,
    "openOnly": False,
}

# Run the Actor and wait for it to finish
run = client.actor("intelscrape/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 '{
  "states": [
    "IL"
  ],
  "maxResults": 100,
  "daysBack": 90,
  "openOnly": false
}' |
apify call intelscrape/code-violations --silent --output-dataset

```

## MCP server setup

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