Skip to main content
POST
Returns New York City food service establishments matching an establishment id (CAMIS) or part of a trade name, with their health inspections from the New York City Department of Health and Mental Hygiene: score, letter grade, action taken and violations cited. A name shared by many establishments may leave out older inspections: add zipcode or use the id.

Authentication

Requires x402 payment in the payment-signature header.

Request Body

string
The city’s establishment id (CAMIS), for example 40732665; takes precedence over name. establishment_id must be digits.
string
Part of the trade name, matched anywhere in it and ignoring case, for example Katz’s Delicatessen. 2 to 100 characters.
string
Five-digit ZIP code of the establishment. zipcode must be five digits.
integer
Most inspections to return per establishment. From 1 to 20. Defaults to 5.

Response (200 OK)

Top-level envelope: success (boolean) and data (object). All fields below are nested under data.
string
Durable job ID for audit and lookup
string
Job status: completed
string
Always business_health_inspections
object
The answer, described under Result below
object
Where the answer came from and when
boolean
true when the answer was served from OneShot’s store of earlier lookups (or its own copy of a public dataset), false when the source was asked for this call
string
When the record was obtained from its source, as an ISO 8601 UTC time; equals evidence.retrieved_at
string
The public body the data comes from. Always New York City Department of Health and Mental Hygiene.
string
public when the data comes from a public body, commercial otherwise
string
When the lookup was made, as an ISO 8601 UTC time
string | null
The newest date the city ran its daily extract (record_date, YYYY-MM-DD) among the rows read, or null when no row matched

Result

Nested under data.result.
object[]
The matching establishments, the most recently inspected first, then those not inspected yet; empty when none matches.
string
The city’s establishment id (CAMIS).
string | null
The trade name. null when the source gives no value.
string | null
Building number and street. null when the source gives no value.
string | null
The borough, for example Manhattan. null when the source gives no value.
string | null
Five-digit ZIP code. null when the source gives no value.
string | null
The cuisine the city records, for example Sandwiches. null when the source gives no value.
number | null
Latitude, or null when the city could not place the address.
number | null
Longitude, or null when the city could not place the address.
object[]
Inspections, newest first (same-day inspections by type), at most limit; empty when the establishment has not been inspected yet.
string
Date of the inspection, YYYY-MM-DD.
string | null
Program and kind of inspection, for example Cycle Inspection / Initial Inspection. null when the source gives no value.
number | null
Points for the violations found (lower is better), or null when the inspection was not scored.
string | null
Letter grade given at this inspection: A, B or C; N not yet graded; Z grade pending; P grade pending on reopening after a closure. Null when none was given. null when the source gives no value.
string | null
Date of the grade, YYYY-MM-DD, or null.
string | null
What the city did at the inspection, in its words. null when the source gives no value.
object[]
The violations cited, by code; empty when none was recorded.
string
The violation code the city uses, for example 04N.
string | null
What the inspector cited, in the city’s words. null when the source gives no value.
boolean
Whether the city flags the violation as critical.
See Pricing for this tool’s price. A wallet (x402) call receives it in the 402 quote before anything is charged; a call paid from prepaid credits is charged when the API accepts the request and answers 200.

Notes

  • Each establishment has its name, address, borough, ZIP code, cuisine and location; each inspection its date, type, score, letter grade with its date, the action taken and the violations cited, each with its code, description and whether it is critical.
  • Give at least one of establishment_id and name; the id takes precedence when both are given. name matches anywhere in the trade name, ignoring case; zipcode narrows either search.
  • Inspections are newest first, at most limit per establishment.
  • The call reads the 200 newest violation rows that match, which is why a broad name can leave out older inspections; when those rows all fall on one date the call fails as invalid input.
  • An establishment not yet inspected has an empty inspections list.
  • Dates are YYYY-MM-DD and a value the source does not give is null. No match is a completed result with an empty establishments list.
  • Results return inline. The finished job stays available at /v1/requests/{request_id}