# Restaurant Health Inspections – Food Safety Scores (`gazidev/restaurant-inspections`) Actor

Restaurant health inspection results from official US health departments (NYC, Chicago, Austin, NY State, Seattle/King County, Montgomery County MD, Delaware, Marin, Boulder, Cincinnati): grades, scores, pass/fail, closures and violations, one row per inspection. $1 per 1,000 inspections.

- **URL**: https://apify.com/gazidev/restaurant-inspections.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 inspections

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

## Restaurant Health Inspections – Food Safety Scores & Violations (US cities)

Get **restaurant health inspection results** from official US city, county and state health departments in one clean schema: establishment name and address, inspection date and type, **pass / fail / closed**, letter grade or score, and the **list of violations** (code, description, critical flag), plus license/permit ID, facility type and coordinates.

New York City and several other health departments publish one row per violation. This Actor **groups them into one record per inspection**, so you get one row per inspection with its violations attached.

All data comes from the agencies' own open-data portals (Socrata APIs). No scraping, no login, no API key.

**$1 per 1,000 inspections.** You pay only for inspections saved.

### Who uses it

- **Pest control, cleaning, grease-trap and hood-cleaning companies**: restaurants that just failed for *rodents/insects*, *dirty surfaces* or *ventilation hoods* are warm leads.
- **Food-safety consultants and trainers**: places with critical violations, failed inspections or missing certified food managers.
- **Restaurant buyers, landlords, franchisors and lenders**: inspection history of a location or a chain before you sign.
- **Food delivery, review and map apps**: show official grades and scores next to listings.
- **Journalists and researchers**: closures, worst scores and trends by ZIP code or neighborhood.

### Jurisdictions

| Code | Health department / dataset | Score / result | Violations | Updated |
|---|---|---|---|---|
| `NYC` | New York City DOHMH – Restaurant Inspection Results | Grade A/B/C, points (lower = better), closures | code, text, critical | daily |
| `CHI` | Chicago Dept. of Public Health – Food Inspections | Pass / Pass w/ Conditions / Fail, risk level | number, title, inspector comments, priority flag | daily |
| `AUS` | Austin Public Health – Inspection Scores (Austin, Pflugerville, Manor, Lakeway...) | Score 0-100 (higher = better, <70 fails) | – | monthly |
| `NYS` | New York State DOH – Food Service Inspections (outside NYC) | Critical / not-corrected counts | code, text, critical | weekly |
| `KING` | Public Health – Seattle & King County | Satisfactory / Unsatisfactory, points, Excellent/Good/Okay rating, closures | text, red (critical) / blue, points | daily |
| `MOCO` | Montgomery County, MD – Food Inspections | Pass / Fail / Closed | risk-factor items not in compliance | daily |
| `DE` | Delaware Office of Food Protection (statewide) | – (violations only) | FDA Food Code citation + text | weekly |
| `MARIN` | Marin County, CA Environmental Health | Green / Yellow / Red placard | CA code, inspector notes, major flag | daily |
| `BOULDER` | Boulder County, CO Public Health | Pass / Reinspection Required / Closure, points | item, text, priority flag | monthly |
| `CIN` | Cincinnati Health Department – Food Safety Program | Approved / Not in compliance | code, text, inspector comments | daily |

Choose `ALL` to search every jurisdiction.

### Input examples

Restaurants in NYC and Chicago that **failed or were closed** in the last 14 days with critical violations:

```json
{
  "jurisdictions": ["NYC", "CHI"],
  "withinDays": 14,
  "results": ["fail", "closed"],
  "onlyWithCriticalViolations": true
}
```

Inspection history of one restaurant chain in Seattle-area ZIP codes:

```json
{ "jurisdictions": ["KING"], "nameContains": "starbucks", "zipCodes": ["981"], "withinDays": 365 }
```

NYC C-grade range (28+ points) in Brooklyn this month:

```json
{ "jurisdictions": ["NYC"], "cities": ["Brooklyn"], "minScore": 28, "withinDays": 30 }
```

Daily feed of new inspections everywhere (schedule it):

```json
{ "jurisdictions": ["ALL"], "withinDays": 7, "onlyNew": true, "maxResults": 0 }
```

#### Filters

| Field | Meaning |
|---|---|
| `jurisdictions` | Codes from the table, or `ALL` |
| `withinDays` / `inspectedAfter` / `inspectedBefore` | Inspection date range |
| `results` | `pass`, `conditional`, `fail`, `closed` (normalized, see below) |
| `onlyWithCriticalViolations` | At least one critical / priority / red / major violation |
| `minViolations` | At least N violations cited |
| `minScore` / `maxScore` | Only for datasets with a numeric score (NYC, AUS, KING, BOULDER) |
| `nameContains`, `zipCodes`, `cities` | Name, ZIP (or prefix) and city / NYC borough |
| `maxResults`, `maxResultsPerJurisdiction` | Limits (you pay per inspection saved) |
| `onlyNew` + `stateKey` | Monitoring: skip inspections returned in earlier runs |
| `includeViolations` | Turn off for a slim table (counts stay) |

