# NYC Restaurant Inspections (`zeiphr/nyc-restaurant-inspections`) Actor

Search New York City restaurant health inspection results by date, borough, grade, cuisine, name and zip code. One clean row per violation, paid per row.

- **URL**: https://apify.com/zeiphr/nyc-restaurant-inspections.md
- **Developed by:** [Zeiphr](https://apify.com/zeiphr) (community)
- **Categories:** Business, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 result rows

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?

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 Restaurant Inspections

Search the health inspection results for restaurants in New York City. You get one clean row per violation found at an inspection, with the restaurant's name, address, cuisine, the inspection date and type, the violation, whether it is critical, the score and the letter grade. No coding and no account with the City is needed: choose what you want and press Start.

### Who it is for

- **Food writers, journalists and researchers** looking at which restaurants or neighbourhoods struggle with inspections.
- **Restaurant groups, suppliers and franchise owners** who want to keep an eye on competitors, partners or their own sites.
- **Anyone** who wants a spreadsheet of recent inspections instead of clicking through the City's website.

### What you can set

| Field | What it does |
| --- | --- |
| Days to look back | How many days back from today to look, by the date of the inspection. Default 7. |
| From date / To date | Exact dates written YYYY-MM-DD. If you fill in "From date", "Days to look back" is ignored. Leaving "To date" empty means today. |
| Borough | Manhattan, Brooklyn, Queens, Bronx or Staten Island. Default is any. |
| Grade | A, B, C, N, Z or P. Default is any. See the grade letters below. |
| Critical violations only | Tick to return only violations flagged Critical, the kind most likely to make people ill. |
| Cuisine | Words in the cuisine description, for example `Pizza`. Capital letters do not matter. Optional. |
| Restaurant name | Words in the restaurant's name, for example `Joe`. Capital letters do not matter. Optional. |
| Zip code | One zip code, 5 digits, for example `10034`. Optional. |
| Maximum rows to return | The most rows you want back. Default 200, up to 10,000. It also caps what you pay. |

If you set none of borough, grade, cuisine, restaurant name or zip code, the date window must be 31 days or less, so a run cannot try to list every inspection in the city. If you set any of them, the window can be as long as you like.

### One row is one violation

A restaurant that gets three violations on one visit gives three rows with the same inspection date. A visit with no violations gives a single row with empty violation fields. Count `restaurantId` values if you want the number of restaurants rather than the number of rows. You are charged per row.

### The grade letters

- **A, B and C** are the letter grades posted in the restaurant's window. A is the best.
- **N** means not yet graded.
- **Z** means the grade is pending.
- **P** means the grade is pending after the restaurant reopened following a closure.

A grade is only given at certain inspections, so about half of all rows have no grade. In that case `grade` is `null`; the actor never guesses one.

### What you get

One row per violation, with these fields in this order: `restaurantId`, `name`, `borough`, `address`, `zipCode`, `phone` (10 digits, or `null` when the City's value is not a real number), `cuisine`, `inspectionDate`, `inspectionType`, `action`, `violationCode`, `violationDescription`, `isCritical` (true or false, `null` when the City marks it not applicable), `score` (higher is worse; `null` when not scored), `grade`, `gradeDate`, `latitude`, `longitude` (`null` when the City gave none), `communityBoard`, `councilDistrict`, `recordDate` (when the City last recorded the row) and `sourceUrl` (the exact request that returned the row). Anything missing in the source is `null`. Each violation at each inspection appears only once. Records the City lists for restaurants that have not been inspected yet are left out.

Sample row (from a real run on 4 November 2026, long address shortened):

```json
{
  "restaurantId": "50001770",
  "name": "OPUS",
  "borough": "Manhattan",
  "address": "417 WEST 202 STREET",
  "zipCode": "10034",
  "phone": "6463053807",
  "cuisine": "Latin American",
  "inspectionDate": "2026-10-29",
  "inspectionType": "Cycle Inspection / Initial Inspection",
  "action": "Violations were cited in the following area(s).",
  "violationCode": "04A",
  "violationDescription": "Food Protection Certificate (FPC) not held by manager or supervisor of food operations.",
  "isCritical": true,
  "score": 12,
  "grade": "A",
  "gradeDate": "2026-10-29",
  "latitude": 40.860735415268,
  "longitude": -73.919861653118,
  "communityBoard": "112",
  "councilDistrict": "10",
  "recordDate": "2026-10-30T06:00:20.000",
  "sourceUrl": "https://data.cityofnewyork.us/resource/43nn-pn8j.json?%24where=...&%24limit=50&%24offset=0"
}
```

### Pricing

You pay US$0.005 per row returned (US$5 per 1,000 rows), and nothing when there are no matches.

### Limits and tips

- **How fresh is it:** the City updates this data daily, and the newest inspection is usually a few days old, so a window of the last 1 or 2 days is often empty. Try 7 days or more.
- **Name and cuisine searches** match anywhere in the text,; they accept letters, numbers, spaces and the characters ' - & . , only.
- **Speed:** the actor reads up to 1,000 rows per request with a short pause between requests, so 10,000 rows takes under a minute or two. If the City's server is busy it waits and retries a few times before stopping with a clear message.

Data comes from NYC Open Data, published by the New York City Department of Health and Mental Hygiene under the NYC Open Data terms of use. This actor is not affiliated with the City of New York.

# Actor input Schema

## `days` (type: `integer`):

How many days back from today to look, based on the date of the inspection. Ignored if you fill in 'From date'. If you set no borough, grade, cuisine, name or zip code, this must be 31 or less so the run stays a sensible size.

## `dateFrom` (type: `string`):

Earliest inspection date to include, written YYYY-MM-DD (for example 2026-10-01). If you set this, 'Days to look back' is ignored.

## `dateTo` (type: `string`):

Latest inspection date to include, written YYYY-MM-DD (for example 2026-10-31). Leave empty to mean today.

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

Only return restaurants in one of the five boroughs (the five main areas of New York City). Choose 'any' for all of them.

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

Only return rows with this grade. A, B and C are the letter grades a restaurant posts in its window (A is best). N means not yet graded. Z means the grade is pending. P means the grade is pending after the restaurant reopened following a closure. Many rows have no grade at all, because a grade is only given at certain inspections. Choose 'any' for all rows.

## `criticalOnly` (type: `boolean`):

Tick this to return only violations the health department flags as critical, meaning the kind most likely to make people ill, such as food kept at unsafe temperatures.

## `cuisine` (type: `string`):

Only return restaurants whose cuisine description contains these words, ignoring capital letters. For example Pizza or Chinese.

## `restaurantName` (type: `string`):

Only return restaurants whose name contains these words, ignoring capital letters. For example Joe. Only letters, numbers, spaces and the characters ' - & . , are allowed.

## `zipCode` (type: `string`):

Only return restaurants in one zip code, written as 5 digits, for example 10034.

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

The most rows you want back. You are charged per row returned, so this also caps your cost. Remember one row is one violation, not one restaurant.

## Actor input object example

```json
{
  "days": 7,
  "borough": "any",
  "grade": "any",
  "criticalOnly": false,
  "maxResults": 200
}
```

# Actor output Schema

## `results` (type: `string`):

The inspection violation rows as a table.

# 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("zeiphr/nyc-restaurant-inspections").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("zeiphr/nyc-restaurant-inspections").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 zeiphr/nyc-restaurant-inspections --silent --output-dataset

```

## MCP server setup

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

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/097z0HwBkzQ1WUaf3/builds/zdPPIsrBEGnvFKrhs/openapi.json
