# MD Baltimore Environmental-Code Violations (ECB) (`j0401/md-balt-ecb-citations`) Actor

Baltimore City environmental-code violation citations (~150.8k, open data): nuisance/trash/tobacco citations by the Environmental Control Board against a property. Citation number, address, status (Open/Paid/Abated/Voided), fine & balance, hearing, district. Property code-enforcement diligence.

- **URL**: https://apify.com/j0401/md-balt-ecb-citations.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.30 / 1,000 md baltimore environmental-code citation records

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

## Baltimore City Environmental-Code Violations (ECB)

The city's environmental-code enforcement ledger - every citation the
Baltimore Environmental Control Board has issued against a property, in one
queryable dataset. Property-level code-enforcement diligence: the violation
history of one address, an open-balance sweep, or a district-wide view.

### Data

Baltimore City, Maryland open data (public Environmental Control Board
register). **~150,800 citations** spanning two decades, actively updated
(violations through September 2026).

Each record carries:

- **Citation number** - the citation's stable key
- **Violation location** - the property address cited (fully populated)
- **Description** - the violation (nuisance / trash / abatement / tobacco and
  more, e.g. "FAILURE TO REMOVE OR ABATE ALL NUISANCES")
- **Status** - normalized to **Open** (~95k, balance still owing) / **Paid**
  (~49k) / **Abated** (~1.9k) / **Voided** (~4.4k)
- **Fine amount, balance** - what was assessed and what is still owed
- **Resolution buckets** - total paid / abated / voided by resolution
- **Lien code** - whether the citation carries a lien (L on ~125k)
- **Hearing** - hearing date / status / request-received date
- **Dates** - violation date, due date, last paid date
- **Place** - block / lot, neighborhood, police district, council district

### Low cost

**From $0.0003 per record.**

The source publishes this as a wide flat table where status is a padded
single character and dates come back as raw millisecond timestamps - fine for
the city's own map, painful if you want to actually cut it by place, status or
money. We made the ledger directly queryable: `citationNumber` / `address` /
`status` / `minBalance`-`maxBalance` / `policeDistrict` / `neighborhood` /
violation-date windows all filter before a record returns, `status` reads as
plain Open / Paid / Abated / Voided, and `groupBy` (counts by status /
district / neighborhood / lien code) comes back as clean server counts.
You query a violation ledger that behaves like a database; the cleanup stays
on our side.

**Every record is one flat JSON object** - no PDFs, no portal pagination.

### Use cases

- **Property violation history** - every citation against an address, with
  status, fines and balance
- **Open-balance sweeps** - properties with outstanding code-enforcement
  balances above a threshold
- **Code-enforcement analysis** - aggregate citations by district,
  neighborhood or lien status to see enforcement patterns

### Inputs

| Field | What it does |
|---|---|
| `citationNumber` | exact citation lookup |
| `address` | violation-address substring |
| `status` | open / Paid / Abated / Voided |
| `minBalance` / `maxBalance` | outstanding-balance range |
| `policeDistrict` / `neighborhood` / `blockLot` | find by place |
| `violatedFrom` / `violatedTo` | violation-date window |
| `aggregate` + `groupBy` | counts by status / district / neighborhood / council district / lien |

### Output fields

`citationNumber` / `status` / `lienCode` / `description` / `violationLocation`
/ `violationDate` / `dueDate` / `hearingDate` / `hearingStatus` /
`fineAmount` / `balance` / `totalPaid` / `totalAbated` / `totalVoided` /
`lastPaidDate` / `lastPaidAmount` / `neighborhood` / `policeDistrict` /
`councilDistrict` / `block` / `lot`.

> Honesty note: this ledger names properties (addresses), not individuals. The
> source's police-district column carries a few misspellings (e.g.
> "Notheastern") that are passed through as published. The register is served
> from the city's hosted ArcGIS Online org - always verify a live run's row
> content, since that org has at times served stale copies to cloud IPs.

Source: Baltimore City open data (Environmental Control Board citations,
public records).

# Actor input Schema

## `citationNumber` (type: `string`):

Exact citation number (e.g. 02313252).

## `address` (type: `string`):

Street address substring (e.g. 'Reisterstown').

## `status` (type: `string`):

Status. 'open' (~95k) = balance still owing; Paid (~49k); Abated (~1.9k); Voided (~4.4k). Blank = all.

## `minBalance` (type: `integer`):

Only citations with balance >= this (0 = no lower bound).

## `maxBalance` (type: `integer`):

Only citations with balance <= this (0 = no upper bound).

## `policeDistrict` (type: `string`):

Police district (e.g. 'Eastern', 'Western').

## `neighborhood` (type: `string`):

Neighborhood (e.g. 'Walbrook').

## `blockLot` (type: `string`):

Block-lot code substring.

## `violatedFrom` (type: `string`):

Only citations with violation date on/after this date (YYYY-MM-DD).

## `violatedTo` (type: `string`):

Only citations with violation date on/before this date (YYYY-MM-DD).

## `aggregate` (type: `boolean`):

When on, returns one summary record per group (see groupBy) with a count instead of individual citations.

## `groupBy` (type: `string`):

Which dimension to aggregate over.

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

Cap the number of records pushed (0 = up to ~10k per run — practical page limit). Aggregates have a few hundred groups max.

## Actor input object example

```json
{
  "citationNumber": "",
  "address": "",
  "status": "",
  "minBalance": 0,
  "maxBalance": 0,
  "policeDistrict": "",
  "neighborhood": "",
  "blockLot": "",
  "violatedFrom": "",
  "violatedTo": "",
  "aggregate": false,
  "groupBy": "status",
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

Baltimore City environmental-code violation citation records or aggregates - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/md-balt-ecb-citations").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/md-balt-ecb-citations").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 '{}' |
apify call j0401/md-balt-ecb-citations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/md-balt-ecb-citations"
        }
    }
}
```

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/cHlSmoOMaGJzE7zqV/builds/3hjptJuHhjd4fiQBQ/openapi.json