#### How `resultCategory` is normalized

| Jurisdiction | pass | conditional | fail | closed |
|---|---|---|---|---|
| NYC | 0-13 points (A range) or no violations | 14-27 | 28+ | Closed / re-closed by DOHMH |
| CHI | Pass | Pass w/ Conditions | Fail | – (Out of Business, No Entry... = `other`) |
| AUS | 90-100 | 70-89 | < 70 | – |
| NYS | no critical violations | critical, all corrected | critical not corrected | – |
| KING | Satisfactory | – | Unsatisfactory | business closed at inspection |
| MOCO | Pass | – | Fail | Closed |
| MARIN | Green placard | Yellow | (no placard) violations found | Red placard |
| BOULDER | Pass | – | Reinspection Required | Closure |
| CIN | Approved / abated | Minor violations / abated on site | Not in compliance / not abated | – |
| DE | not published (`null`) | | | |

The original wording is always kept in `result`.

### Output

One record per inspection (sample, NYC):

```json
{
  "jurisdiction": "NYC",
  "jurisdictionName": "New York City, NY",
  "establishmentName": "V & S PIZZERIA OF SHEAPSHEAD BAY",
  "address": "1723 EMMONS AVENUE",
  "city": "Brooklyn",
  "state": "NY",
  "zip": "11235",
  "inspectionDate": "2026-10-17",
  "inspectionType": "Cycle Inspection / Re-inspection",
  "resultCategory": "pass",
  "result": "Violations were cited in the following area(s).",
  "grade": "A",
  "score": 11,
  "scoreNote": "NYC points: lower is better (0-13 = A, 14-27 = B, 28+ = C)",
  "violationCount": 2,
  "criticalViolationCount": 1,
  "violations": [
    { "code": "02B", "description": "Hot TCS food item not held at or above 140 °F.", "critical": true },
    { "code": "10F", "description": "Non-food contact surface or equipment made of unacceptable material, not kept clean...", "critical": false }
  ],
  "facilityType": "Restaurant",
  "licenseId": "40393413",
  "establishmentId": "40393413",
  "inspectionId": "40393413-2026-10-17",
  "latitude": 40.58337,
  "longitude": -73.951276,
  "borough": "Brooklyn",
  "phone": "(718) 332-7300",
  "cuisine": "Pizza",
  "source": "NYC Department of Health and Mental Hygiene - DOHMH New York City Restaurant Inspection Results",
  "sourceUrl": "https://data.cityofnewyork.us/d/43nn-pn8j"
}
```

Extra fields by jurisdiction: `akaName`, `riskCategory` (Chicago, King), `operatorName`, `corporationName`, `county`, `permitExpirationDate`, `inspectorComments` (NY State), `ownerName` (Montgomery), `phone` (NYC, Cincinnati), `seating` (King), violation `comments` (Chicago, Boulder, Cincinnati) and `points` (King). Fields a dataset does not publish are `null`.

### Pricing

Pay per event: **$0.001 per inspection saved** ($1 per 1,000), plus a tiny start fee. Set **Max inspections** or a maximum cost per run; the run stops cleanly at that limit. Error rows are free.

| | This Actor | Typical single-city inspection scrapers |
|---|---|---|
| Coverage | 10 official jurisdictions, one schema | 1 city |
| Violations | grouped per inspection, critical flag | often one row per violation |
| Monitoring | built-in `onlyNew` | – |
| Price | $1 / 1,000 inspections | similar or higher |

### Use with AI agents (Apify MCP)

