US Code Violations - 9 jurisdictions, one case model avatar

US Code Violations - 9 jurisdictions, one case model

Pricing

from $2.00 / 1,000 code violations

Go to Apify Store
US Code Violations - 9 jurisdictions, one case model

US Code Violations - 9 jurisdictions, one case model

Property, housing and code violations from 9 US jurisdictions (~4.2M records) normalised into one schema with separate case-status and resolution fields.

Pricing

from $2.00 / 1,000 code violations

Rating

0.0

(0)

Developer

Rishi Vinodkumar

Rishi Vinodkumar

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Share

US Code Violations — 9 jurisdictions, one case model

Property, housing and building code violations from nine US jurisdictions, normalised into a single schema.

~4,249,022 violation records across 9 actively-maintained sources.

SourceStateRecordsLast verified
ChicagoIL~2,020,6582026-07-29
Montgomery CountyMD~954,2552026-07-22
Chicago (ordinance hearings)IL~838,8592026-07-30
Kansas CityMO~174,9992026-07-01
New OrleansLA~111,4412026-07-30
MesaAZ~80,5802026-07-28
NorfolkVA~44,8352026-07-29
New York City (BIC)NY~18,0262026-07-29
CambridgeMA~5,3692026-07-22

Why this is harder than it looks

The other actors in this repo reconcile spellings. This one reconciles processes. All nine publish a "status" field, and they are not describing the same thing:

JurisdictionFieldVocabularyWhat it actually means
Chicagoviolation_statusOPEN / COMPLIED / NO ENTRYviolation state
Montgomery CountydispositionTriennial Completed / Citation issuedinspection outcome
Kansas Citycase_statusIn-Compliance / In-Violationcase state
NorfolkstatusClosed - Corrected / Work in Progresscase state
NYC BICviolation_dispositionSettled / Barred by CPLR / Judgementcourt outcome
Cambridgeviolation_statusCorrected / Citedviolation state
Chicago ordinancecase_dispositionLiable / Non-Suit / Default / Not Liablehearing outcome
New OrleanscurrentstatusViolations Abated / Payment Receivedabatement pipeline
MesastatusIn Violation / Legal Action / Closedcase state

Collapsing those into one enum would look tidy and be a lie — a court settlement is not a re-inspection result. So the schema carries two orthogonal fields:

case_status OPEN | CLOSED | UNKNOWN
resolution CORRECTED | CITED | DISMISSED | NO_ACCESS | OTHER | NONE

plus raw_status (always the original string) and status_semantics (case / inspection / legal) so you never silently compare a court judgement against a housing re-inspection.

The mapping is substring-based and order-sensitive: "Closed - Corrected" contains both closed and corrected; "Not Corrected" contains corrected; "Settled - Pending" contains settled; and "Not Liable" contains "Liable", where a flipped order would turn ~107k dismissals into citations. test_status.py pins all 43 observed strings.

Four traps found while building this

1. Montgomery County is mostly not violations. Its 954k rows are dominated by routine triennial inspections (Triennial Completed, 547k of them). Filter resolution = CITED to find actual enforcement. Auto-inference also picked date_closed as the event date, which would have silently excluded every open case — we use date_filed.

2. Kansas City's dates run into the future. date_found contains data-entry typos as far ahead as October 2029. Set violatedBefore if you are building time series. verify.py flags this rather than reporting the feed healthy.

3. Chicago has two violation feeds. chicago is building violations; chicago_ordinance is administrative hearing outcomes — what the city actually did about them. Its violation_date contains typos reaching year 6111, so always set violatedBefore.

4. NYC BIC is not what you expect. It is the Business Integrity Commission — trade waste and public markets — not the Department of Buildings. Narrow, but the only source here with monetary penalties and court dispositions.

Who this is for

  • Real-estate investors sourcing distressed-property leads
  • Contractors (roofing, façade, abatement) finding properties under order
  • Property managers and compliance vendors monitoring portfolios
  • Journalists and researchers tracking enforcement patterns

Usage

Open violations with an address, last quarter:

{
"sources": ["chicago", "norfolk", "cambridge"],
"violatedAfter": "2026-05-01",
"openOnly": true,
"requireAddress": true,
"maxResults": 5000
}

Actual enforcement actions only (skips routine inspections):

{ "violatedAfter": "2026-01-01", "violatedBefore": "2026-07-31", "resolution": ["CITED"] }

Local development

pip install requests
python local_run.py --coverage
python local_run.py --after 2026-05-01 --limit 10
python local_run.py --open-only --after 2026-01-01 --limit 20
python local_run.py --resolution CITED --after 2026-01-01
python verify.py # health-check every source
python test_status.py # status-classification regression tests

Public, logged-out municipal open-data endpoints via each jurisdiction's official Socrata API. No authentication, no account, no terms accepted, no anti-bot circumvention. Code violations are public records attached to properties; property_owner is populated only where the jurisdiction publishes it as part of that public record. Rate limits respected with exponential backoff.