michigan-dining-api
This API serves information about the University of Michigan's Dining Halls.
About
Data is scraped daily from the dining.umich.edu menu pages, formatted and stored in a database to be served. This allows for data structures and formats that are easier to work with than the raw site, and for historical data to be retrieved further back than the site itself keeps around (2019-11-02 is the earliest date available through this service). Check out the MDining statistics page of tendies time for examples of using this historical data.
The project is located on github here, forked from the original by Anders Boberg. Currently this is used to support tendiesti.me. This API can be accessed through grpc, grpc-web, or a REST API. To access the API through grpc and grpc-web, use the proto service definitions in proto/.
GRPC
This service was built with grpc in mind. Queries through grpc to this service will be significantly faster than thier REST counterparts since REST requests are just proxied to grpc queries and therefore require serialization and deserialization between protobufs and JSON.
REST Endpoints
REST Endpoints still return data according to the service definitions in proto/, but the responses will be serialized in JSON instead of binary protobuf formats. Here is a list of REST JSON endpoints that exist as of writing (with links for example queries):
-
/v1/all
Provides /v1/diningHalls /v1/items and /v1/filterableEntries in a single request.
-
/v1/diningHalls
Provides an array of U of M dining halls (including cafes and markets), each with a
name, thecampusgroup it belongs to (DINING HALLS,CAFES, orMARKETS), and up to 7 days of operating hours indayHours(today through 6 days out, one entry per date actually open). Use the exactnamevalues from this endpoint when querying/v1/menusbelow. -
/v1/items
Provides a list of items for today and the next seven days. For each item, information on which dining halls are serving it is included among other things.
-
/v1/filterableEntries
Provides a list of filterable entries. Each entry includes an item name, dining hall the item is being served at, the date it is being served on and attribute information.
-
/v1/menus?date={yyyy-MM-dd}&diningHall={DINING_HALL}&meal={MEAL}
Provides the full menu for the given date, dining hall and meal, including nutrition information for menu items.
dateis required;diningHallandmealare optional and, if omitted, all matching menus are returned instead of just one.diningHallandmealare exact, case-sensitive matches against thenamevalues from/v1/diningHalls(e.g.Bursley, notBursley Dining Hall) and themealvalues from this same endpoint (e.g.Breakfast,Lunch,Dinner— title case, notLUNCH). A misspelled or wrong-case value currently returns a single menu with every field blank rather than an error, so double-check casing against a live response if you get an empty-looking result. -
/v1/foods?name={LOWERCASE_FOOD_NAME}&date={yyyy-MM-dd}
Provides information on where the given food is being served on the given date (or, in place of
date, astartDate/endDaterange). Includes nutrition info.nameis matched lowercase, exactly as returned elsewhere in lowercase form. -
/v1/summarystats
Provides summary statistics on MDining service. For example, includes information on counts of how many times each food was served on each day of the week.
-
/v1/stats
Provides in depth information on daily MDining service. Too large in practive to be used.
-
/v1/hearts?keys={LOWERCASE_FOOD_NAME}&keys={etc...}
Provides access to the hearts database which powers the hearts functionality on the tendies time menu page which allows users to click on a heart to indicate they like the item.