[SOO-bee-tahyz] (v.) - to rapidly, accurately, and confidently perceive the number of objects without counting
The data used by Subitize is available in two forms: as a SQL dump on Github, and as a GET
JSON endpoint that also supports queries. The endpoint is used by the app itself, and is available at:
/json
The parameters and the returned object are described below, with an example at the end.
The JSON endpoint supports the following parameters. All other parameters are ignored:
semester
- The semester, given as a six digit code. The first four digits represent the academic year, encoded as the ending calendar year. The last two digits represent the semester within that academic year, starting with Fall semester and ending with Summer semester. For example, Fall 2017 is represented by 201801
, since it's the first (01
) semester in the 2017-2018
academic year.
department
- The department, given as the code used in course numbers. These are the same codes used on Course Counts. For example, the Computer Science department is represented by COMP
.
lower
- The lowest course number, inclusive. Non-digit characters in course numbers (eg. COMP 131L) are ignored for the purpose of this parameter. If a specific course number is desired, set both lower
and upper
to that number.
upper
- The highest course number, inclusive. Non-digit characters in course numbers (eg. COMP 131L) are ignored for the purpose of this parameter. If a specific course number is desired, set both lower
and upper
to that number.
units
- The number of units of the course.
instructor
- The instructor of the course, given as the "system name" for that instructor. Results will include courses taught by multiple instructors.
core
- The core requirement fulfilled by the course, given as a code. These are the same codes used on Course Counts. For example, the Lab Science core requirement is represented as CPLS
. Results will include courses that fulfill multiple core requirements.
day
- The day of the week on which the course meets, given as a one-letter code. Must be one of MTWRFU
, with R
for Thursday and U
for Saturday. These are the same codes used on Course Counts. Results will include courses that meet on multiple days.
start_hour
- The time after which the course must start, inclusive, given in military time. For example, 9:35am is represented as 0935
, and noon is represented as 1200
. For courses that meet at different times throughout the week, this parameter only needs to apply to a single meeting time.
end_hour
- The time before which the course must end, inclusive, given in military time. For example, 9:35am is represented as 0935
, and noon is represented as 1200
. For courses that meet at different times throughout the week, this parameter only needs to apply to a single meeting time.
open
- Whether only "open" courses should be included in the results given as either true
or false
. A course is "open" if there is no one on the waitlist and the number of seats remaining (ie. total number of seats - number of reserved seats) is larger than the number of enrolled students.
query
- Search terms, corresponding to the main search bar on the app.
sort
- How to sort the results. The values must be one of semester
, course
, title
, units
, instructors
, meetings
, cores
. Defaults to semester
.
advanced
- Whether the advanced search options should be displayed on the app. Has no impact on search results.
The endpoint returns a JSON object with the following structure:
{
"metadata": {
"parameters": "query=computer+science",
"sorted": "semester"
},
"results": [...]
}
metadata.parameters
contains the GET
parameters that generated the result, while metadata.sorted
contains the field by which the results are sorted.
results
contains the list of up to 200 search results as JSON objects. Each object has the following keys:
id
- A unique identifier for the course.
semester
- A JSON object representing the semester. Each object has the following keys:
code
- The semester code. Same as the semester
parameter.year
- The calendar year of the semester.season
- "Fall"
, "Spring"
, etc.department
- A JSON object representing the department. Each object has the following keys:
code
- The department code. Same as the department
parameter.name
- The full name of the department.number
- A JSON object representing the course number. Each object has the following keys:
number
- The course number as an integer.string
- The course number as a string, including any punctuation and letters.section
- The section of the course, as a string.
title
- The title of the course.
units
- The number of units of the course, as an integer. Same as the units
parameter.
instructors
- A list of JSON objects representing the instructors. Each object has the following keys:
system_name
- The name of the instructor, according to Course Counts. Same as the instructor
parameter.first_name
- The first name of the instructor.last_name
- The last name of the instructor.meetings
- A list of JSON objects representing the class meetings. Each object has the following keys:
building
- A JSON object representing the building in which the class meets. May be null
if the meeting location is to be determined. Each object has the following keys:
code
- The code for the building.name
- The name of the building.room
- The room number in which the class meets, as a string. May be null
if the meeting location is to be determined.
weekdays
- A JSON object representing the days of the week in which the class meets. May be null
if the meeting time(s) is to be determined. Each object has the following keys:
codes
- The capital letters of all the days the class meets.names
- A comma-separated string of the names of all the days the class meets.us_start_time
, us_end_time
- The start and end times of the class meeting, formated for US audiences (ie. [H]H:MM(am|pm)
). May be null
if the meeting time(s) is to be determined.iso_start_time
, iso_end_time
- The start and end times of the class meeting, formated according to ISO 8601 (ie. HH:MM
). May be null
if the meeting time(s) is to be determined.cores
- A list of JSON objects representing the core requirements the course fulfills. Each object has the following keys:
code
- The code for the core requirement. Same as the core
parameter.name
- The name of the core requirement.num_seats
- The total number of seats in the course.
num_reserved
- The number of reserved seats in the course.
num_reserved_open
- The number of open reserved seats in the course.
num_enrolled
- The number of students currently enrolled in the course.
num_waitlisted
- The number of students on the waitlist for the course.
info
- A JSON object representing additional information about the course. Currently still in development, so information may be missing or inaccurate. Each object has the following keys:
description
- The course catalog description. May be null
.prerequisites
- The prerequisites for the course. May be null
.corequisites
- The corequisites for the course. May be null
.url
- The URL to the course's catalog page. May be null
.All Computer Science courses taught by Justin Li during the Fall 2017 semester can be found by the following request:
/json?department=COMP&instructor=Justin Li&semester=201801
It results in the following response (ellipses inserted for readability where appropriate):
{
"metadata":{
"parameters":"department=COMP&instructor=Justin+Li&semester=201801",
"sorted":"semester"
},
"results":[
{
"id":"201801_COMP_131_1",
"semester":{
"code":"201801",
"year":2017
"season":"Fall",
},
"department":{
"code":"COMP",
"name":"Computer Science"
},
"number":{
"number":131,
"string":"131"
},
"section":"1",
"title":"Fundamentals of Computer Science",
"units":4,
"instructors":[
{
"system_name":"Justin Li"
"first_name":"Justin",
"last_name":"Li",
},
...
],
"meetings":[
{
"building":{
"code":"MOSHER",
"name":"Norris/Mosher Hall"
},
"room":"3",
"weekdays":{
"codes":"MWF",
"names":"Monday, Wednesday, Friday"
},
"us_start_time":"9:35am",
"us_end_time":"10:30am"
"iso_start_time":"09:35",
"iso_end_time":"10:30",
},
...
],
"cores":[
{
"code":"CPLS",
"name":"Core Laboratory Science"
},
...
],
"info":{
"description":"...",
"prerequisites":null,
"corequisites":"COMP 131L ",
"url":"..."
},
"num_seats":30
"num_reserved":7,
"num_reserved_open":0,
"num_enrolled":31
"num_waitlisted":0
},
...
]
}