Check out the 5C courses being offered this Fall!
The root URL lists the departments covered so far. If you want a specific department, just request that path!
Let's say you want to find all Literature classes taught on Fridays. No problem!
-
Import a library which will get the data for you.
import urllib2
-
Grab the data and store it in a variable.
request = urllib2.urlopen('http://course-api.herokuapp.com/lit')
-
The request data is stored in a format called JSON, but Python has a library which converts that JSON into a normal Python dict. Let's do that now!
import json
lit_data = json.load(request)
for course in lit_data:
if 'F' in course['days']:
print course
You'll probably want the master list of all courses in all departments, so use the route: http://course-api.herokuapp.com/all
And, like the Literature example above, you can access a specific department by requesting: http://course-api.herokuapp.com/<dept_name_here>
Finally, you can navigate to a specific course or even a specific section with the following format: http://course-api.herokuapp.com/<dept>/<course_id>/<section_id>