# Restaurant Inspection Leads: Health Violations by City (`scrapemint/restaurant-inspection-leads`) Actor

Fresh restaurant health inspections from official city open data, normalized across NYC, Chicago, Boston, Austin, and King County: one row per inspection with business name, address, phone where published, result, score, and violations. Filter by keyword. Keyless, no browser. Pay per row.

- **URL**: https://apify.com/scrapemint/restaurant-inspection-leads.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

## Restaurant Inspection Leads: Health Violations by City

Fresh restaurant health inspections pulled from official city and county open data portals and normalized into one clean row shape. A restaurant that just failed an inspection is an active buyer of pest control, hood and vent cleaning, food safety consulting, staff training, and equipment repair. This actor turns public inspection records into a lead feed for those services.

### What you get

One row per inspection:

| Field | Description |
| --- | --- |
| `businessName` | Restaurant or food business name |
| `businessType` | Cuisine or facility type where published |
| `address`, `zip` | Street address |
| `phone` | Phone number where the city publishes it (NYC, King County) |
| `inspectionDate` | Date of the inspection |
| `inspectionType` | Routine, complaint, re-inspection, etc. |
| `result` | Pass / Fail / action taken, as published |
| `score`, `grade` | Numeric score or letter grade where the city uses one |
| `violations` | List of cited violation texts for the inspection |
| `violationCount`, `criticalCount` | How many violations, and how many critical |
| `latitude`, `longitude` | Coordinates where published |

### Supported cities

| City | Source | Freshness |
| --- | --- | --- |
| New York City, NY | DOHMH Restaurant Inspection Results (open data) | Updated daily, includes phone numbers |
| Chicago, IL | Chicago Food Inspections (open data) | Updated daily |
| Boston, MA | Inspectional Services food inspections (open data) | Updated daily |
| Austin, TX | Food Establishment Inspection Scores (open data) | Published with a 1 to 2 month delay, scores only |
| Seattle / King County, WA | Food Establishment Inspection Data (open data) | Currently lags several months behind |

All data comes from official government open data APIs. No login, no API key, no browser.

### Typical uses

- **Pest control companies**: filter `keywords` for `vermin`, `mice`, `roach`, `flies` and call restaurants the week they were cited.
- **Hood and vent cleaning**: filter for `hood`, `ventilation`, `grease`.
- **Food safety consultants and trainers**: set `onlyWithViolations` and prospect every failed inspection.
- **Commercial cleaning and equipment repair**: filter for `temperature`, `refrigeration`, `sanitiz`.
- **Insurers, landlords, journalists, researchers**: monitor inspection outcomes across cities.

### Scheduled lead feed

Turn on `dedupe` and run the actor daily on a schedule: every run returns only inspections it has not returned before, so your team gets a stream of new violations without repeats.

### Pricing

You pay per inspection row returned (`inspection_row`). The first 2 rows of every run are free, so you can try the actor without cost. Rows filtered out by your keywords, city choice, or date window are never charged.

### Input example

```json
{
    "cities": ["nyc", "chicago", "boston"],
    "keywords": ["vermin", "mice", "roach"],
    "onlyWithViolations": true,
    "sinceDays": 14,
    "maxRows": 100,
    "dedupe": true
}
````

### Notes

- Inspection records are public data published by each city or county government. Field coverage varies by city; fields a city does not publish are `null`.
- Scores mean different things in different cities (NYC lower is better, Austin higher is better). The `result` field carries each city's own wording.
- If a city's portal is down or slow, the actor logs a warning and continues with the other cities.

# Actor input Schema

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

Cities to scan. Empty = all supported cities. Note: Austin publishes with a delay of one to two months; King County data currently lags several months.

## `keywords` (type: `array`):

Matched against violation text, result, and business name, e.g. vermin, mice, roach, temperature, sewage, hood. Empty = all inspections.

## `onlyWithViolations` (type: `boolean`):

Skip clean inspections and return only rows that cite at least one violation.

## `sinceDays` (type: `integer`):

How far back to scan for inspections.

## `maxRows` (type: `integer`):

Cap on inspection rows returned, split across the selected cities. Controls total cost.

## `dedupe` (type: `boolean`):

Remember returned inspections across runs and skip them. Turn on for a scheduled daily lead feed.

## Actor input object example

```json
{
  "cities": [
    "nyc",
    "chicago",
    "boston"
  ],
  "keywords": [],
  "onlyWithViolations": false,
  "sinceDays": 14,
  "maxRows": 25,
  "dedupe": 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 = {
    "cities": [
        "nyc",
        "chicago",
        "boston"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/restaurant-inspection-leads").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 = { "cities": [
        "nyc",
        "chicago",
        "boston",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/restaurant-inspection-leads").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 '{
  "cities": [
    "nyc",
    "chicago",
    "boston"
  ]
}' |
apify call scrapemint/restaurant-inspection-leads --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Restaurant Inspection Leads: Health Violations by City",
        "description": "Fresh restaurant health inspections from official city open data, normalized across NYC, Chicago, Boston, Austin, and King County: one row per inspection with business name, address, phone where published, result, score, and violations. Filter by keyword. Keyless, no browser. Pay per row.",
        "version": "0.1",
        "x-build-id": "LgY0XeTAFk47QhGWB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapemint~restaurant-inspection-leads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapemint-restaurant-inspection-leads",
                "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/scrapemint~restaurant-inspection-leads/runs": {
            "post": {
                "operationId": "runs-sync-scrapemint-restaurant-inspection-leads",
                "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/scrapemint~restaurant-inspection-leads/run-sync": {
            "post": {
                "operationId": "run-sync-scrapemint-restaurant-inspection-leads",
                "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": "Cities to scan. Empty = all supported cities. Note: Austin publishes with a delay of one to two months; King County data currently lags several months.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "nyc",
                                "chicago",
                                "boston",
                                "austin",
                                "seattle"
                            ],
                            "enumTitles": [
                                "New York City, NY",
                                "Chicago, IL",
                                "Boston, MA",
                                "Austin, TX",
                                "Seattle / King County, WA"
                            ]
                        },
                        "default": []
                    },
                    "keywords": {
                        "title": "Violation keywords (optional)",
                        "type": "array",
                        "description": "Matched against violation text, result, and business name, e.g. vermin, mice, roach, temperature, sewage, hood. Empty = all inspections.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "onlyWithViolations": {
                        "title": "Only inspections with violations",
                        "type": "boolean",
                        "description": "Skip clean inspections and return only rows that cite at least one violation.",
                        "default": false
                    },
                    "sinceDays": {
                        "title": "Inspected in the last N days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "How far back to scan for inspections.",
                        "default": 14
                    },
                    "maxRows": {
                        "title": "Max inspections per run",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Cap on inspection rows returned, split across the selected cities. Controls total cost.",
                        "default": 25
                    },
                    "dedupe": {
                        "title": "Skip inspections seen in previous runs",
                        "type": "boolean",
                        "description": "Remember returned inspections across runs and skip them. Turn on for a scheduled daily lead feed.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
