Skip to content

Instantly share code, notes, and snippets.

@kylestev
Last active December 24, 2015 23:09
Show Gist options
  • Save kylestev/6878043 to your computer and use it in GitHub Desktop.
Save kylestev/6878043 to your computer and use it in GitHub Desktop.

OSU Course Catalog API

Disclaimer

This is no where near finished and does not follow REST standards.

To get a listing of all subjects you can simply hit http://api.kylestevenson.me/subjects

{
  "subjects": [
    {
      "id": "ACTG", 
      "name": "Accounting"
    }, 
    {
      "id": "AEC", 
      "name": "Applied Economics"
    }
    ...
}

You'll notice that this is truly not a full listing. To get the full listing you will have to hit the API again adding to the offset parameter in the query string ?offset=50 would start you the 51st subject in the database (if it even exists!). This notation is standard across other objects in the API. All queries are limited to returning a maximum of 25 objects per request.

With that list of subjects, you can delve deeper into the courses taught in that subject by trying something like this http://api.kylestevenson.me/subjects/CS/courses

{
  "courses": [
    {
      "id": 1597, 
      "level": 101, 
      "subject": "CS", 
      "title": "COMPUTERS: APPLICATIONS AND IMPLICATIONS"
    }, 
    {
      "id": 1598, 
      "level": 160, 
      "subject": "CS", 
      "title": "COMPUTER SCIENCE ORIENTATION"
    },
    ...
    {
      "id": 1620, 
      "level": 506, 
      "subject": "CS", 
      "title": "PROJECTS"
    }
  ]
}

For example using the course id we got from the last query, we can get more information about a specific course. Let's try using CS 160's course id.

http://api.kylestevenson.me/courses/1598

{
  "id": 1598, 
  "level": 160, 
  "offerings": [
    {
      "course_id": 1598, 
      "credits": "4", 
      "crn": 12187, 
      "id": 4770, 
      "instructor_id": 1270, 
      "location": "GILB 224", 
      "section": 1, 
      "status": "Open", 
      "term": "F13", 
      "type": "Lecture"
    }, 
    ...
    {
      "course_id": 1598, 
      "credits": "-1", 
      "crn": 21153, 
      "id": 4779, 
      "instructor_id": 1270, 
      "location": "DEAR 302", 
      "section": 18, 
      "status": "Waitlisted", 
      "term": "F13", 
      "type": "Laboratory"
    }
  ], 
  "subject": "CS", 
  "title": "COMPUTER SCIENCE ORIENTATION"
}

Neat! Now we have a listing of all the sections being offered this term.

Have a suggestion for a feature? Shoot me an email kyle@kylestevenson.me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment