# NYC Restaurant Inspection Scraper (`crawlerbros/nyc-restaurant-inspection-scraper`) Actor

Scrape the official NYC DOHMH Restaurant Inspection Results open dataset. Search or filter by borough, cuisine, grade, inspection type, critical flag, ZIP code, or date range; look up a restaurant's full inspection history by CAMIS ID. Free public Socrata API, no login required.

- **URL**: https://apify.com/crawlerbros/nyc-restaurant-inspection-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## NYC Restaurant Inspection Scraper

Scrape the official **NYC Department of Health and Mental Hygiene (DOHMH) Restaurant Inspection Results** open dataset. Search or filter New York City restaurant inspections by borough, cuisine, letter grade, inspection type, critical violation flag, ZIP code, or date range — or pull a restaurant's complete inspection history by its CAMIS ID. Powered by the public NYC Open Data (Socrata) API. No login, no API key, no proxy required.

### What this actor does

- **Two modes:** `search` (filter/browse) and `byCamis` (exact restaurant lookup)
- **Rich filters:** borough, cuisine, letter grade, critical-violation flag, inspection action/type, ZIP code, inspection date range, score range, restaurant-name keyword
- **Search near a location** — filter to restaurants within a radius (in meters) of any latitude/longitude point
- **Full-text search** across restaurant and cuisine text fields
- **Every inspection row** — one record per cited violation/inspection event, so a single restaurant can appear multiple times across its inspection history
- **Geo + district data** — latitude/longitude, community board, council district, census tract, BIN, BBL, NTA
- **Empty fields are omitted** — a restaurant with no assigned grade simply has no `grade` field, never a placeholder

### Output per inspection record

- `camis` — unique NYC restaurant identifier
- `dba` — restaurant name ("doing business as")
- `boro` — borough (Manhattan, Brooklyn, Queens, Bronx, Staten Island)
- `address`, `street`, `zipcode`, `phone`
- `cuisineDescription`
- `inspectionDate`, `inspectionType`, `action`
- `violationCode`, `violationDescription`, `criticalFlag`
- `score`, `grade`, `gradeDate`
- `recordDate` — when NYC Open Data last refreshed this row
- `latitude`, `longitude`
- `communityBoard`, `councilDistrict`, `censusTract`, `bin`, `bbl`, `nta`
- `sourceUrl` — link to the restaurant on NYC's public ABC Eats grading lookup
- `recordType: "inspection"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` (filter/browse) or `byCamis` (exact lookup) |
| `searchQuery` | string | – | Full-text search across restaurant/cuisine text fields (mode=search) |
| `dbaKeyword` | string | – | Case-insensitive substring match on restaurant name |
| `camisIds` | array | – | CAMIS IDs to fetch inspection history for (mode=byCamis) |
| `borough` | string | any | Manhattan / Brooklyn / Queens / Bronx / Staten Island |
| `cuisineDescription` | string | any | One of ~90 DOHMH cuisine classifications |
| `grade` | string | any | A / B / C / Not Yet Graded / Grade Pending (2 variants) |
| `criticalFlag` | string | any | Critical / Not Critical / Not Applicable |
| `actionType` | string | any | Inspection outcome/action |
| `inspectionType` | string | any | DOHMH inspection program + phase (36 combinations) |
| `inspectionDateFrom` / `inspectionDateTo` | string | – | ISO date range (YYYY-MM-DD) |
| `zipcode` | string | – | 5-digit NYC ZIP |
| `minScore` / `maxScore` | int | – | Inspection score bounds (0–200; higher = more violation points) |
| `nearLatitude` / `nearLongitude` | number | – | Center point for a radius search. Both must be set together to activate the filter. |
| `nearRadiusMeters` | int | `500` | Radius (1–50,000 m) around `nearLatitude`/`nearLongitude`. Only applied when both coordinates are set. |
| `sortBy` | string | `inspectionDateDesc` | Sort order — inspection date, score, restaurant name, borough, ZIP code, or cuisine |
| `appToken` | string | – | Optional free Socrata app token for higher rate limits |
| `maxItems` | int | `50` | Hard cap on emitted records (1–10000) |

#### Example: browse the latest inspections in Manhattan with a failing grade

