Chicago Building Violations Scraper avatar

Chicago Building Violations Scraper

Pricing

from $1.00 / 1,000 violation record returneds

Go to Apify Store
Chicago Building Violations Scraper

Chicago Building Violations Scraper

Query the official City of Chicago Building Violations dataset by address, status, violation code, inspection, date range, or advanced SoQL filters. Returns one normalized record per building violation.

Pricing

from $1.00 / 1,000 violation record returneds

Rating

0.0

(0)

Developer

Muhammad Afzal

Muhammad Afzal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

Query the official City of Chicago Building Violations dataset through its public Socrata API. The actor returns one normalized dataset item per violation and stores a run summary in the OUTPUT key-value record.

What it returns

Each result includes the City violation ID, violation and inspection details, address fields, property group, coordinates, computed community/ZIP/ward identifiers, the official API URL, and the UTC retrieval time. Null values are preserved when the City dataset does not provide a field.

The source dataset is Building Violations (22u3-xenr). It contains Department of Buildings violations from 2006 to the present. The City notes that the data is historical and informational; it should not be used as a substitute for title commitments, court records, or a current property-condition inspection.

Example input

The default query returns up to 100 OPEN violations:

{
"violationStatus": "OPEN",
"maxResults": 100
}

Find violations near an address over a date range:

{
"address": "121 N LA SALLE",
"violationDateFrom": "2024-01-01",
"violationDateTo": "2024-12-31",
"maxResults": 250
}

Filter an entire property group or inspection:

{
"propertyGroup": "92840",
"inspectionNumber": "14930108",
"maxResults": 100
}

For advanced use, where accepts one Socrata $where expression using the official field names, for example street_type = 'AVE' AND inspection_status = 'FAILED'. Do not include $where= in the value.

Inputs and limits

  • address: case-insensitive address substring.
  • propertyGroup: exact Property Group identifier.
  • violationStatus: OPEN, COMPLIED, or NO ENTRY; defaults to OPEN.
  • violationCode: exact violation code.
  • inspectionNumber: exact inspection number.
  • inspectionCategory: COMPLAINT, PERIODIC, PERMIT, or REGISTRATION.
  • violationDateFrom and violationDateTo: inclusive YYYY-MM-DD date range.
  • where: optional advanced SoQL filter.
  • order: newest or oldest violation date.
  • maxResults: 1–5,000 records; default 100.
  • pageSize: 1–1,000 API rows per page; default 500.

The actor uses the public City endpoint directly, does not require an API key, and does not use browser automation or private data. API errors are reported honestly in OUTPUT; partial results remain available when a later page fails.

Pricing

This Actor uses pay-per-event pricing with platform usage included:

EventPrice
Actor start$0.00005 per start event
Violation record returned$0.0005 per dataset item

The default 100-record run costs at most approximately $0.05005, excluding any later dataset storage or access costs. Valid empty or invalid-input runs do not create dataset-item charges.

Local development

npm install
npm test
npm start

The start command expects Apify Actor input/storage environment variables. For a quick local API smoke test after building, use the Apify local runner or run the compiled code with a local INPUT.json/storage configuration.

Use cases

  • Schedule repeatable collection and export results to downstream workflows.
  • Run a one-off research job and export the structured result as JSON, CSV, Excel, XML, or RSS from Apify.
  • Schedule the same input to monitor changes over time and send completed datasets to a webhook or integration.
  • Feed schema-shaped records into a database, spreadsheet, BI tool, or AI workflow with the source URL retained for verification.

Output example

{
"violationId": "Example Violation ID",
"violationDate": "Example Violation Date",
"violationLastModifiedDate": "Example Last Modified",
"violationCode": "Example Violation Code",
"violationStatus": "Example Violation Status",
"violationStatusDate": "Example Status Date",
"violationDescription": "Example Violation Description",
"violationLocation": "Example Violation Location",
"violationInspectorComments": "Example Inspector Comments",
"violationOrdinance": "Example Violation Ordinance",
"inspectorId": "Example Inspector ID",
"inspectionNumber": "Example Inspection Number"
}

The exact fields depend on the selected input and what the public source exposes. Use the dataset schema as the machine-readable contract and retain source URLs for verification.

Run Chicago Building Violations Scraper with the Apify API

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/chicago-building-violations-scraper').call({
"address": "",
"propertyGroup": "",
"violationStatus": "OPEN",
"violationCode": "",
"inspectionNumber": "",
"inspectionCategory": "",
"violationDateFrom": "",
"violationDateTo": ""
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

You can also run the Actor from Apify Console, schedules, webhooks, the REST API, Make, Zapier, n8n, or the hosted Apify MCP server.

Reliability and limitations

Public websites and upstream APIs change over time. Start with a small result limit, inspect the dataset and run log, and keep a known-good input for scheduled canary runs. A valid query can return no records when the source has no matches. If a run is blocked, rate-limited, or missing an expected field, reduce concurrency or scope where the input supports it and include the run ID in a support report.

The Actor does not guarantee that every optional field is present on every record. Treat absent values as unavailable from that source response, not as proof that the real-world value does not exist.

Responsible use

Use this Actor only for data you are authorized to access. Follow the target website's terms, robots and access policies, and applicable privacy, database, copyright, anti-spam, and data-protection laws. Do not use it to bypass authentication or other access controls, collect private data, harass people, or make high-impact decisions without independent verification.