Add this Actor to Claude, ChatGPT or any MCP client through the [Apify MCP server](https://mcp.apify.com) and ask, for example: *"Which Chicago restaurants failed a health inspection this week for rodents?"* or *"Show the inspection history of 'Joe's Pizza' in NYC."* The flat, documented output is easy for agents to filter and summarize.

### FAQ

**How fresh is the data?** As fresh as each health department's portal (most update daily; see the table). The Actor queries the live API on every run.

**Can I get all inspections of one restaurant?** Yes: `nameContains` plus a ZIP code, with no date filter (or `withinDays: 3650`).

**Why do scores mean different things?** Each agency has its own system. Use `resultCategory` for a common pass/fail view; `scoreNote` explains each score.

**Are these all restaurants?** They include every food establishment the department inspects: restaurants, bars, cafes, grocery stores, schools, daycares, food trucks and caterers. Use `facilityType` to filter.

**Why are some coordinates missing?** King County and some NY State records have no published coordinates.

**Is this legal to use?** Yes. All sources are official public open-data portals. Always check the agency's site before publishing claims about a specific business; inspection results are a snapshot of one visit.

### Data sources and terms

NYC Department of Health and Mental Hygiene (data.cityofnewyork.us), City of Chicago (data.cityofchicago.org, terms of use), City of Austin (datahub.austintexas.gov, public domain), New York State Department of Health (health.data.ny.gov), Public Health – Seattle & King County (data.kingcounty.gov, public domain), Montgomery County MD (data.montgomerycountymd.gov, public domain), Delaware Division of Public Health (data.delaware.gov, public domain), County of Marin (data.marincounty.gov, ODbL), Boulder County Public Health (data.colorado.gov, public domain), City of Cincinnati (data.cincinnati-oh.gov, public domain). This Actor is not affiliated with or endorsed by these agencies.

### Related Actors

- [Code Violation Leads](https://apify.com/gazidev/code-violation-leads)
- [Liquor License Leads](https://apify.com/gazidev/liquor-license-leads)
- [Building Permits Search – US City Construction Leads](https://apify.com/gazidev/building-permits-search)

# Actor input Schema

## `jurisdictions` (type: `array`):

Which official health-department datasets to search.

## `withinDays` (type: `integer`):

Only inspections from the last N days (0 = any date). Fresh leads: 7-30.

## `inspectedAfter` (type: `string`):

YYYY-MM-DD. Overrides *last N days*.

## `inspectedBefore` (type: `string`):

YYYY-MM-DD. Optional upper bound.

## `results` (type: `array`):

Normalized result category (see README for how each city maps). Empty = all. Delaware publishes no result and is skipped when this is set.

## `onlyWithCriticalViolations` (type: `boolean`):

Critical / priority / red / major violations (NYC, Chicago, NY State, King County, Montgomery County, Marin, Boulder). Datasets without a critical flag are skipped.

## `minViolations` (type: `integer`):

E.g. 3 = only inspections with 3+ violations cited.

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

Only jurisdictions with a numeric score (NYC, Austin, King County, Boulder). Meaning differs: NYC/King/Boulder points (lower = better), Austin 0-100 (higher = better).

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

See *Min score*. E.g. Austin maxScore 69 = failed inspections; NYC minScore 28 = C-grade range.

## `nameContains` (type: `string`):

E.g. `pizza`, `starbucks`, `taco`.

## `zipCodes` (type: `array`):

E.g. `10001` or `100` (prefixes not supported for Chicago and Cincinnati - use full ZIPs).

## `cities` (type: `array`):

Exact city names, e.g. `Brooklyn`, `Seattle`, `Bellevue`, `Rochester`, `Pflugerville`.

## `includeViolations` (type: `boolean`):

Turn off for a slimmer table (counts are still included).

## `onlyNew` (type: `boolean`):

Skip inspections returned by earlier runs with the same *State key*. Schedule daily/weekly for a fresh-inspections feed.

## `stateKey` (type: `string`):

Separate 'already seen' lists for different searches.

## `maxResultsPerJurisdiction` (type: `integer`):

0 = no per-jurisdiction limit.

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

Stop after this many inspections in total (0 = all matching). You pay per inspection saved.

## `socrataAppToken` (type: `string`):

Optional free token for higher rate limits on very large exports.

## Actor input object example

```json
{
  "jurisdictions": [
    "NYC",
    "CHI"
  ],
  "withinDays": 14,
  "onlyWithCriticalViolations": false,
  "includeViolations": true,
  "onlyNew": false,
  "stateKey": "default",
  "maxResultsPerJurisdiction": 10,
  "maxResults": 20
}
```

# Actor output Schema

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

No description

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

No description

## `summary` (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 = {
    "jurisdictions": [
        "NYC",
        "CHI"
    ],
    "withinDays": 14,
    "maxResultsPerJurisdiction": 10,
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/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 = {
    "jurisdictions": [
        "NYC",
        "CHI",
    ],
    "withinDays": 14,
    "maxResultsPerJurisdiction": 10,
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/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 '{
  "jurisdictions": [
    "NYC",
    "CHI"
  ],
  "withinDays": 14,
  "maxResultsPerJurisdiction": 10,
  "maxResults": 20
}' |
apify call gazidev/restaurant-inspections --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/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/L5rVFVePJWmgCCp8S/builds/Vh5Qx5cjUXhXk1MoQ/openapi.json