```json
{
  "mode": "search",
  "borough": "Manhattan",
  "grade": "C",
  "maxItems": 50
}
````

#### Example: full inspection history for a specific restaurant

```json
{
  "mode": "byCamis",
  "camisIds": ["41235305"]
}
```

#### Example: critical violations for pizza restaurants in a date range

```json
{
  "mode": "search",
  "cuisineDescription": "Pizza",
  "criticalFlag": "Critical",
  "inspectionDateFrom": "2025-01-01",
  "inspectionDateTo": "2025-12-31",
  "maxItems": 200
}
```

#### Example: keyword search for a restaurant chain

```json
{
  "mode": "search",
  "dbaKeyword": "starbucks",
  "maxItems": 100
}
```

#### Example: restaurants within 500m of Times Square

```json
{
  "mode": "search",
  "nearLatitude": 40.758,
  "nearLongitude": -73.9855,
  "nearRadiusMeters": 500,
  "maxItems": 100
}
```

### Use cases

- **Food safety research** — track violation trends by cuisine, borough, or time period
- **Consumer apps** — surface a restaurant's grade and violation history before a visit
- **Real estate / business intelligence** — assess food-service density and compliance by neighborhood
- **Journalism** — investigate closures, repeat violators, or grading patterns
- **Academic research** — bulk-export inspection data for public health studies

### FAQ

**What is the data source?**
The NYC Department of Health and Mental Hygiene's Restaurant Inspection Results dataset, published on NYC Open Data (Socrata, dataset ID `43nn-pn8j`) and updated regularly by the city.

**Is this affiliated with NYC or DOHMH?**
No. This is an independent, third-party actor built on NYC's public open-data API.

**Why do some records have no `grade` field?**
Only certain inspection types receive a letter grade. Ungraded inspections simply omit the field rather than showing a placeholder.

**Why does one restaurant appear multiple times?**
Each row in the source dataset represents one violation cited during one inspection. A single inspection with multiple violations produces multiple rows, and each visit to a restaurant is a separate inspection.

**What does the inspection `score` mean?**
Lower is better — DOHMH assigns points for each violation, and the cumulative score determines the letter grade (roughly: 0–13 = A, 14–27 = B, 28+ = C).

**How fresh is the data?**
NYC Open Data refreshes this dataset frequently (typically daily). Each record includes a `recordDate` showing when it was last synced upstream.

**Are there rate limits?**
The Socrata API allows unauthenticated access with reasonable limits. Supplying a free Socrata app token (optional) raises those limits, but the actor works without one.

**How does the "search near a location" filter work?**
Set both `nearLatitude` and `nearLongitude` (and optionally `nearRadiusMeters`, default 500m) to only return inspections within that radius of a point. Setting only one of the two coordinates disables the filter — both are required together. This is combined with all other filters (borough, grade, date range, etc.) using AND.

**What fields are NOT included in the output?**
The source dataset includes four `:@computed_region_*` columns (internal Socrata IDs mapping each row to a police precinct, community district, borough boundary, and city council district boundary). These are opaque numeric IDs that only resolve to anything meaningful via a separate GIS boundary-file join, so they're excluded — the human-readable `communityBoard` and `councilDistrict` fields are included instead.

# Actor input Schema

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

What to fetch.

## `searchQuery` (type: `string`):

Free-text search across restaurant name, cuisine, and other text fields (mode=search). Leave blank to browse without a text query.

## `dbaKeyword` (type: `string`):

Case-insensitive substring match on the restaurant's DBA ("doing business as") name (mode=search). Example: `starbucks`.

## `camisIds` (type: `array`):

Unique restaurant identifiers (CAMIS numbers) to fetch full inspection history for. Example: `41235305`.

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

Filter to a single NYC borough.

## `cuisineDescription` (type: `string`):

Filter to a single cuisine type, as classified by DOHMH.

## `grade` (type: `string`):

Filter to a single official inspection grade.

## `criticalFlag` (type: `string`):

Filter by whether the cited violation was flagged as critical.

## `actionType` (type: `string`):

Filter by the outcome/action recorded for the inspection.

## `inspectionType` (type: `string`):

Filter by the DOHMH inspection program and phase.

## `inspectionDateFrom` (type: `string`):

Drop inspections before this date.

## `inspectionDateTo` (type: `string`):

Drop inspections after this date.

## `zipcode` (type: `string`):

Filter to a single 5-digit NYC ZIP code, e.g. `10013`.

## `minScore` (type: `integer`):

Drop inspections scoring below this (higher score = more violation points).

## `maxScore` (type: `integer`):

Drop inspections scoring above this.

## `nearLatitude` (type: `number`):

Latitude of a point to search near (mode=search). Must be combined with `nearLongitude` — both are required together to activate the radius filter. Example: `40.7580` (Times Square).

## `nearLongitude` (type: `number`):

Longitude of a point to search near (mode=search). Must be combined with `nearLatitude`. Example: `-73.9855` (Times Square).

## `nearRadiusMeters` (type: `integer`):

Radius in meters around the `nearLatitude`/`nearLongitude` point. Only applied when both coordinates are set.

## `sortBy` (type: `string`):

Sort order for results.

## `appToken` (type: `string`):

Optional free Socrata app token to raise API rate limits. Get one at https://data.cityofnewyork.us/profile/app\_tokens. Not required — the actor works without it.

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "camisIds": [],
  "borough": "",
  "cuisineDescription": "",
  "grade": "",
  "criticalFlag": "",
  "actionType": "",
  "inspectionType": "",
  "nearRadiusMeters": 500,
  "sortBy": "inspectionDateDesc",
  "maxItems": 50
}
```

