NYC Restaurant Health Inspection Monitor (DOHMH Grades JSON) avatar

NYC Restaurant Health Inspection Monitor (DOHMH Grades JSON)

Pricing

from $1.20 / 1,000 inspection row delivereds

Go to Apify Store
NYC Restaurant Health Inspection Monitor (DOHMH Grades JSON)

NYC Restaurant Health Inspection Monitor (DOHMH Grades JSON)

Monitor official NYC Open Data restaurant inspections (DOHMH): one row per inspection and violation with score, grade, action, violation codes and descriptions, borough, cuisine, address and coordinates. Filter by date, borough, cuisine or grade. Establishment data only, no personal contact fields.

Pricing

from $1.20 / 1,000 inspection row delivereds

Rating

0.0

(0)

Developer

Steadfetch

Steadfetch

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Categories

Features

Limited permissions

Share

This Actor returns official New York City restaurant inspection results published by the NYC Department of Health and Mental Hygiene (DOHMH) on the NYC Open Data Socrata API: one structured JSON row per inspection or violation, with the score, grade, action, violation code and description, and the establishment borough, address and coordinates. It is meant for compliance, food-safety and location analytics work that needs the inspection grain the City actually publishes. No browser, no login and no API key are required.

Tested daily. Last verified: 2026-10-30

What it does

The Actor queries the DOHMH New York City Restaurant Inspection Results dataset (Socrata resource 43nn-pn8j) and writes one dataset item per inspection or violation row.

  • Date window: since and until filter on inspection_date; when since is omitted the run covers the last 30 days.
  • Filters: borough, cuisine and grade (A, B or C) narrow the query and are applied against the source. When grade is set, rows without a grade are not returned.
  • Normalization: scores and coordinates become numbers, dates become YYYY-MM-DD, and missing or placeholder values become null (for example the 1900-01-01 placeholder and 0/0 coordinates).
  • Deduplication: the key is camis + inspection_date + violation_code, applied inside a run and across monitor runs.
  • Mode: full returns every matching row; monitor stores delivered keys in the Actor key-value store and emits only rows never delivered before for the same borough, cuisine and grade scope.
  • Validation: every item is checked against .actor/dataset_schema.json before it reaches the dataset; with strictSchema true (the default) an invalid item fails the run.
  • Privacy: establishment data only. The source phone column is never selected and no phone, email, officer or other personal contact field is published.

How to use

  1. Open the Actor in the Apify Console or the CLI and set the filters you need (since, borough, cuisine, grade, maxResults, mode).
  2. Run it with the default example input to pull a small, recent slice of inspections.
  3. To watch for new rows over time, set mode to monitor and schedule the run; already delivered keys are skipped.
  4. Read results from the dataset, the overview view, or through the API.

Run the shipped example input from the CLI:

$apify call steadfetch/nyc-restaurant-inspections-extractor --input='{"since":"2026-09-01","maxResults":10}'

Input

Input fields

FieldTypeRequiredDefault/PrefillDescriptionExample
sincestringNonone (last 30 days)Optional ISO date (YYYY-MM-DD). Only rows with inspection_date on or after this date are returned.2026-09-01
untilstringNononeOptional ISO date (YYYY-MM-DD). Only rows with inspection_date on or before this date are returned.2026-10-20
boroughstringNononeOptional NYC borough, case-insensitive: Manhattan, Brooklyn, Queens, Bronx or Staten Island.Manhattan
cuisinestringNononeOptional cuisine description as published by DOHMH, case-insensitive (for example American, Pizza, Chinese).Pizza
gradestringNononeOptional inspection grade, one of A, B, C. Rows without a grade are not returned when set.A
maxResultsintegerNo100Maximum number of inspection rows to save (minimum 1, maximum 5000).10
modestringNofullfull returns every matching row; monitor returns only rows never emitted before in the same borough, cuisine and grade scope.monitor
strictSchemabooleanNotrueFail the run when an item does not match the output schema.true

Example input

{
"since": "2026-09-01",
"maxResults": 10
}

A wider, filtered monitor run using other documented fields:

{
"since": "2026-09-01",
"borough": "Manhattan",
"cuisine": "Pizza",
"grade": "A",
"maxResults": 50,
"mode": "monitor"
}

Output

Example output

