Phalange Restaurant Inspection API
Programmatic access to official restaurant health-inspection records for nine US cities, republished from each city's own open data and refreshed by a daily sync. This API is the delivery channel for the data-licensing product: callers license a scope and pull it here. Calls are metered from day one; today nothing is charged. The headline endpoint is business compliance completion — one business in, its inspection answer out; the record endpoints below it are supporting detail.
Base URL
https://eat.phalangeai.com — all endpoints are under /api/v1/. The machine-readable contract is the OpenAPI 3.1 document.
Authentication
Send your API key on every data request:
Authorization: Bearer <key>
Demo key (public, for evaluation): demo-phalange
The demo key is rate-limited: 60 requests per minute per IP, plus 300 requests per day per IP. Production keys are issued per buyer, encode the licensed scope, and carry higher allowances. Requests with no key or an invalid key get 401 { "error": { "code": "unauthorized", ... } }. Every error from this API has that same shape: { "error": { "code", "message" } }.
Endpoints
GET /api/v1/compliance/lookup — Business compliance completion
The headline endpoint. Give it a business name and street address; it finds the business in the stored city feeds and completes the answer: the matched entity, its latest inspection, the result on the city's own scale, the violation lines on that inspection, how many of them are critical, and whether the venue was closed at that inspection.
| Parameter | Required | Notes |
|---|---|---|
name | yes | Business name as it appears in the city's records. |
address | yes | Street address; the street number strongly drives the match, ZIP helps. |
city | no | City id from /api/v1/cities. Omit to search every DB-ready city. |
curl -H "Authorization: Bearer demo-phalange" \ "https://eat.phalangeai.com/api/v1/compliance/lookup?name=Tapicozza%20Chi&address=1002%20W%20Lake%20St&city=chicago"
Matching is deterministic and documented in the OpenAPI document: score = 0.6 · nameSim + 0.4 · addrSim over normalized tokens, with the street number required for a strong address score. The response reports entity_match_confidence (0–1) and matchLevel (high ≥ 0.8, medium ≥ 0.55, low below that), plus how many candidates were considered.
Coverage semantics — read this before integrating. coverage_status distinguishes three states that must never be conflated:
"covered"— the business was matched in a city whose feed is live; the inspection fields describe it."stale"— matched, but the city's source has stalled (LA County, Santa Clara County). The data is returned flagged, withdata_updated_atshowing its age."not_covered"— no candidate matched at medium or better in any searched city. The venue and every inspection field arenull— never zeros — so "we don't cover this business" can always be told apart from "covered, and no violations found". A weak (low) best guess is reported as score and level only; it is never presented as the business.
critical_violations uses one narrow definition, returned verbatim in every response as critical_definition: violation lines cited on the venue's latest inspection when that inspection failed or closed the venue under the city's own result scale; 0 when the latest inspection passed. It is not a cross-city severity score. closure_status is "unknown" for Cambridge, which publishes no result.
GET /api/v1/cities
The nine live cities with feed state, stored totals, newest inspection date and lag.
curl -H "Authorization: Bearer demo-phalange" \ https://eat.phalangeai.com/api/v1/cities
GET /api/v1/venues/search
Search venues in one city against the stored copy.
| Parameter | Required | Notes |
|---|---|---|
city | yes | City id from /api/v1/cities. |
q | no | Name/address text; empty matches every venue. |
limit | no | Default 10, max 25. |
curl -H "Authorization: Bearer demo-phalange" \ "https://eat.phalangeai.com/api/v1/venues/search?city=chicago&q=taco&limit=10"
Each result carries the venue key, name, address, license number, its latest inspection (date, the city's own result string, score/grade where published, violation count) and its stored inspection total. Unknown city → 404 unknown_city; a city with no servable stored copy → 503 city_unavailable.
GET /api/v1/venues/{cityId}/{venueKey}
One venue: its full stored inspection timeline (newest first) plus the violation lines of its most recent inspection.
curl -H "Authorization: Bearer demo-phalange" \ "https://eat.phalangeai.com/api/v1/venues/chicago/<venueKey>"
Take venueKey from search results and URL-encode it. A venue that does not exist → 404 venue_not_found.
GET /api/v1/changes
License-grain records: every stored inspection for one city with inspected_at >= since — the licensing delivery pull. Pulls are idempotent and cursor-paginated; records carry stable venue keys so you can dedupe and join across deliveries.
| Parameter | Required | Notes |
|---|---|---|
city | yes | One city per call. |
since | yes | YYYY-MM-DD, within the last 45 days. |
limit | no | Page size in venues (default 100, max 200); records per page vary — one venue can carry several inspections. |
cursor | no | The previous page's nextCursor. |
curl -H "Authorization: Bearer demo-phalange" \ "https://eat.phalangeai.com/api/v1/changes?city=chicago&since=2026-11-20&limit=100"
Each record flags isLatestForVenue and hasViolationDetail. While a data refresh is running the endpoint refuses with 503 sync_in_progress — retry after it finishes (refresh windows are short).
GET /api/v1/risk-summary
Thirty-day aggregates for one city, over the 30 days ending on its newest stored inspection date: stored totals, window inspections, window failures and failure rate (each city's own failure definition on its own result scale), and its most-inspected venues.
curl -H "Authorization: Bearer demo-phalange" \ "https://eat.phalangeai.com/api/v1/risk-summary?city=chicago"
Cambridge publishes no result, so its windowFailures and failureRate are null. These are counts of official outcomes — not a safety score.
GET /api/v1/openapi.json
The full OpenAPI 3.1 document for this API. No authentication required.
Field honesty rules
These rules are part of the contract, not fine print:
- Violation text exists only for each venue's most recent inspection. The underlying retention design stores full violation lines for the latest inspection only; older inspections carry result, score/grade and violation counts.
- Austin and Miami-Dade publish no violation text at all — their records never carry violation lines, and the feed says so per record instead of filling the gap.
- Results are each city's own scale (Pass/Fail, letter grades, placards, scores). This API never converts them into a universal safety score, and licensees must not present them as one.
- Two feeds are paused. LA County and Santa Clara County are flagged
feedState: "paused-source-stalled"because their government sources stalled in October 2026; their stored data is served as-is, never as current. - Freshness is published, per city.
/api/v1/citiesreports each city's newest stored inspection and its lag in days.
Licensing, metering and production keys
Every call is metered (caller, endpoint, time) from day one. Paid tiers are metered, not charged, today: no payment rail exists yet, and none will be switched on silently. Production keys — with a licensed city scope and higher allowances — are issued on request while the licensing package is finalized. To request one, contact [email].
This demo API is metered, not charged. Paid plans are planned as x402-compatible per-call pricing (exact/upto) and will be served from edge endpoints; no payment is requested or accepted today.
MCP server and Agent Skill
The same operations are packaged for direct embedding in agent workflows. The MCP server (one zero-dependency Node file, stdio + Streamable HTTP transports) exposes four tools — restaurant_compliance_lookup, restaurant_search, restaurant_venue_detail, restaurant_risk_summary:
curl -O https://eat.phalangeai.com/mcp-server.mjs claude mcp add phalange-restaurant-inspection -- node /path/to/mcp-server.mjs
The Agent Skill restaurant-due-diligence teaches the full workflow — compliance lookup first, coverage_status before any conclusion (not_covered means no data, never a clean record), conclusions always carrying their source. Setup details for both transports and other MCP clients are in the kit README in the project repository (agent-kit/README.md).
More
- OpenAPI 3.1 specification
- MCP server (single file, no dependencies) and the restaurant-due-diligence Agent Skill.
- llms.txt — the site's machine-readable overview, including this API.
- Restaurant Inspection Lookup — the consumer site this data also powers.