API
SafeDine API, version 1.
Three read-only JSON endpoints: search restaurants, fetch one restaurant with its inspections, and find restaurants near a point. Every request needs an API key.
Access
Send the key as a bearer token in the Authorization header. A missing, invalid or over-limit key is refused with 401.
Each key has a daily request limit. Responses report it in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and every response carries X-Api-Version: 1.
Keys are created from a signed-in SafeDine account with an active Owner Pro subscription. Owner Pro is not open yet, so a new account cannot get a key today.
Search restaurants
GET /api/v1/restaurants
Returns matching restaurants and a total count, up to 100 per request. Score filters are refused: version 1 has no rule yet for which scores can be compared with each other.
| Parameter | Accepts |
|---|---|
| search | Search text |
| state | State |
| city | City |
| cuisine | Cuisine |
| limit | 1 to 100, default 50 |
One restaurant
GET /api/v1/restaurants/{id}
Accepts a SafeDine restaurant ID or a license number. Returns the restaurant, its score fields, and each inspection on file with its date, type, finding counts by priority and result. An unknown ID returns 404.
Restaurants near a point
GET /api/v1/restaurants/nearby
Returns restaurants within a radius of a point, each with its distance in miles. Without lat and lng the request is refused with 400.
| Parameter | Accepts |
|---|---|
| lat | Latitude, required |
| lng | Longitude, required |
| radius | Miles, default 5, up to 50 |
| limit | Default 30, up to 50 |
Score fields
Search and single-restaurant responses include the fields below. How scores work explains score, grade, trend and confidence.
- score
- grade
- trend
- confidence
- inspectionCount
- lastInspectionDate
- scoreWithheld
- dataClass
- dataLabel
- dataCaveat
- sourceCapability
- safeDineScoreKind
- freshnessStatus
- quarantineStatus