# NYC Evictions - Marshal Executions & Addresses (`j0401/nyc-evictions`) Actor

NYC marshal eviction executions (137,161 rows, 2017-2026): executed date, premises, apartment, borough, ZIP, BBL/BIN, residential/commercial, marshal, possession type. No tenant names. Search, aggregate by year or marshal, or roll up one property.

- **URL**: https://apify.com/j0401/nyc-evictions.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 nyc eviction records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## NYC Evictions - 137,161 Marshal Execution Records

New York City's marshal eviction executions as a queryable dataset: **137,161
source rows (136,976 distinct) from 3 January 2017 to 12 November 2026**,
measured 14 November 2026, refreshed daily (dataset stamp 13 November 2026).
Each row is one eviction a city marshal carried out, with the premises, the
court index and docket, the marshal, the borough, ZIP, BBL/BIN and coordinates
**where the city publishes them**. There are no tenant names, no landlord names
and no case parties in this record.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive - the full file stays queryable and you are never billed
for the scan behind it.

### What you get per record

| field | meaning |
|---|---|
| `recordId` | the source row id (stable page key) |
| `address`, `apartment` | the premises as published, plus the unit when the file has one |
| `executedDate`, `executedYear`, `executedMonth` | the date the eviction was executed |
| `borough`, `zip` | borough and ZIP; all 137,161 rows carry both |
| `propertyType` | `Residential` (125,216) or `Commercial` (11,945) |
| `possession` | `Possession` (133,669), `Eviction` (3,488) or `Unspecified` (4) |
| `ejectment` | `Ejectment` (115) or `Not an Ejectment` (137,046) |
| `marshalFirstName`, `marshalLastName`, `marshalName` | the city marshal who executed it |
| `courtIndex`, `docketNumber` | county civil-court index and marshal docket |
| `bbl`, `bin` | property identifiers for joins (124,495 rows carry both) |
| `communityBoard`, `councilDistrict`, `censusTract`, `nta` | district identifiers |
| `latitude`, `longitude` | point coordinates where published |
| `totalMatched` | source rows matching the filters |

### Search it

- **Property** - `bbl="2030300143"`, `bin="2011164"`, `zip="10467"`.
- **Place** - `borough="BRONX"`, `communityBoard="6"` (a bare district number;
  pair it with the borough).
- **What kind of eviction** - `propertyType="Commercial"`,
  `possession="Eviction"`, `ejectment="Ejectment"`.
- **Court record** - `courtIndex="12584/17Q"` or `"B321765/23"` (the source
  mixes county prefixes and suffixes), `docketNumber="163251"`.
- **Marshal** - `marshal="Grossman"` (the busiest marshal in the file, 24,099
  executions since 2017).
- **Time** - `year=2026`, or `executedFrom="2025-01-01", executedTo="2025-12-31"`.
- **Address text** - `address="WEBSTER"`.

### Example inputs

**Every execution in the Bronx since 1 January 2026**

```json
{ "borough": "BRONX", "year": 2026, "maxResults": 200 }
```

**Evictions in ZIP 10467** (3,738 rows - the busiest ZIP in the file)

```json
{ "zip": "10467", "maxResults": 100 }
```

**One property's eviction history**

```json
{ "mode": "property", "bbl": "2030300143" }
```

Returns the 4 executions recorded at that BBL, each row carrying
`propertyExecutions`, `propertyFirstExecution`, `propertyLastExecution`,
`propertyResidential` and `propertyCommercial`. `mode="property"` takes exactly
one of `bbl` or `bin` and no other filter, returns **every execution** at that
property (`maxResults` does not clip this mode), and refuses a property with
more than 5,000 recorded executions instead of truncating.

### Aggregate it

```json
{ "mode": "aggregate", "groupBy": "year" }
```

Executions by year: **2017 22,522 / 2018 21,830 / 2019 18,713 / 2020 3,422 /
2021 268 / 2022 4,998 / 2023 13,392 / 2024 16,731 / 2025 19,304 / 2026
15,981**. The 2020-2021 collapse is the state eviction moratorium, not missing
data: the file carries the execution records the city published.

`groupBy` = `year`, `month`, `borough`, `propertyType`, `ejectment`,
`possession`, `marshal`, `zip`, `communityBoard`, `councilDistrict` or `nta`.
`metric` = `count` (source rows) or `properties` (distinct BBLs) - use
`properties` when the question is "how many properties", not "how many
executions". Groups are ordered by count (year and month ascending) and a
dimension that exceeds its ceiling fails loudly rather than dropping the tail.

```json
{ "mode": "aggregate", "groupBy": "borough" }
```