{
"url": "https://data.cityofnewyork.us/resource/43nn-pn8j.json?camis=50193639",
"title": "GENESIS HOUSE RESTAURANT",
"scrapedAt": "2026-10-20T08:00:00.000Z",
"camis": "50193639",
"business_name": "GENESIS HOUSE RESTAURANT",
"borough": "Manhattan",
"building": "123",
"street": "W 45 ST",
"zipcode": "10036",
"cuisine_description": "American",
"inspection_date": "2026-09-15",
"action": "Violations were cited in the following area(s).",
"violation_code": "10F",
"violation_description": "Non-food contact surface improperly constructed",
"critical_flag": "Not Critical",
"score": 12,
"grade": "A",
"grade_date": "2026-09-20",
"latitude": 40.759,
"longitude": -73.989,
"source_url": "https://data.cityofnewyork.us/resource/43nn-pn8j.json?camis=50193639"
}

Output fields

FieldTypeDescription
urlstringPublic NYC Open Data API URL for this establishment (camis filter).
titlestring or nullBusiness name, mirrored for the common Steadfetch envelope.
scrapedAtstringISO 8601 UTC timestamp of the run.
camisstringUnique establishment identifier used by DOHMH.
business_namestringEstablishment business name as published by DOHMH.
boroughstring or nullNYC borough.
buildingstring or nullBuilding / street number.
streetstring or nullStreet name.
zipcodestring or nullZIP code.
cuisine_descriptionstring or nullDOHMH cuisine label.
inspection_datestringInspection date (YYYY-MM-DD). The placeholder 1900-01-01 is never emitted.
actionstring or nullInspection action text.
violation_codestring or nullViolation code.
violation_descriptionstring or nullViolation description.
critical_flagstring or nullViolation criticality flag.
scorenumber or nullInspection score as published. Higher is worse.
gradestring or nullLetter grade as published.
grade_datestring or nullDate the grade was assigned (YYYY-MM-DD). Placeholder 1900-01-01 dates are emitted as null.
latitudenumber or nullWGS84 latitude. Null when the source reports no valid coordinate.
longitudenumber or nullWGS84 longitude. Null when the source reports no valid coordinate.
source_urlstringPublic NYC Open Data API URL for this establishment.

Pricing

This Actor uses Apify pay-per-event pricing with the two synthetic platform events from .actor/pay_per_event.json:

  • apify-actor-start: 0.00005 USD per run. This is the Apify-recommended default and it includes the first 5 seconds of compute per run.
  • apify-default-dataset-item: 0.003 USD per row, that is 3.00 USD per 1,000 results. Measured cost: a 1,000-row run takes about 4.0 seconds at the 256 MB minimum memory on one free Socrata request (about 0.00006 USD of compute per 1,000 rows), well under the 0.10 USD target and leaving a gross margin above 99%.

There is no custom per-item event, so a saved row is never double-billed. Items that fail schema validation and runs that return nothing are not billed as dataset items.

Works on the Apify free plan - about 1,666 inspection rows for the $5 monthly credit ((5.00 USD - 0.0002 USD run-start at the default 4 GB memory) / 0.003 USD per row).

Other Steadfetch Actors

FAQ

Do I need an API key or login? No. The NYC Open Data Socrata endpoint is public and keyless. An optional SOCRATA_APP_TOKEN Actor secret can raise Socrata rate limits; it is never part of the input and is never logged.

Does it use a browser? No. The source is a JSON API, so plain HTTP is used instead of rendering the web front end.

Does it return personal data? No. Only establishment fields are returned. The source phone column is not selected and no contact field (phone, email, officer) is published.

When am I charged? Once per run start (apify-actor-start) and once per inspection row saved to the dataset (apify-default-dataset-item). Errors, retries, duplicates and the 1900-01-01 placeholder are not billed as results.

How does monitor mode avoid charging twice? It stores the dedup keys it delivered in the Actor key-value store. On the next run with the same borough, cuisine and grade scope it skips those keys before pushing, so they are not billed again. Use mode full to re-pull the whole window each run.

What are the limits? maxResults defaults to 100 and can be set up to 5000. When grade is set, only graded rows are returned.

Support

Report bugs through the Issues tab on this Actor's Apify Store page or through the steadfetch actors repository issues. Please include the run ID and the input you used so the run can be reproduced.

Maintenance

Target: tested daily. The Actor is registered for the Steadfetch daily catalog QA (enablement pending as of 2026-10-22); tests run in CI on every push. When the scheduled runs are enabled they check that the NYC Open Data API is reachable and that the output still matches the published schema. Failures are reported as issues in the Steadfetch Actors repository.