# US Restaurant Inspections Scraper (`straightforward_hydra/us-restaurant-inspections-scraper`) Actor

Restaurant & food health-inspection results from major US city open-data portals (NYC, Chicago, SF, Seattle, Austin). No key.

- **URL**: https://apify.com/straightforward\_hydra/us-restaurant-inspections-scraper.md
- **Developed by:** [Dev D](https://apify.com/straightforward_hydra) (community)
- **Categories:** Lead generation, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## US Restaurant Inspections Scraper 🍽️

**Restaurant & food health-inspection results from major US cities — NYC, Chicago, San Francisco, Seattle (King County) and Austin — straight from official city open-data portals. No API key, no proxy.**

Pull structured **health-inspection** records across the biggest US markets in one run: business name, address, inspection date, score/grade, result, violations, and geo-coordinates. Filter by name, date, ZIP, result, score, or a full-text keyword like `roach`, `rodent`, `mice` or `vermin`.

Perfect for **consumer food-safety apps**, restaurant-discovery products, journalism/data reporting, and **B2B lead generation** (failed inspections → leads for pest control, cleaning, and compliance consultants).

> Data comes from each city's **official open-data portal** (Socrata). Public, non-personal inspection records. No key required (an optional free Socrata app token raises rate limits).

---

### Supported cities

| City | State | Highlights |
|---|---|---|
| New York City | NY | Letter grade, score, critical flag, cuisine, per-violation detail |
| Chicago | IL | Pass/Fail result, risk level, full violation text |
| San Francisco | CA | Numeric score (100 = perfect) |
| King County (Seattle) | WA | Grade, score, result, violation points |
| Austin | TX | Numeric score (100 = perfect) |

One normalized schema across all of them — mix and match cities in a single run.

### Features

- ✅ **No API key, no proxy** — official open-data APIs, very low maintenance.
- ✅ **Full-text search** — `keyword` finds violations by word (`roach`, `rodent`…) on every city.
- ✅ **Newest first** — ordered by most recent inspection date.
- ✅ **Filter that matters** — by name, ZIP, borough, result (`fail`/`closed`), score range, date.
- ✅ **Normalized output** — same fields for every city; optional raw record included.

---

### Input

| Field | Description |
|---|---|
| **Cities** | Which cities to pull (default: all five). |
| **Business name contains** | Filter by restaurant name. |
| **Keyword** | Full-text search across all columns (`roach`, `rodent`, `mice`…). |
| **Result contains** | Filter by result/action (`fail`, `closed`…). |
| **Borough / city** | Filter by locality (where the city exposes it). |
| **ZIP codes** | Restrict to specific ZIPs. |
| **Min / Max score** | Score range (see the score-meaning note below). |
| **Inspected after / before** | Date range (YYYY-MM-DD). |
| **Max results per city** | How many inspections per selected city. |

> **Score meaning differs by city.** NYC & Seattle: **higher = worse** (violation points). SF & Austin: **higher = better** (100 = perfect). Chicago has no numeric score (uses Pass/Fail). Each output row carries a `score_meaning` field so you always know which way it runs.

#### Example — find rodent violations this year

```json
{
  "cities": ["nyc", "chicago"],
  "keyword": "rodent",
  "inspectedAfter": "2025-01-01",
  "maxResultsPerCity": 500
}
````

#### Example — failed Chicago inspections

```json
{
  "cities": ["chicago"],
  "resultContains": "fail",
  "maxResultsPerCity": 1000
}
```

### Output

```json
{
  "city": "New York City",
  "state": "NY",
  "business_name": "BAGEL EXPRESS III",
  "address": "340 3RD AVE",
  "locality": "Manhattan",
  "zip": "10010",
  "phone": "2125551234",
  "cuisine": "Bagels/Pretzels",
  "inspection_date": "2026-07-16",
  "inspection_type": "Cycle Inspection / Re-inspection",
  "score": 41,
  "grade": "N",
  "result": "Establishment Closed by DOHMH.",
  "critical_flag": "Critical",
  "violation_code": "04L",
  "violation_description": "Establishment is not free of harborage or conditions conducive to rodents...",
  "latitude": 40.74,
  "longitude": -73.98,
  "inspection_id": "50012345_2026-07-16",
  "score_meaning": "higher = worse (violation points)",
  "source_domain": "data.cityofnewyork.us",
  "dataset_id": "43nn-pn8j"
}
```

Field availability varies by city (e.g. Chicago has no score but rich violation text; SF/Austin are score-only).

### Run it on a schedule

Set `inspectedAfter` to yesterday and run daily to get a steady feed of **new inspections** — pipe them to Slack, Google Sheets, a CRM or a webhook.

### Notes & limitations

- Official city **Socrata** open-data APIs — public, non-personal inspection records.
- Coverage = the cities listed above; more can be added.
- Score semantics differ by city (documented above; also in each row's `score_meaning`).
- Data freshness depends on each city's own publishing cadence.

***

#### Keywords

restaurant inspections, food inspections, health inspections, restaurant grades, food safety, restaurant scraper, NYC restaurant inspections, Chicago food inspections, San Francisco restaurant scores, Seattle food establishment, Austin food inspection, restaurant violations, health code, restaurant data, food safety data, open data, Socrata, pest control leads, restaurant lead generation, DOHMH, restaurant hygiene.

# Actor input Schema

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

Which cities to pull inspections from. Leave empty for all supported cities.

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

Filter by restaurant name, e.g. "pizza", "starbucks", "taco".

## `keyword` (type: `string`):

Full-text search across all columns, e.g. "roach", "rodent", "vermin", "mice". Works on every city — great for finding violations.

## `resultContains` (type: `string`):

Filter by inspection result/action text, e.g. "fail", "closed", "unsatisfactory". Applied where the city exposes a result column.

## `locality` (type: `string`):

Filter by borough or locality, e.g. "Brooklyn", "Chicago". Applied where the city exposes a locality column.

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

Restrict to these ZIP codes, e.g. \["11231", "60602"].

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

Minimum inspection score. NOTE: score meaning differs by city — NYC & Seattle: HIGHER = worse (violation points); SF & Austin: HIGHER = better (100 = perfect). Chicago has no numeric score.

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

Maximum inspection score. See the score-meaning note on Min score.

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

Only inspections on/after this date (YYYY-MM-DD). Set to recent dates for fresh results.

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

Only inspections on/before this date (YYYY-MM-DD).

## `maxResultsPerCity` (type: `integer`):

How many inspection records to fetch per selected city (newest first).

## `includeRaw` (type: `boolean`):

Add the full original city record under a "raw" field alongside the normalized fields.

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

Optional free Socrata app token (dev.socrata.com) to raise rate limits. Not required for normal runs.

## Actor input object example

```json
{
  "cities": [
    "nyc",
    "chicago",
    "sf",
    "king",
    "austin"
  ],
  "maxResultsPerCity": 200,
  "includeRaw": false
}
```

# 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("straightforward_hydra/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("straightforward_hydra/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 straightforward_hydra/us-restaurant-inspections-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "US Restaurant Inspections Scraper",
        "description": "Restaurant & food health-inspection results from major US city open-data portals (NYC, Chicago, SF, Seattle, Austin). No key.",
        "version": "0.1",
        "x-build-id": "QtX8mM6yWT6SU9dVO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/straightforward_hydra~us-restaurant-inspections-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-straightforward_hydra-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/straightforward_hydra~us-restaurant-inspections-scraper/runs": {
            "post": {
                "operationId": "runs-sync-straightforward_hydra-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/straightforward_hydra~us-restaurant-inspections-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-straightforward_hydra-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 to pull inspections from. Leave empty for all supported cities.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "nyc",
                                "chicago",
                                "sf",
                                "king",
                                "austin"
                            ],
                            "enumTitles": [
                                "New York City (NY)",
                                "Chicago (IL)",
                                "San Francisco (CA)",
                                "King County / Seattle (WA)",
                                "Austin (TX)"
                            ]
                        },
                        "default": [
                            "nyc",
                            "chicago",
                            "sf",
                            "king",
                            "austin"
                        ]
                    },
                    "nameContains": {
                        "title": "Business name contains",
                        "type": "string",
                        "description": "Filter by restaurant name, e.g. \"pizza\", \"starbucks\", \"taco\"."
                    },
                    "keyword": {
                        "title": "Keyword (full-text)",
                        "type": "string",
                        "description": "Full-text search across all columns, e.g. \"roach\", \"rodent\", \"vermin\", \"mice\". Works on every city — great for finding violations."
                    },
                    "resultContains": {
                        "title": "Result contains",
                        "type": "string",
                        "description": "Filter by inspection result/action text, e.g. \"fail\", \"closed\", \"unsatisfactory\". Applied where the city exposes a result column."
                    },
                    "locality": {
                        "title": "Borough / city",
                        "type": "string",
                        "description": "Filter by borough or locality, e.g. \"Brooklyn\", \"Chicago\". Applied where the city exposes a locality column."
                    },
                    "zipCodes": {
                        "title": "ZIP codes",
                        "type": "array",
                        "description": "Restrict to these ZIP codes, e.g. [\"11231\", \"60602\"].",
                        "items": {
                            "type": "string"
                        }
                    },
                    "minScore": {
                        "title": "Min score",
                        "type": "integer",
                        "description": "Minimum inspection score. NOTE: score meaning differs by city — NYC & Seattle: HIGHER = worse (violation points); SF & Austin: HIGHER = better (100 = perfect). Chicago has no numeric score."
                    },
                    "maxScore": {
                        "title": "Max score",
                        "type": "integer",
                        "description": "Maximum inspection score. See the score-meaning note on Min score."
                    },
                    "inspectedAfter": {
                        "title": "Inspected after",
                        "type": "string",
                        "description": "Only inspections on/after this date (YYYY-MM-DD). Set to recent dates for fresh results."
                    },
                    "inspectedBefore": {
                        "title": "Inspected before",
                        "type": "string",
                        "description": "Only inspections on/before this date (YYYY-MM-DD)."
                    },
                    "maxResultsPerCity": {
                        "title": "Max results per city",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "How many inspection records to fetch per selected city (newest first).",
                        "default": 200
                    },
                    "includeRaw": {
                        "title": "Include raw record",
                        "type": "boolean",
                        "description": "Add the full original city record under a \"raw\" field alongside the normalized fields.",
                        "default": false
                    },
                    "appToken": {
                        "title": "Socrata app token (optional)",
                        "type": "string",
                        "description": "Optional free Socrata app token (dev.socrata.com) to raise rate limits. Not required for normal runs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
