Catalog

Course Lookup

/courses/all (GET)

Returns a JSON list of all courses in the current version of the catalog, sorted by subject ID as strings. Takes Boolean query parameter full, indicating whether to return the full set of information for each subject or an abbreviated version.

Each entry in the abbreviated version is a dictionary that has the following keys:

  • subject_id - subject ID string, e.g. "6.1200".
  • title - the full title, e.g. "Mathematics for Computer Science".
  • total_units - number of units.
  • offered_fall, offered_IAP, offered_spring, offered_summer - whether the class is offered in the given semester.
  • public - whether the subject is a custom subject. For catalog subjects, this is always true.

These dictionaries may optionally contain the keys:

  • level - undergraduate or graduate. Possible values: "U", "G".
  • is_historical - whether the subject is historical, i.e. not in the current catalog.
  • source_semester - for historical subjects, the semester info is sourced from, e.g. "fall-2018".
  • joint_subjects - list of equivalent subject IDs, e.g. ["18.062"].
  • equivalent_subjects - list of subject IDs that credit cannot also be received for, e.g. for 8.02, ["8.021", "8.022", "ES.802", "ES.8022"].
  • meets_with_subjects - list of subject IDS that the subject meets with.
  • quarter_information - string representing when subject ends or begins, e.g. "0,apr 14" meaning subject ends on Apr 14, or "1,4/4" meaning subject begins on 4/4, or "2,4/9 to 5/9" meaning subject meets from 4/9 to 5/9.
  • not_offered_year - school year subject is not offered in, e.g. "2022-2023".
  • instructors - list of instructors. Each entry represents a semester, and multiple instructors can appear in a single semester, e.g. ["Spring: A. Hacker", "Fall: A. Hacker, B. Bitdiddle"].
  • communication_requirement - possible values: "CI-H", "CI-HW".
  • hass_attribute - comma-separated string, with possible values: "HASS-A", "HASS-E", "HASS-H", "HASS-S".
  • gir_attribute - possible values: "BIOL", "CAL1", "CAL2", "CHEM", "LAB", "LAB2", "PHY1", "PHY2", "REST".
  • children - for subjects that meet with several classes per semester, e.g. ["5.601", "5.602"].
  • parent - parent subject IDs for subjects that are children, e.g. for 5.601 or 5.602, "5.60".
  • virtual_status - possible values: "In-Person", "Virtual".
  • old_id - old subject ID, e.g. "6.042".

With full, dictionaries will contain the above information, plus the following keys:

  • lecture_units, lab_units, design_units, preparation_units - number of units for each kind, sum to total_units.
  • is_variable_units - whether the number of units is arranged.
  • is_half_class - whether the subject counts as a half class for requirements purposes. This is false for all subjects except some 21M ones.
  • has_final - whether the subject has a final.

With full, dictionaries may optionally have the keys:

  • description - catalog description.
  • prerequisites - string representing prerequisites. Separated by commas and slashes, e.g. "18.701/(18.703, (18.06/18.700))/''permission of instructor''".
  • corequisites - string representing corequisites. Separated by commas and slashes, e.g. "GIR:CAL2, (CC.010/CC.011/CC.A10)".
  • schedule - string representing latest class schedule, e.g. "Lecture,4-237/MWF/0/1;Recitation,34-101/TR/0/1,34-301/TR/0/2". More specifically, a schedule is a semicolon-separated list of sections.
    • Each section is a comma-separated list.
      • The first entry of a section is either "Lecture", "Recitation", "Lab", or "Design".
      • Each subsequent entry in a section is a meeting.
        • Each meeting is either "TBA" or a slash-separated list.
        • The first entry is the room number, e.g. "54-1423", "VIRTUAL", "NORTH SHORE".
        • The second entry is one or more characters from "M", "T", "W", "R", "F", "S".
        • The third entry is either "0" or "1".
        • If the third entry is "0", the fourth entry is a non-evening hour, e.g. "9" or "1-2.30".
        • If the third entry is "1", the fourth entry is an evening hour, e.g. "4-7 PM" or "5.30 PM".
  • url - catalog URL.
  • related_subjects - list of related subject IDs, as determined by Fireroad's natural language processing.
  • rating - average rating, as a number out of 7.0, according to course evaluations.
  • enrollment_number - average number of enrolled students, according to course evaluations.
  • in_class_hours, out_of_class_hours - average number of in-class or out-of-class hours, according to course evaluations.
/courses/dept/<dept code> (GET)

Returns a JSON list containing all subjects in the given department (the subject ID prefix, such as "6", "WGS"), in numerically sorted order. If the department does not exist, returns an empty list. Takes Boolean query parameter full, indicating whether to return the full set of information for each subject or an abbreviated version.

/courses/lookup/<subject ID> (GET)

Returns a JSON description of the course with the given subject ID, or a 404 error if the course is not present.

The JSON description is the same format as the full version of the all courses lookup API.

/courses/search/<search term> (GET)

Returns a JSON list of courses for the given search term. Currently only the subject ID and subject title are searched. Takes Boolean query parameter full, indicating whether to return the full set of information for each subject or an abbreviated version. Also takes query parameters to filter the results:

  • type: The match type to use with the search term. Possible values: "contains" (default), "matches", "starts", "ends"
  • gir: Filter by GIR requirement. Possible values: "off" (default), "any", "lab", "rest"
  • hass: Filter by HASS requirement. Possible values: "off" (default), "any", "a", "s", "h"
  • ci: Filter by communication requirement. Possible values: "off" (default), "cih", "cihw", "not-ci"
  • offered: Filter by semester offered. Possible values: "off" (default), "fall", "spring", "IAP", "summer"
  • level: Filter by course level. Possible values: "off" (default), "undergrad", "grad"

Course Updater

These endpoints can be used to update a local version of the course database, such as in a mobile app.
/courseupdater/semesters (GET)

Returns a JSON list specifying the order of the semesters available on the server, as well as their current version numbers.

/courseupdater/check (GET)

Given a semester and local version number, returns a new version number and the delta of catalog files that should be updated. Takes as query parameters:

  • sem: a comma-separated specification of the semester (e.g. "fall,2018")
  • v: the local version number of the catalog