# Actor output Schema

## `inspections` (type: `string`):

Dataset containing all scraped NYC restaurant inspection records.

# 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 = {
    "mode": "search",
    "camisIds": [],
    "borough": "",
    "cuisineDescription": "",
    "grade": "",
    "criticalFlag": "",
    "actionType": "",
    "inspectionType": "",
    "nearRadiusMeters": 500,
    "sortBy": "inspectionDateDesc",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/nyc-restaurant-inspection-scraper").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 = {
    "mode": "search",
    "camisIds": [],
    "borough": "",
    "cuisineDescription": "",
    "grade": "",
    "criticalFlag": "",
    "actionType": "",
    "inspectionType": "",
    "nearRadiusMeters": 500,
    "sortBy": "inspectionDateDesc",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/nyc-restaurant-inspection-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "search",
  "camisIds": [],
  "borough": "",
  "cuisineDescription": "",
  "grade": "",
  "criticalFlag": "",
  "actionType": "",
  "inspectionType": "",
  "nearRadiusMeters": 500,
  "sortBy": "inspectionDateDesc",
  "maxItems": 50
}' |
apify call crawlerbros/nyc-restaurant-inspection-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/nyc-restaurant-inspection-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "NYC Restaurant Inspection Scraper",
        "description": "Scrape the official NYC DOHMH Restaurant Inspection Results open dataset. Search or filter by borough, cuisine, grade, inspection type, critical flag, ZIP code, or date range; look up a restaurant's full inspection history by CAMIS ID. Free public Socrata API, no login required.",
        "version": "1.0",
        "x-build-id": "MTmOiNt1dLo7lLKqc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~nyc-restaurant-inspection-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-nyc-restaurant-inspection-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~nyc-restaurant-inspection-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-nyc-restaurant-inspection-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~nyc-restaurant-inspection-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-nyc-restaurant-inspection-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "byCamis"
                        ],
                        "type": "string",
                        "description": "What to fetch.",
                        "default": "search"
                    },
                    "searchQuery": {
                        "title": "Full-text search",
                        "type": "string",
                        "description": "Free-text search across restaurant name, cuisine, and other text fields (mode=search). Leave blank to browse without a text query."
                    },
                    "dbaKeyword": {
                        "title": "Restaurant name contains",
                        "type": "string",
                        "description": "Case-insensitive substring match on the restaurant's DBA (\"doing business as\") name (mode=search). Example: `starbucks`."
                    },
                    "camisIds": {
                        "title": "CAMIS IDs (mode=byCamis)",
                        "type": "array",
                        "description": "Unique restaurant identifiers (CAMIS numbers) to fetch full inspection history for. Example: `41235305`.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "borough": {
                        "title": "Borough",
                        "enum": [
                            "",
                            "Manhattan",
                            "Brooklyn",
                            "Queens",
                            "Bronx",
                            "Staten Island",
                            "0"
                        ],
                        "type": "string",
                        "description": "Filter to a single NYC borough.",
                        "default": ""
                    },
                    "cuisineDescription": {
                        "title": "Cuisine",
                        "enum": [
                            "",
                            "Afghan",
                            "African",
                            "American",
                            "Armenian",
                            "Asian/Asian Fusion",
                            "Australian",
                            "Bagels/Pretzels",
                            "Bakery Products/Desserts",
                            "Bangladeshi",
                            "Barbecue",
                            "Basque",
                            "Bottled Beverages",
                            "Brazilian",
                            "Cajun",
                            "Californian",
                            "Caribbean",
                            "Chicken",
                            "Chilean",
                            "Chimichurri",
                            "Chinese",
                            "Chinese/Cuban",
                            "Chinese/Japanese",
                            "Coffee/Tea",
                            "Continental",
                            "Creole",
                            "Creole/Cajun",
                            "Czech",
                            "Donuts",
                            "Eastern European",
                            "Egyptian",
                            "English",
                            "Ethiopian",
                            "Filipino",
                            "French",
                            "Frozen Desserts",
                            "Fruits/Vegetables",
                            "Fusion",
                            "German",
                            "Greek",
                            "Hamburgers",
                            "Haute Cuisine",
                            "Hawaiian",
                            "Hotdogs",
                            "Hotdogs/Pretzels",
                            "Indian",
                            "Indonesian",
                            "Iranian",
                            "Irish",
                            "Italian",
                            "Japanese",
                            "Jewish/Kosher",
                            "Juice, Smoothies, Fruit Salads",
                            "Korean",
                            "Latin American",
                            "Lebanese",
                            "Mediterranean",
                            "Mexican",
                            "Middle Eastern",
                            "Moroccan",
                            "New American",
                            "New French",
                            "Not Listed/Not Applicable",
                            "Nuts/Confectionary",
                            "Other",
                            "Pakistani",
                            "Pancakes/Waffles",
                            "Peruvian",
                            "Pizza",
                            "Polish",
                            "Polynesian",
                            "Portuguese",
                            "Russian",
                            "Salads",
                            "Sandwiches",
                            "Sandwiches/Salads/Mixed Buffet",
                            "Scandinavian",
                            "Seafood",
                            "Soul Food",
                            "Soups",
                            "Soups/Salads/Sandwiches",
                            "Southeast Asian",
                            "Southwestern",
                            "Spanish",
                            "Steakhouse",
                            "Tapas",
                            "Tex-Mex",
                            "Thai",
                            "Turkish",
                            "Vegan",
                            "Vegetarian"
                        ],
                        "type": "string",
                        "description": "Filter to a single cuisine type, as classified by DOHMH.",
                        "default": ""
                    },
                    "grade": {
                        "title": "Grade",
                        "enum": [
                            "",
                            "A",
                            "B",
                            "C",
                            "N",
                            "P",
                            "Z"
                        ],
                        "type": "string",
                        "description": "Filter to a single official inspection grade.",
                        "default": ""
                    },
                    "criticalFlag": {
                        "title": "Critical violation flag",
                        "enum": [
                            "",
                            "Critical",
                            "Not Critical",
                            "Not Applicable"
                        ],
                        "type": "string",
                        "description": "Filter by whether the cited violation was flagged as critical.",
                        "default": ""
                    },
                    "actionType": {
                        "title": "Inspection action",
                        "enum": [
                            "",
                            "Violations were cited in the following area(s).",
                            "Establishment Closed by DOHMH. Violations were cited in the following area(s) and those requiring immediate action were addressed.",
                            "No violations were recorded at the time of this inspection.",
                            "Establishment re-opened by DOHMH.",
                            "Establishment re-closed by DOHMH."
                        ],
                        "type": "string",
                        "description": "Filter by the outcome/action recorded for the inspection.",
                        "default": ""
                    },
                    "inspectionType": {
                        "title": "Inspection type",
                        "enum": [
                            "",
                            "Accelerated Inspection Program / Initial Inspection",
                            "Accelerated Inspection Program / Reopening Inspection",
                            "Accelerated Inspection Program / Second Compliance Inspection",
                            "Administrative Miscellaneous / Compliance Inspection",
                            "Administrative Miscellaneous / Initial Inspection",
                            "Administrative Miscellaneous / Re-inspection",
                            "Administrative Miscellaneous / Reopening Inspection",
                            "Administrative Miscellaneous / Second Compliance Inspection",
                            "Calorie Posting / Compliance Inspection",
                            "Calorie Posting / Initial Inspection",
                            "Calorie Posting / Re-inspection",
                            "Cycle Inspection / Compliance Inspection",
                            "Cycle Inspection / Initial Inspection",
                            "Cycle Inspection / Re-inspection",
                            "Cycle Inspection / Reopening Inspection",
                            "Cycle Inspection / Second Compliance Inspection",
                            "Inter-Agency Task Force / Initial Inspection",
                            "Inter-Agency Task Force / Re-inspection",
                            "Pre-permit (Non-operational) / Compliance Inspection",
                            "Pre-permit (Non-operational) / Initial Inspection",
                            "Pre-permit (Non-operational) / Re-inspection",
                            "Pre-permit (Non-operational) / Second Compliance Inspection",
                            "Pre-permit (Operational) / Compliance Inspection",
                            "Pre-permit (Operational) / Initial Inspection",
                            "Pre-permit (Operational) / Re-inspection",
                            "Pre-permit (Operational) / Reopening Inspection",
                            "Pre-permit (Operational) / Second Compliance Inspection",
                            "Smoke-Free Air Act / Compliance Inspection",
                            "Smoke-Free Air Act / Initial Inspection",
                            "Smoke-Free Air Act / Re-inspection",
                            "Sodium Warning / Initial Inspection",
                            "Sodium Warning / Re-inspection",
                            "Trans Fat / Compliance Inspection",
                            "Trans Fat / Initial Inspection",
                            "Trans Fat / Re-inspection",
                            "Trans Fat / Second Compliance Inspection"
                        ],
                        "type": "string",
                        "description": "Filter by the DOHMH inspection program and phase.",
                        "default": ""
                    },
                    "inspectionDateFrom": {
                        "title": "Inspection date from (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Drop inspections before this date."
                    },
                    "inspectionDateTo": {
                        "title": "Inspection date to (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Drop inspections after this date."
                    },
                    "zipcode": {
                        "title": "ZIP code",
                        "type": "string",
                        "description": "Filter to a single 5-digit NYC ZIP code, e.g. `10013`."
                    },
                    "minScore": {
                        "title": "Min inspection score",
                        "minimum": 0,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Drop inspections scoring below this (higher score = more violation points)."
                    },
                    "maxScore": {
                        "title": "Max inspection score",
                        "minimum": 0,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Drop inspections scoring above this."
                    },
                    "nearLatitude": {
                        "title": "Near latitude",
                        "minimum": -90,
                        "maximum": 90,
                        "type": "number",
                        "description": "Latitude of a point to search near (mode=search). Must be combined with `nearLongitude` — both are required together to activate the radius filter. Example: `40.7580` (Times Square)."
                    },
                    "nearLongitude": {
                        "title": "Near longitude",
                        "minimum": -180,
                        "maximum": 180,
                        "type": "number",
                        "description": "Longitude of a point to search near (mode=search). Must be combined with `nearLatitude`. Example: `-73.9855` (Times Square)."
                    },
                    "nearRadiusMeters": {
                        "title": "Near radius (meters)",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Radius in meters around the `nearLatitude`/`nearLongitude` point. Only applied when both coordinates are set.",
                        "default": 500
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "inspectionDateDesc",
                            "inspectionDateAsc",
                            "scoreDesc",
                            "scoreAsc",
                            "dbaAsc",
                            "boroAsc",
                            "zipcodeAsc",
                            "cuisineAsc"
                        ],
                        "type": "string",
                        "description": "Sort order for results.",
                        "default": "inspectionDateDesc"
                    },
                    "appToken": {
                        "title": "Socrata app token (optional)",
                        "type": "string",
                        "description": "Optional free Socrata app token to raise API rate limits. Get one at https://data.cityofnewyork.us/profile/app_tokens. Not required — the actor works without it."
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Hard cap on emitted records.",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
