# Restaurant Inspection Data Scraper - 7 US Cities (`maydit/us-restaurant-inspections-scraper`) Actor

Restaurant inspection data scraper for 7 US cities in one normalized schema: health grades, scores, violation detail, geocodes. Export CSV/JSON or monitor for new results.

- **URL**: https://apify.com/maydit/us-restaurant-inspections-scraper.md
- **Developed by:** [Brandt May](https://apify.com/maydit) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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/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

## Restaurant Inspection Data Scraper - 7 US Cities

> One restaurant inspection data scraper that unifies 7 US city and county health portals into a single normalized schema - grades, scores, violation detail, and geocodes included.

### What it does

This restaurant health inspection API pulls food inspection data from **7 US city and county open-data portals** - NYC, Chicago, Cincinnati, Austin, King County (Seattle), Boulder County (CO), and Montgomery County (MD) - and normalizes them into **one consistent schema**. Every competing actor is single-city (usually NYC-only), which forces you to run and reconcile multiple scrapers with mismatched fields. This food inspection data scraper does the reconciliation for you: one run returns restaurant health grades, numeric scores, risk levels, and full violation detail across all cities, ready to export as CSV or JSON.

You choose the **granularity** - one row per violation for detailed food safety analysis, or one row per inspection for a rollup view - and filter by city, date range, business name, or result.

### Who it's for

- **Food-safety monitoring teams** tracking new violations and failed inspections across multiple markets
- **Journalists and investigators** building restaurant inspection datasets for reporting
- **Restaurant-tech and real estate** platforms scoring locations by health history
- **Insurers and risk analysts** underwriting food-service businesses
- **Consumer apps** (food delivery, review, discovery) surfacing health grades and scores

### What you get / Output

Each record is normalized to the same fields regardless of source city:

| Field | Description |
|---|---|
| `sourceCity` | Which of the 7 portals the record came from |
| `businessName` | Name of the establishment |
| `businessId` | Source-portal identifier for the establishment |
| `facilityType` | Type of facility (e.g. restaurant, mobile vendor) |
| `address` | Street address |
| `zip` | ZIP code |
| `inspectionDate` | Date of the inspection |
| `inspectionType` | Type of inspection (routine, complaint, re-inspection, etc.) |
| `result` | Inspection outcome (e.g. pass, fail) |
| `score` | Numeric inspection score where the city reports one |
| `grade` | Letter/health grade where the city reports one |
| `riskLevel` | Risk category where the city reports one |
| `violationCode` | Code for the specific violation |
| `violationDescription` | Text description of the violation |
| `critical` | Whether the violation is flagged critical |
| `latitude` | Geocoded latitude |
| `longitude` | Geocoded longitude |
| `granularity` | Whether the row is a `violation` or `inspection` record |

> Not every city publishes every field (for example, letter grades and numeric scores vary by jurisdiction). Fields are populated where the source portal provides them and left empty otherwise - the schema stays constant so your downstream code never breaks.

### Input / How to query

Configure the run with these filters and modes:

- **cities** - pick any subset of the 7 supported portals, or all of them
- **inspection date range** - limit results to a start/end window
- **business name** - target a specific establishment or chain
- **result contains** - filter by outcome text (e.g. `fail`)
- **granularity** - `violation` (one row per violation) or `inspection` (one row per inspection)

### Example use cases

- **Multi-city violation monitoring** - pull `granularity: violation` for NYC, Chicago, and Seattle on a nightly schedule and alert when new `critical` violations appear.
- **Health-grade enrichment for a delivery app** - fetch `grade`, `score`, and `result` per `businessName` and `address` to display trust signals next to listings.
- **Investigative reporting** - export failed inspections (`result contains: fail`) across all 7 cities for a date range, then map them with `latitude`/`longitude`.
- **Real-estate site scoring** - join `zip`, `facilityType`, and `riskLevel` to evaluate the food-service risk profile of a commercial location.
- **Insurance underwriting** - build a per-establishment inspection history keyed on `businessId` to price food-service policies.

### Recurring use / scheduling

Set up a **schedule** in Apify (for example, daily or weekly) to keep an inspection dataset current for monitoring. Because each record carries `businessId`, `inspectionDate`, and `violationCode`, you can dedupe incremental runs on that combination and flag only genuinely new inspections or violations - ideal for a restaurant inspection monitoring API that surfaces fresh failures and health-grade changes.

### FAQ

### How do I get restaurant health inspection data for multiple US cities?

Run this actor with the cities you need selected. It returns normalized inspection records - grades, scores, and violations - for any subset of NYC, Chicago, Cincinnati, Austin, King County (Seattle), Boulder County (CO), and Montgomery County (MD) in a single dataset.

### Is there an API for restaurant inspection scores and grades?

Yes. This actor exposes inspection `score`, `grade`, `result`, and `riskLevel` fields through the Apify API and dataset exports, so you can pull them programmatically wherever the source city publishes them.

### How do I download NYC and Chicago restaurant inspection data as CSV?

Select NYC and Chicago as your cities, run the actor, and export the resulting dataset as CSV (JSON, Excel, and other formats are also available). Both cities come back in the same normalized schema, so there's nothing to reconcile.

### How can I monitor restaurant health inspection results for new violations?

Schedule the actor to run on an interval with `granularity: violation`, then dedupe on `businessId` + `inspectionDate` + `violationCode` to detect records you haven't seen before - especially those flagged `critical`.

### Where can I get restaurant food safety violation data in bulk?

Run with `granularity: violation` and a broad date range across all 7 cities to pull violation-level records - including `violationCode`, `violationDescription`, and the `critical` flag - in one export.

### How do I normalize restaurant inspection grades across different cities?

That's the core job of this actor. Each of the 7 portals uses different field names and formats; the actor maps them all to one schema (`grade`, `score`, `result`, `riskLevel`, and more) so grades are comparable across cities.

### What is the best restaurant inspection data API for a food delivery or review app?

For multi-city coverage in a single schema, this actor is purpose-built for it: pull `grade`, `score`, `result`, `address`, and geocodes per establishment and drop them straight into your app's listings without stitching together separate single-city scrapers.

### How do journalists get restaurant inspection records for investigations?

Filter by date range, `result contains: fail`, and the cities in scope, then export the full dataset with violation detail and `latitude`/`longitude` for mapping and analysis - all from public health-department records.

### Data source & notes

Data comes from the **official public open-data portals** operated by each city or county (NYC, Chicago, Cincinnati, Austin, King County/Seattle, Boulder County CO, and Montgomery County MD), served via their Socrata open-data APIs. These are public government records published by the respective health departments.

Notes and limitations:

- Field coverage varies by city - jurisdictions that don't issue letter grades or numeric scores will leave `grade`/`score` empty, while the rest of the schema stays consistent.
- Data freshness reflects whatever each portal has published; the actor does not add records beyond what the source provides.
- Coverage is limited to the 7 supported portals listed above.

# Actor input Schema

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

Which cities/counties to scrape. Leave empty for all supported.
## `inspectedSince` (type: `string`):

Only inspections on or after this date (YYYY-MM-DD). Great for weekly monitoring.
## `inspectedUntil` (type: `string`):

Only inspections on or before this date (YYYY-MM-DD).
## `businessName` (type: `string`):

Only records whose restaurant name contains this text (case-insensitive), e.g. 'pizza', 'Starbucks'. Leave empty for all.
## `resultContains` (type: `string`):

Only records whose result/grade contains this text (case-insensitive), e.g. 'fail', 'C', 'not in compliance'. Leave empty for all.
## `maxResultsPerCity` (type: `integer`):

Upper bound on records returned per city per run.
## `socrataAppToken` (type: `string`):

Optional free Socrata app token for higher rate limits on large or scheduled runs. Not required for normal use.

## Actor input object example

```json
{
  "cities": [
    "new_york",
    "chicago",
    "cincinnati",
    "austin",
    "king_county",
    "boulder_county",
    "montgomery_county"
  ],
  "inspectedSince": "2026-06-01",
  "maxResultsPerCity": 500
}
````

# 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("maydit/us-restaurant-inspections-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("maydit/us-restaurant-inspections-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 '{}' |
apify call maydit/us-restaurant-inspections-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Restaurant Inspection Data Scraper - 7 US Cities",
        "description": "Restaurant inspection data scraper for 7 US cities in one normalized schema: health grades, scores, violation detail, geocodes. Export CSV/JSON or monitor for new results.",
        "version": "1.0",
        "x-build-id": "PTo7dN3ZBo7O2HuJ9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maydit~us-restaurant-inspections-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maydit-us-restaurant-inspections-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/maydit~us-restaurant-inspections-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maydit-us-restaurant-inspections-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/maydit~us-restaurant-inspections-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maydit-us-restaurant-inspections-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",
                "properties": {
                    "cities": {
                        "title": "Cities",
                        "type": "array",
                        "description": "Which cities/counties to scrape. Leave empty for all supported.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "new_york",
                                "chicago",
                                "cincinnati",
                                "austin",
                                "king_county",
                                "boulder_county",
                                "montgomery_county"
                            ],
                            "enumTitles": [
                                "New York, NY",
                                "Chicago, IL",
                                "Cincinnati, OH",
                                "Austin, TX",
                                "King County (Seattle), WA",
                                "Boulder County, CO",
                                "Montgomery County, MD"
                            ]
                        },
                        "default": [
                            "new_york",
                            "chicago",
                            "cincinnati",
                            "austin",
                            "king_county",
                            "boulder_county",
                            "montgomery_county"
                        ]
                    },
                    "inspectedSince": {
                        "title": "Inspected since",
                        "type": "string",
                        "description": "Only inspections on or after this date (YYYY-MM-DD). Great for weekly monitoring."
                    },
                    "inspectedUntil": {
                        "title": "Inspected until",
                        "type": "string",
                        "description": "Only inspections on or before this date (YYYY-MM-DD)."
                    },
                    "businessName": {
                        "title": "Business name contains",
                        "type": "string",
                        "description": "Only records whose restaurant name contains this text (case-insensitive), e.g. 'pizza', 'Starbucks'. Leave empty for all."
                    },
                    "resultContains": {
                        "title": "Result contains",
                        "type": "string",
                        "description": "Only records whose result/grade contains this text (case-insensitive), e.g. 'fail', 'C', 'not in compliance'. Leave empty for all."
                    },
                    "maxResultsPerCity": {
                        "title": "Max results per city",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Upper bound on records returned per city per run.",
                        "default": 500
                    },
                    "socrataAppToken": {
                        "title": "Socrata app token (optional)",
                        "type": "string",
                        "description": "Optional free Socrata app token for higher rate limits on large or scheduled runs. Not required for normal use."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
