# Restaurant Inspections | Food Hygiene Ratings US & UK (`aurelix/restaurant-inspections`) Actor

Extract restaurant inspections and UK food hygiene ratings from official open data at $2.00 per 1,000: New York City, Chicago, Austin, Seattle & King County and any UK local authority. Business, address, date, score, grade, violations; incremental mode.

- **URL**: https://apify.com/aurelix/restaurant-inspections.md
- **Developed by:** [Aurelix](https://apify.com/aurelix) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 inspection results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is Restaurant Inspections?

**Restaurant inspection results and UK food hygiene ratings from official open data, $2.00 per 1,000 inspections, no login.**

For food-safety suppliers, restaurant tech, insurers and journalists in New York City, Chicago, Austin, Seattle and every UK local authority. Incremental mode returns only inspections not returned before.

[![Restaurant Inspections: example output from a real run](https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/restaurant-inspections-card-v2.png)](https://apify.com/aurelix/restaurant-inspections)

[![Restaurant Inspections: 75-second demo video](https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/restaurant-inspections-demo-thumb-v1.png)](https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/restaurant-inspections-demo-v1.mp4)

**[▶ Watch the 75-second demo](https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/restaurant-inspections-demo-v1.mp4)**

| | |
|---|---|
| **Sources** | New York City, Chicago, Austin, Seattle & King County, UK Food Hygiene Rating Scheme (any local authority) |
| **Filters** | Days back (up to 365), business name or type, result or grade, ZIP code or postcode, only with violations, max per source |
| **Output** | 28 fields per inspection; JSON, CSV, Excel, API |
| **Automate** | Schedules, webhooks, Slack digest, Zapier, Make, n8n, MCP for AI agents |
| **Price** | $2.00 per 1,000 inspections ($1.50 per 1,000 inspections on paid Apify plans) |
| **Free to try** | Runs on Apify's free plan: the $5 monthly credit covers about 2,400 inspections |
| **Login needed** | No |

### Daily incremental run: only records not returned before

Set it once, get only the new inspections every morning. With **Incremental: skip inspections already returned** on, the first run returns everything that matches; each later run returns only inspections it has not returned before.

```json
{
  "cities": [
    "nyc",
    "chicago",
    "king-county"
  ],
  "daysBack": 7,
  "results": [
    "fail",
    "closed",
    "unsatisfactory"
  ],
  "incremental": true,
  "stateKey": "failed-inspections-daily"
}
```

1. Paste this input into the **Input** tab (JSON view) and click **Save as a new task**; it appears under **Saved tasks**.
2. Open the task from **Saved tasks** and click **Schedule**.
3. Choose **Daily**, pick the hour, and save.

**Cost example:** 3 US cities, failed or closed inspections only, about 40 new a day ≈ $2.55/month on the free plan ($1.95 on paid plans): one run a day for 30 days, start fee included. The first run returns everything that matches, so it costs more.

Add a Slack incoming-webhook URL in `slackWebhookUrl` (or any URL in `webhookUrl`) to get a short digest of each run's new inspections; nothing is sent when a run finds nothing.

### Why Restaurant Inspections users pick this one

- **Five official sources.** Four US city datasets and the UK national rating scheme in one schema.
- **Violations as data.** Code, description and critical flag per violation, with counts.
- **Incremental feed.** Each inspection returned once; a Slack or webhook digest after every run.
- **No inspector names.** Bare personal names blanked; trading names kept as published.

### Get started in 3 steps

1. Pick US cities and/or type UK local authority names (e.g. Westminster, Manchester), and how many days back to look.
2. Optionally keep only certain businesses (e.g. 'pizza'), results (e.g. 'fail', 'closed', '0'), ZIP codes or postcodes, or only inspections with violations; turn on 'Incremental: skip inspections already returned' for a daily or weekly feed.
3. Click Start, then download JSON, CSV or Excel, or schedule the run and send results to Slack, Zapier, Make or n8n.

**[▶ Try it with the example input](https://apify.com/aurelix/restaurant-inspections)**

The form opens with an example input already filled in.

### How much does it cost to scrape official food inspection records?

Pay per event: you pay only for what the run returns, plus a small start fee. Bronze, Silver, Gold and higher Apify plans pay less per result.

| Inspections | Free plan | Paid plans (Bronze, Silver, Gold) |
|---|---|---|
| 100 | $0.21 | $0.16 |
| 1,000 | $2.01 | $1.51 |
| 10,000 | $20.01 | $15.01 |

Totals include the $0.005 start fee per run, rounded to the cent. Apify's free plan includes $5 of credit a month, enough for about 2,400 inspections.

$2.00 per 1,000 inspections ($1.50 on paid Apify plans) and a $0.005 start fee per run, so the example run (about 30 inspections) costs about $0.07. In incremental mode you pay only for new inspections; a city or authority with nothing to return costs $0.0005, except the first two in each run. Sources that are down and inspections already returned are never charged.

#### Billing events

| Event | Free plan | Paid plans (Bronze, Silver, Gold) |
|---|---|---|
| `inspection-result` | $2.00 per 1,000 inspections | $1.50 per 1,000 inspections |
| `source-checked` | $0.50 per 1,000 inspections | $0.50 per 1,000 inspections |
| `apify-actor-start` | $0.005 per run | $0.005 per run |

### What data you get

**Restaurant Inspections** turns official food-safety records into one schema: New York City restaurant inspections (grade, score, every violation), Chicago food inspections (pass/fail result, risk level, violation titles), Austin inspection scores, Seattle & King County inspections (points, result, grade, violations) and UK food hygiene ratings from the Food Standards Agency for any local authority you name. Each inspection comes with the business name, address, date, score, grade or result, the violation list where the source publishes one, an official record link and the source licence. Incremental mode returns only inspections not returned before, for a daily or weekly public-record data feed.

- Business name, establishment ID, cuisine or business type
- Street address, city or borough, ZIP code or postcode, latitude and longitude
- Inspection date and type (UK: rating date)
- Score, grade, result or action, as each source publishes them
- Violations: code, description and critical flag (New York City, Chicago, King County), with counts
- UK rating (0-5 or Pass) and the hygiene, structural and management scores
- Official record link, dataset name and licence

| jurisdiction | business_name | address | inspection_date | score | grade | result | violation_count |
|---|---|---|---|---|---|---|---|
| New York City | EL CARIBE | 5945 STRICKLAND AVENUE | 2026-12-02 | 12 | A | Violations were cited in the following area(s). | 3 |
| New York City | JACK'S FIRE DEPARTMENT | 39-46 SKILLMAN AVENUE | 2026-12-02 | 24 | Z | Violations were cited in the following area(s). | 5 |
| Chicago | ALL DAY MONTESSORI | 1819 W 99TH ST | 2026-12-04 |  | Risk 1 (High) | Pass | 0 |
| Chicago | ALL DAY MONTESSORI PRESCHOOL | 1808-1810 W 99TH ST | 2026-12-04 |  | Risk 1 (High) | Pass | 0 |
| UK: Westminster | Cafe Beam | 103 WESTBOURNE GROVE | 2026-11-30 |  |  | 5 |  |

One full inspection record, exactly as a real run returned it (long text and lists shortened here). From a real run:

```json
{
  "inspection_id": "nyc:40369521:2026-12-02:Cycle Inspection / Initial Inspection",
  "source": "nyc",
  "jurisdiction": "New York City",
  "country": "US",
  "business_name": "KNICKERBOCKER BAR & GRILL",
  "business_id": "40369521",
  "business_type": "Steakhouse",
  "address": "33 UNIVERSITY PLACE",
  "city": "Manhattan",
  "postcode": "10003",
  "latitude": 40.731968639466,
  "longitude": -73.994450594757,
  "inspection_date": "2026-12-02",
  "inspection_type": "Cycle Inspection / Initial Inspection",
  "score": 30,
  "grade": null,
  "result": "Violations were cited in the following area(s).",
  "violation_count": 4,
  "critical_violations": 4,
  "violations": [
    {
      "code": "02G",
      "description": "Cold TCS food item held above 41 °F; smoked or processed fish held above 38 °F; intact raw eggs held above 45 °F; or red... [113 more characters]",
      "critical": true
    },
    {
      "code": "02B",
      "description": "Hot TCS food item not held at or above 140 °F.",
      "critical": true
    },
    {
      "code": "04H",
      "description": "Raw, cooked or prepared food is adulterated, contaminated, cross-contaminated, or not discarded in accordance with HACCP... [6 more characters]",
      "critical": true
    },
    "... [1 more]"
  ],
  "uk_rating": null,
  "uk_hygiene_score": null,
  "uk_structural_score": null,
  "uk_management_score": null,
  "uk_new_rating_pending": null,
  "url": "https://data.cityofnewyork.us/resource/43nn-pn8j.json?camis=40369521",
  "dataset": "DOHMH New York City Restaurant Inspection Results (43nn-pn8j)",
  "licence": "NYC Open Data terms of use (free to use)",
  "source_url": "https://data.cityofnewyork.us/resource/43nn-pn8j.json?camis=40369521",
  "scraped_at": "2026-12-05T19:09:25Z"
}
```

### Use cases

- Food-safety, pest-control and cleaning suppliers finding businesses that just failed an inspection
- Restaurant suppliers, POS and delivery platforms building local business lists with grades
- Journalists and researchers tracking closures and critical violations
- Insurers, landlords and franchise owners checking a location's inspection history

### Use-case recipes

#### Failed inspections in Chicago and New York City

For pest-control, cleaning and food-safety training firms. Keep Chicago failures and New York City closures, turn on incremental mode and schedule it daily: each run returns the businesses that newly failed, with address and violations.

```json
{
  "cities": [
    "chicago",
    "nyc"
  ],
  "daysBack": 7,
  "results": [
    "fail",
    "closed"
  ],
  "incremental": true,
  "stateKey": "chi-nyc-failed"
}
```

#### Low food hygiene ratings in London boroughs

For UK food-safety consultants. Name the boroughs, keep ratings 0 to 2, and run weekly.

```json
{
  "cities": [],
  "ukAuthorities": [
    "Westminster",
    "Camden",
    "Tower Hamlets",
    "Hackney"
  ],
  "daysBack": 30,
  "results": [
    "0",
    "1",
    "2"
  ],
  "incremental": true,
  "stateKey": "london-low-ratings"
}
```

### Input

| Field | Type | What it does | Default |
|---|---|---|---|
| `cities` (US cities) | array | Which US inspection datasets to read: 'nyc' (New York City restaurant inspections with grade, score and every violation), 'chicago' (Chicago... | \["nyc", "chicago", "austin", "king-county"] |
| `ukAuthorities` (UK local authorities (Food Hygiene Rating Scheme)) | array | UK local authority names as the Food Standards Agency lists them, e.g. \['Westminster', 'Manchester', 'Glasgow City']. |  |
| `daysBack` (Inspected in the last N days) | integer | Keep inspections dated on or after today minus this many days (UTC). | 30 |
| `maxResultsPerSource` (Max results per city or authority) | integer | Upper limit of inspections per US city or UK authority after filters, newest first. 0 = no limit. | 1000 |
| `keywords` (Business name, type or address contains) | array | Keep inspections whose business name, cuisine or business type, or address contains one of these (case-insensitive), e.g. \['pizza', 'starbucks', 'school']. |  |
| `results` (Result, grade or rating contains) | array | Keep inspections whose result, grade or UK rating contains one of these (case-insensitive), e.g. \['fail', 'closed'] for Chicago failures and... |  |

All 12 fields, with examples: see the **Input** tab.

### Use with AI agents (MCP)

MCP (Model Context Protocol) is the open standard that lets AI assistants such as Claude, ChatGPT and Cursor call outside tools. Apify's hosted MCP server at `https://mcp.apify.com/?tools=aurelix/restaurant-inspections` gives your assistant this Actor only: it fills in the input from your request, runs it and reads the inspections back, at the same per-result price as a run started by hand.

#### Example prompts

- "List New York City restaurants that were closed or got a C grade in the last 14 days, with the critical violations"
- "Find Chicago food inspections that failed this week, with the business address and violation titles"
- "Show food businesses in Westminster rated 0 or 1 for food hygiene in the last 30 days"

#### Claude Desktop and claude.ai

**Settings > Connectors > Add custom connector**, name it Apify, paste `https://mcp.apify.com/?tools=aurelix/restaurant-inspections`, keep the detected OAuth settings, select **Add** and sign in to Apify.

#### Claude Code

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=aurelix/restaurant-inspections"
```

#### Cursor and VS Code

Add this to `~/.cursor/mcp.json` (Cursor); in VS Code's `.vscode/mcp.json` put the same entry under `"servers"` with `"type": "http"`. Sign in to Apify when asked.

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=aurelix/restaurant-inspections"
    }
  }
}
```

#### ChatGPT

Turn on **Developer mode**, open **Settings > Apps & Connectors > Create**, paste the URL above as the MCP server URL, choose **OAuth** and authorize Apify.

Clients without sign-in send `Authorization: Bearer <YOUR_APIFY_TOKEN>` instead. No Apify account? This Actor supports Apify's agentic payments: an agent can pay per run with a prepaid, spend-capped token, bought with x402 stablecoin payments.

#### n8n AI agent

Give an **AI Agent** node an **MCP Client Tool** with the endpoint `https://mcp.apify.com/?tools=aurelix/restaurant-inspections` and a Bearer credential holding your Apify token.

### Use it from AI agents (MCP), the API or no-code

#### Copy this to your AI assistant

```text
Use the Apify Actor aurelix/restaurant-inspections (Restaurant Inspections) through Apify's MCP server or API. Main input: cities (US cities); ukAuthorities (UK local authorities (Food Hygiene Rating Scheme)). Example input: {"cities": ["nyc", "chicago"], "ukAuthorities": ["Westminster"], "daysBack": 7, "results": ["fail", "closed", "0", "1"], "incremental": true, "stateKey": "failed-inspections-weekly"}. Each result is one inspection with fields such as inspection_id, source, jurisdiction, country, business_name, business_id, business_type, address. It costs $2.00 per 1,000 inspections on Apify's free plan plus a $0.005 start fee per run, and needs no login.
```

MCP server URL for this Actor: `https://mcp.apify.com/?tools=aurelix/restaurant-inspections` (setup for each client in the section above).

#### API

Start a run and read the dataset with Apify's REST API or the Python and JavaScript clients:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("aurelix/restaurant-inspections").call(run_input={'cities': ['nyc', 'chicago'], 'ukAuthorities': ['Westminster'], 'daysBack': 7, 'results': ['fail', 'closed', '0', '1'], 'incremental': True, 'stateKey': 'failed-inspections-weekly'})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### No-code: schedule it in 3 clicks

Send the results to Zapier, Make, n8n, Slack or any webhook URL.

1. Fill in the input, then click **Save as a new task**.
2. In the task, click **Schedule** and pick daily or weekly (Apify Schedules).
3. Turn on **Incremental: skip inspections already returned** so each run returns only what is new, and paste a Slack or webhook URL into **Slack webhook URL** / **Webhook URL** to get a digest of the new items (count plus the top 10) after every run.

Prefer n8n or Make? Ask in the **Issues** tab and we will share a ready-made workflow for it.

### FAQ

#### Can I scrape official food inspection records without login?

Yes. It never logs in, so you need no open-data portal account, password or cookies; only a free Apify account to run it.

#### Is there an official food inspection records API?

You can use this Actor as one. Start it with Apify's REST API or the Python and JavaScript clients and read the results as JSON (see the code above), or call it from an AI agent through MCP.

#### How much does it cost to scrape official food inspection records?

About $2.01 for 1,000 inspections on Apify's free plan and $1.51 on paid plans, start fee included. The free $5 monthly credit covers about 2,400 inspections.

#### Can I export official food inspection records data to Excel or CSV?

Yes. Download the results as Excel, CSV, JSON, XML or HTML from the run's **Storage** tab, or read them through the API.

#### Is it legal to scrape official food inspection records?

It reads only public data any logged-out visitor can see: official open-data datasets. Austin and King County data are public domain, New York City open data is free to use, Chicago data falls under the City of Chicago data portal terms, and UK ratings are under the Open Government Licence; each record names its dataset and licence. You are responsible for how you use the data and for the laws that apply to you; this is not legal advice.

#### How do I get restaurant inspection results for several cities in one file?

Pick New York City, Chicago, Austin and Seattle & King County (and any UK local authorities); every inspection comes back in one schema with business, address, date, score, grade, result and violations. Export JSON, CSV or Excel.

#### Is there a cheaper restaurant inspections tool?

This Actor costs $2.00 per 1,000 inspections on the free plan and $1.50 on paid plans, with no login, for four US cities and UK food hygiene ratings. It doesn't cover other US cities.

#### How do I get new failed inspections into n8n or an AI agent?

Set the result filter (e.g. 'fail', 'closed'), turn on 'Incremental: skip inspections already returned' and schedule the run; connect the dataset to Zapier, Make or n8n, or call the Actor from an AI agent through Apify's MCP server. A Slack or webhook digest after each run is built in.

#### Which datasets does it read?

New York City: DOHMH New York City Restaurant Inspection Results. Chicago: Food Inspections. Austin: Food Establishment Inspection Scores. Seattle & King County: Food Establishment Inspection Data. UK: the Food Standards Agency's Food Hygiene Rating Scheme API. All are official open data, read through public APIs with no key.

#### How fresh is the data?

The US portals update daily or a few times a week; New York City publishes a few days after the inspection. UK ratings appear when the local authority uploads them, usually within a few weeks of the inspection.

#### What does one record stand for?

One inspection: in New York City and King County the violation rows of one inspection are grouped into one record with a violation list. For the UK it is the establishment's current rating, dated by its rating date.

#### Does it return inspector or owner names?

Inspector names, phone numbers and Chicago's free-text inspector comments are never included. Bare personal names are blanked (name_withheld true): a UK name is kept only when it contains a food or business word (Cafe, Restaurant, Kitchen, Takeaway, Bar, Pub, Hotel, Bakery, Shop, Store, School, Ltd and similar) or belongs to a chain with three or more premises, and US names that read as a private person are blanked. Registered trading names are kept as published, even when they include a person's name (for example 'Susan's Kitchen'). The rest of each record is always kept.

#### How does incremental mode work?

With 'Incremental: skip inspections already returned' on, the run remembers the inspections it returned (per sources and filters, or per the memory name you set) and later runs return only inspections it has not returned before. Schedule it daily or weekly.

#### Which UK local authorities can I use?

Any of the about 360 authorities in the Food Hygiene Rating Scheme, by the name the Food Standards Agency uses (e.g. 'Westminster', 'Leeds', 'Glasgow City', 'Cardiff'). A name that matches none is named in the run status and costs nothing.

### Lawful use

- Records carry business names only. Inspector names, phone numbers and free-text inspector comments are never read. UK names are kept only with a food or business word or as a chain (3+ premises); other UK names, and US names that read as a private person, are blanked (name_withheld true) and the rest of the record is kept. People can ask for removal by opening an issue on this Actor's Issues tab.

### Limits (stated honestly)

- US coverage is New York City, Chicago, Austin and Seattle & King County; other US cities are not covered.
- Austin and the UK publish no violation list; the UK record is the current rating per establishment, so an older rating that was replaced is not returned.
- Scores are not comparable across sources (each city scores differently).
- The UK API cannot filter by date, so each authority is read in full (one to three requests) and filtered by rating date.
- Each source is read for at most 60 seconds per run; a long window on a large city may stop early with the newest inspections kept.
- Incremental memory is shared by runs with the same inputs; two runs started at the same time on one memory can both return the same new inspections.
- UK business names without a food or business word that are not a chain are blanked (name_withheld true), so some real UK businesses show no name; the rest of the record is kept.

### Works great with

- **Then: [Liquor License Applications](https://apify.com/aurelix/liquor-license-applications)**: new bars and restaurants from state liquor licence applications, filed before they open and get inspected
- **Then: [New Business Licenses Scraper](https://apify.com/aurelix/new-business-licenses)**: newly licensed businesses in US cities, another early public-record list

### Recent changes

- **0.1**: First release: New York City, Chicago, Austin, Seattle & King County and UK food hygiene ratings; incremental mode.

The full history is on the **Changelog** tab.

### Tested daily

This Actor is run every day on a fixed input and checked: at least 7 inspections come back with `inspection_id`, `source`, `jurisdiction`, `country`, `business_name`, `inspection_date` filled in.

### Was this useful?

- **Something went wrong?** [Open an issue](https://apify.com/aurelix/restaurant-inspections/issues) and tell us what you ran: we answer fast and aim to reply within a day.
- **It worked?** [Leave a review](https://apify.com/aurelix/restaurant-inspections/reviews): it takes a minute and helps other people find this tool.
- **Need a different source, more fields or a custom feed?** [Open an issue](https://apify.com/aurelix/restaurant-inspections/issues) and describe what you need.

# Changelog

This Actor's version history is a separate document: https://apify.com/aurelix/restaurant-inspections/changelog.md

# Actor input Schema

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

Which US inspection datasets to read: 'nyc' (New York City restaurant inspections with grade, score and every violation), 'chicago' (Chicago food inspections with pass/fail result, risk level and violation titles), 'austin' (Austin food establishment inspection scores), 'king-county' (Seattle & King County food establishment inspections with points, result, grade and violations). Leave empty to read only UK authorities.

## `ukAuthorities` (type: `array`):

UK local authority names as the Food Standards Agency lists them, e.g. \['Westminster', 'Manchester', 'Glasgow City']. Each returns establishments whose food hygiene rating date falls in the window, with the rating (0-5, or Pass / Improvement Required in Scotland) and the three inspection scores. Empty = none.

## `daysBack` (type: `integer`):

Keep inspections dated on or after today minus this many days (UTC). For the UK this is the rating date. Example: 7 for a weekly feed.

## `maxResultsPerSource` (type: `integer`):

Upper limit of inspections per US city or UK authority after filters, newest first. 0 = no limit.

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

Keep inspections whose business name, cuisine or business type, or address contains one of these (case-insensitive), e.g. \['pizza', 'starbucks', 'school']. Empty = all.

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

Keep inspections whose result, grade or UK rating contains one of these (case-insensitive), e.g. \['fail', 'closed'] for Chicago failures and New York City closures, \['unsatisfactory'] for King County, \['0', '1'] for the lowest UK ratings. Empty = all.

## `postcodes` (type: `array`):

Keep inspections whose ZIP code or postcode starts with one of these, e.g. \['10001', '606'] or \['W1', 'SW1A']. Empty = all.

## `withViolationsOnly` (type: `boolean`):

Keep only inspections that list at least one violation (New York City, Chicago, King County; Austin and UK records carry no violation list and drop out).

## `incremental` (type: `boolean`):

Return only inspections not returned by a previous run with the same sources and filters (or the same state name below). Use with a daily or weekly schedule.

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

Name for the incremental memory. Leave empty to derive it from the sources and filters; set it to keep separate feeds apart, e.g. 'nyc-closures'.

## `slackWebhookUrl` (type: `string`):

After each run, post a short digest to Slack: how many inspections were saved (new ones only when incremental mode is on) and the top 10 with links, e.g. https://hooks.slack.com/services/T000/B000/XXXX. Nothing is posted when the run saved nothing. Leave empty to skip.

## `webhookUrl` (type: `string`):

After each run, POST the same digest as JSON (actor, newOnly, count, items = top 10 results, runUrl, text) to any URL, e.g. a Zapier, Make or n8n webhook. Nothing is sent when the run saved nothing. Leave empty to skip.

## Actor input object example

```json
{
  "cities": [
    "nyc",
    "chicago"
  ],
  "ukAuthorities": [
    "Westminster"
  ],
  "daysBack": 7,
  "maxResultsPerSource": 10,
  "keywords": [],
  "results": [],
  "postcodes": [],
  "withViolationsOnly": false,
  "incremental": false
}
```

# Actor output Schema

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

Restaurant and food-business inspections found in this run, one item per inspection.

# 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"
    ],
    "ukAuthorities": [
        "Westminster"
    ],
    "daysBack": 7,
    "maxResultsPerSource": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("aurelix/restaurant-inspections").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "cities": [
        "nyc",
        "chicago",
    ],
    "ukAuthorities": ["Westminster"],
    "daysBack": 7,
    "maxResultsPerSource": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("aurelix/restaurant-inspections").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cities": [
    "nyc",
    "chicago"
  ],
  "ukAuthorities": [
    "Westminster"
  ],
  "daysBack": 7,
  "maxResultsPerSource": 10
}' |
apify call aurelix/restaurant-inspections --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5B6K0oCYwLLW9eRnr/builds/WIRVpAzo6bbTvFFwb/openapi.json
