InspectionMapper.com is a handy tool that helps you decide which restaurants in DC are up to snuff... and which are not.
Data updated monthly from DC Department of Health inspections (April 2010 to present).

Regulation

Search from

to

Filter

ajax-loader  Loading...

Inspection Grade: What's this?

Rating: ( Reviews) View on Yelp

Violation Summary (April 2010 to Present)

Regulation

 

About

InspectionMapper is a personal foray into the possibilities of open government data and a learning experience for me in data scraping, database management, and website design. The site scrapes data from the DC Department of Health Online Food Facilities Inspections and puts it what I hope is an easier, friendlier interface that helps people make decisions about which restaurants are safe... and which to avoid. If you have any questions, concerns, or suggestions, contact me at @GrahamIMac.

I am not the first person to do this. For other iterations, see Luke Berndt's cleaneats.org, and Sean Gorman, Travis Pinney, and Kate Chapman's Yelp/Inspection mashup.

Grading System: InspectionMapper uses a grading system similar to the City of New York. InspectionMapper looks at the restaurant's 18 month history of inspections (on a rolling, constantly updated basis) and gives each restaurant 5 points for every critical violation and 2 points for every non-critical violation in that time span. These two values are totaled to produce a score.

Restaurants with scores of 10 or below are classified as "A"s (about 25% as of the time of this writing), 11 to 20 are classified as "B"s (21%), 21 to 35 are classified as "C"s (22%), 36 to 55 are classified as "D"s (16%), and 56 and above are classified as "F"s (16%).

 

InspectionMapper API

InspectionMapper is built on top of six distinct API calls that return data in JSONP format. All data comes from the DC Department of Health Online Food Facilities Inspections in the "Restaurants Total" category.

All Restaurants Overview

This call returns a list of all restaurants in the database, whether or not they have had an inspection (some restaurants on the DC DOH site do not have any inspections listed). The call returns each restaurant's name, permit ID, and address.

Format specification:

http://grahamimac.com/inspectionmapper/allrest_id.php?callback=<String>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/allrest_id.php?callback=?';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"results":[{"name":"10TH ST BAPTIST CHURCH ANNEX","pid":1252,"addr":"1001 R ST NW Washington, DC 20009"},{"name":"10TH ST BAPTIST CHURCH MAIN KIT","pid":1230,"addr":"1000 R ST NW Washington, DC 20009"},...]}

Single Restaurant Details

This call returns a detailed data for a single restaurant, queried by its unique permit ID (you can get each restaurant's permit ID from the All Restaurants Overview call above). This call returns the restaurant's name, address, x and y coordinates, total inspections, critical violations, non-critical violations, and violations for insects, rodents, and animals (all since April 2010), and each individual violation's inspection date, violation type, and inspector description. Data covers the period April 1, 2010 to present.

Format specification:

http://grahamimac.com/inspectionmapper/onerest.php?callback=<String>&permitid=<Numeric>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/onerest.php?callback=?&permitid=509';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"restaurant":{"name":"J & P CAFETERIA","addr":"1301 4TH ST NE Washington, DC 20002","coords":{"lat":38.90916300,"lon":-76.99896100},"totInsp":3},"totals":{"critical":6,"non_critical":7,"pests":1},"violations":[{"date":"10/25/2011","violation":"Food-contact surfaces: cleaned & sanitized","description":"CLEAN INTERIOR OF ALL REFRIGERATION UNIT INCLUDING FREEZER. DEFROST FREEZER. CLEAN ALL EQUIPMENTS AND COOKING AREA. (DIRT BUILT UP, STAINS, GREASY)(CORRECT VIOLATION WITHIN 5 CALENDAR DAYS)"},{"date":"10/25/2011","violation":"Insects, rodents, & animals not present","description":"LIVE ROACHES SEEN IN KITCHEN AND STORAGE AREA.(CORRECT VIOLATION WITHIN 5 CALENDAR DAYS)"},...]}

All Violations Categories

This call returns a list of all violations categories and their ID numbers in the database.

Format specification:

http://grahamimac.com/inspectionmapper/violdesc.php?callback=<String>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/violdesc.php?callback=?';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"Adequate handwashing sinks properly supplied and accessible":8,"Adequate ventilation & lighting: designated areas used":54,..}

Multiple Restaurant Violations Summary

This call returns a list of all (or optionally in batches of 50) restaurants, permit IDs, addresses, x and y coordinates, total violations, within a specified time period, and optionally within a specified violation category (see All Violations Categories above for a complete list).

Format specification:

http://grahamimac.com/inspectionmapper/restlist.php?callback=<String>&from=<Numeric Date>&to=<Numeric Date>&violnum=<Numeric>&batch=<Numeric>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

Numeric Dates are 8-digit numbers that follow the pattern yyyymmdd (e.g., October 14, 2012 is 20121014).

The violation number (optional) corresponds with the violation category numbers provided by the All Violations Categories call above.

Batch (optional) is an integer i that returns a batch of the ith 50 records (i.e., 1 returns records 1 to 50, 2 returns 51 to 100, etc.).

var url = 'http://grahamimac.com/inspectionmapper/restlist.php?callback=?&from=20111014&to=20121014&violnum=36&batch=1';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"from":20111014,"to":20121014,"violnum":"36","batch":"1","results":[{"pid":1720,"name":"COSI","addr":"1350 CONNECTICUT AVE NW Washington, DC 20036","coords":{"lat":38.90830500,"lon":-77.04307940},"viol":5,"insp":7},{"pid":3864,"name":"CHINATOWN EXPRESS","addr":"746 6TH ST NW Washington, DC 20001","coords":{"lat":38.89957380,"lon":-77.02012680},"viol":4,"insp":3},...]}

Yelp Crosswalk

This call takes as input a restaurant PermitID and returns a Yelp Business ID.

Format specification:

http://grahamimac.com/inspectionmapper/yelpscore.php?callback=<String>&permitid=<Numeric>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/yelpscore.php?callback=?&permitid=509';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"id":"j-and-p-cafeteria-washington"}

Yelp Reverse Lookup

This call takes as input a Yelp Business ID and returns a restaurant PermitID. Use this to add inspection information to a website that is already using Yelp data.

Format specification:

http://grahamimac.com/inspectionmapper/yelptoinsp.php?callback=<String>&yid=<String>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/yelptoinsp.php?callback=?&yid=popeyes-washington';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"permitID":"520"}

OpenTable Crosswalk

This call takes as input a restaurant PermitID and returns an OpenTable ID.

Format specification:

http://grahamimac.com/inspectionmapper/openid.php?callback=<String>&permitid=<Numeric>

To use the API with jQuery, use "?" as your string. Example (requires jQuery):

var url = 'http://grahamimac.com/inspectionmapper/openid.php?callback=?&permitid=547';

$.getJSON(url, function(data){ // Your code here });

Result (jQuery stores the following object in the local variable "data", which we specified above):

{"id":"953"}

 

Download Data

Analyze these data (please)! The six relational database tables underlying inspectionmapper are available for download below in CSV format. Just like the site and API, these data will be updated the first Sunday of every month. If you analyze them, please let me know at @GrahamIMac.

Inspections (CSV)      Restaurants (CSV)      Violations (CSV)      Violations Key (CSV)

Yelp Crosswalk (CSV)      OpenTable Crosswalk (CSV)