Bronx 43,626 / Brooklyn 38,156 / Queens 27,891 / Manhattan 22,549 / Staten
Island 4,939.

### Value dictionaries

```json
{ "mode": "codes" }
```

Returns the observed borough, property-type, ejectment and possession values
with their counts. It takes no filters.

### Row grain and how to read it

- **One row = one execution event.** `totalMatched` counts source rows.
- **185 rows are exact duplicates** of another row (identical on all 20
  published fields). They are delivered once, so a full pull is 136,976
  records, not 137,161 - you are not billed twice for the same row. `matched`
  in the run log still reports the source count.
- **`courtIndex` is not a unique key.** Each borough's civil court numbers its
  own cases, so the same index value can appear in several boroughs against
  unrelated premises (one index in the file appears 6 times across four
  boroughs). Use `bbl`/`bin` or the address to identify a property.
- **12,666 rows have no BBL or BIN** (9.2%) and 7 BBL values are not 10 digits;
  they are passed through exactly as published and never invented.
- **`communityBoard` is a bare district number** (`1` to `18`), not the
  3-digit borough-prefixed board id used in other NYC feeds - the same number
  exists in more than one borough, so pair it with `borough`. 12,117 rows carry
  no board.
- **The file is executions only.** A case that was settled, adjourned or never
  executed does not appear. For case-level dockets use a court-records source.
- When `maxResults` or the run-level charge cap stops a query, the dataset also
  carries one unbilled `_meta` row with `truncated`, `delivered` (a lower bound
  when `stopReason="charge-limit"`), `totalMatched` and `stopReason`.

### Source and licence

New York City marshals' eviction execution records, published on the
[NYC Open Data portal](https://data.cityofnewyork.us/City-Government/Evictions/6z8x-wfk4)
(public open data).

### Use it from an AI agent (MCP)

Connect any MCP client to `https://mcp.apify.com/?tools=j0401/nyc-evictions` to load this dataset as a single tool beside the tools you already have - same records, same per-record pricing.

# Actor input Schema

## `mode` (type: `string`):

rows = execution records (default). aggregate = one row per group with a count or distinct-property count. property = every execution at one BBL or BIN with the property summary (bbl or bin required). codes = the observed borough/type/possession values with counts.

## `courtIndex` (type: `string`):

County civil-court index, e.g. "67381/17". Each borough numbers its own cases, so the same index can appear in more than one borough.

## `docketNumber` (type: `string`):

Marshal docket number, digits only.

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

Case-insensitive substring on the premises address, e.g. "WEBSTER".

## `apartment` (type: `string`):

Case-insensitive substring on the apartment/unit, e.g. "3B".

## `borough` (type: `string`):

One of New York City's five boroughs.

## `zip` (type: `string`):

Exact 5-digit ZIP code. Accepts ZIP+4 ("12345-6789"); matched on the 5-digit core.

## `bbl` (type: `string`):

10-digit Borough-Block-Lot. Present on 124,495 of 137,161 rows.

## `bin` (type: `string`):

Building Identification Number.

## `communityBoard` (type: `string`):

Bare district number (1-18). The same number exists in more than one borough, so pair it with borough. 12,117 rows have none.

## `councilDistrict` (type: `string`):

City council district number.

## `propertyType` (type: `string`):

The source's residential/commercial classification.

## `ejectment` (type: `string`):

Ejectment (115 rows) or Not an Ejectment (137,046).

## `possession` (type: `string`):

"Possession" is the marshals' term for an execution (133,669 rows); "Eviction" is 3,488 rows.

## `marshal` (type: `string`):

Case-insensitive substring, e.g. "Grossman".

## `year` (type: `integer`):

Exact year, 2017-2026 in the current file.

## `executedFrom` (type: `string`):

ISO date (YYYY-MM-DD).

## `executedTo` (type: `string`):

ISO date (YYYY-MM-DD).

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

Used only with mode=aggregate. Default borough.

## `metric` (type: `string`):

count = executions; properties = distinct BBLs.

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

Records delivered in rows mode (default 50, max 5000). property returns every execution at the BBL/BIN up to its 5,000 ceiling regardless of this value; aggregate and codes ignore it. 0 uses the default 50.

## Actor input object example

```json
{
  "mode": "",
  "borough": "",
  "propertyType": "",
  "ejectment": "",
  "possession": "",
  "groupBy": "",
  "metric": "",
  "maxResults": 50
}
```

# Actor output Schema

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

NYC eviction execution records 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/nyc-evictions").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/nyc-evictions").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/nyc-evictions --silent --output-dataset

```

## MCP server setup

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

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/LhI3uj7KTFso2dm3R/builds/NunZJX04WKOwHUwKL/openapi.json
