/course-api

Course API for the Claremont Colleges.

Primary LanguagePython

5C Course API

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!

Python example

  1. Import a library which will get the data for you.
    import urllib2

  2. Grab the data and store it in a variable.
    request = urllib2.urlopen('http://course-api.herokuapp.com/lit')

  3. 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

Routes

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>