SF Restaurant Inspection Scraper
Pricing
from $3.00 / 1,000 results
SF Restaurant Inspection Scraper
Scrape the official SF Dept. of Public Health restaurant/food-facility inspection dataset. Filter by neighborhood, district, rating status, permit/inspection type, violations, or date; lookup by permit number. Free Socrata API, no login.
Pricing
from $3.00 / 1,000 results
Rating
0.0
(0)
Developer
Crawler Bros
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Share
Scrape the official San Francisco Department of Public Health (DPH) Health Inspection open dataset. Search or filter San Francisco restaurant/food-facility inspections by neighborhood, supervisor district, facility rating status, permit type, inspection type, violation count, or date range — or pull a facility's complete inspection history by its permit number. Powered by the public SF Open Data (Socrata) API. No login, no API key, no proxy required.
What this actor does
- Two modes:
search(filter/browse) andbyPermitNumber(exact facility lookup) - Rich filters: neighborhood, supervisor district, facility rating status, inspection type, inspection frequency type, permit type, violation count range, "has violations only", date range, facility-name keyword
- Search near a location — filter to facilities within a radius (in meters) of any latitude/longitude point
- Full-text search across facility name, address, and other text fields
- Every inspection row — one record per inspection event, so a single facility can appear multiple times across its inspection history
- Geo data — latitude/longitude, analysis neighborhood, supervisor district, inspection district/subdistrict/subsector
- Empty fields are omitted — an inspection with no cited violations simply has no
violationCount/violationCodesfield, never a placeholder
Output per inspection record
permitNumber— unique DPH facility permit numberdba— facility name ("doing business as")city,state— always San Francisco, CAstreetAddressanalysisNeighborhood— SF planning analysis neighborhoodsupervisorDistrict— Board of Supervisors district (1-11)district,subdistrict,subsector— DPH internal inspection-area codescensus— census tract code for the facility (when available)inspectionDate,inspectionType,inspectionFrequencyType,inspectorpermitType— DPH permit/facility classificationtotalTimeMinutes— time DPH spent on the inspectionfacilityRatingStatus— Pass / Conditional Pass / ClosureviolationCount,violationCodes— only present when violations were citedlatitude,longitudedataAsOf— when SF Open Data last refreshed this rowrowId— stable Socrata row identifiersourceUrl— direct link to this exact record on SF's open-data APIrecordType: "inspection",scrapedAt
Input
| Field | Type | Default | Description |
|---|---|---|---|
mode | string | search | search (filter/browse) or byPermitNumber (exact lookup) |
searchQuery | string | – | Full-text search across facility name/address text fields (mode=search) |
dbaKeyword | string | – | Case-insensitive substring match on facility name |
permitNumbers | array | – | Permit numbers to fetch inspection history for (mode=byPermitNumber) |
analysisNeighborhood | string | any | One of 39 SF analysis neighborhoods |
supervisorDistrict | string | any | Board of Supervisors district 1-11 |
facilityRatingStatus | string | any | Pass / Conditional Pass / Closure |
inspectionType | string | any | One of 14 DPH inspection types |
inspectionFrequencyType | string | any | 1 (annual) / 2 (semi-annual) / High Hazard / N/A |
permitType | string | any | One of 105 DPH permit/facility classifications |
inspectionDateFrom / inspectionDateTo | string | – | ISO date range (YYYY-MM-DD) |
minViolationCount / maxViolationCount | int | – | Violation-count bounds (0–50) |
hasViolationsOnly | boolean | false | Only include inspections with at least one cited violation |
nearLatitude / nearLongitude | number | – | Center point for a radius search. Both must be set together to activate the filter. |
nearRadiusMeters | int | 500 | Radius (1–50,000 m) around nearLatitude/nearLongitude. Only applied when both coordinates are set. |
sortBy | string | inspectionDateDesc | Sort order — inspection date, violation count, facility name, neighborhood, or supervisor district |
appToken | string | – | Optional free Socrata app token for higher rate limits |
maxItems | int | 50 | Hard cap on emitted records (1–10000) |
Example: browse the latest inspections in the Mission with a Conditional Pass or worse
{"mode": "search","analysisNeighborhood": "Mission","facilityRatingStatus": "Conditional Pass","maxItems": 50}
Example: full inspection history for a specific facility
{"mode": "byPermitNumber","permitNumbers": ["93127"]}
Example: routine inspections with violations in a date range
{"mode": "search","inspectionType": "Routine","hasViolationsOnly": true,"inspectionDateFrom": "2025-01-01","inspectionDateTo": "2025-12-31","maxItems": 200}
Example: keyword search for a restaurant chain
{"mode": "search","dbaKeyword": "pizza","maxItems": 100}
Example: facilities within 500m of SF Civic Center
{"mode": "search","nearLatitude": 37.7793,"nearLongitude": -122.4193,"nearRadiusMeters": 500,"maxItems": 100}
Use cases
- Food safety research — track violation trends by neighborhood, permit type, or time period
- Consumer apps — surface a restaurant's rating status and violation history before a visit
- Real estate / business intelligence — assess food-service density and compliance by neighborhood or supervisor district
- Journalism — investigate closures, repeat violators, or rating patterns
- Academic research — bulk-export inspection data for public health studies
FAQ
What is the data source?
The San Francisco Department of Public Health's "Health Inspection Scores (2024-Present)" dataset, published on SF Open Data (Socrata, dataset ID tvy3-wexg) and updated monthly by the city.
Why 2024-Present and not the full inspection history? SF DPH retired its older "LIVES" scoring standard at the end of 2023. The 2024-Present dataset uses the current facility-rating methodology and is the dataset the city actively maintains going forward; older LIVES-era datasets use a different, no-longer-updated schema (numeric 0-100 scores instead of Pass/Conditional Pass/Closure).
Is this affiliated with the City and County of San Francisco or DPH? No. This is an independent, third-party actor built on SF's public open-data API.
Why do some records have no violationCount/violationCodes field?
Not every inspection results in a cited violation. When an inspection has zero violations, both fields are simply omitted rather than showing a placeholder or a zero that could be confused with "not yet processed".
Why does one facility appear multiple times? Each row in the source dataset represents one inspection visit. A facility inspected several times over the years will have one record per visit.
What does facilityRatingStatus mean?
The outcome DPH assigned after the inspection: Pass, Conditional Pass (violations found that must be corrected on a timeline), or Closure (facility closed due to health/safety risk).
How fresh is the data?
SF Open Data refreshes this dataset monthly. Each record includes a dataAsOf field showing when it was last synced upstream from DPH's inspection system.
Are there rate limits? The Socrata API allows unauthenticated access with reasonable limits. Supplying a free Socrata app token (optional) raises those limits, but the actor works without one.
How does the "search near a location" filter work?
Set both nearLatitude and nearLongitude (and optionally nearRadiusMeters, default 500m) to only return inspections within that radius of a point. Setting only one of the two coordinates disables the filter — both are required together. This is combined with all other filters (neighborhood, rating status, date range, etc.) using AND.
What fields are NOT included in the output?
Two documented columns (suspension_notes, inspection_notes) are 100% empty across the entire live dataset, so they're excluded entirely.