The "Open" in Open Course Project means devotion to free information and Open Source technologies. The data that is compiled to service this website is regularly extracted directly from various CNU websites, but it's provided centrally using RESTful API standards to any interested students or third parties.

If you are creating your own service or even a personal application using course, term, or instructor data, you are welcomed to use the API detailed on this page. General API endpoints are keyless and anonymous for now. If you're interested in using it for your projects, please don't abuse it. Otherwise I'll have to buy a bike lock.

API Functionality

  • All queries should be directed to the API URL: https://opencourseproject.com/api/v1/
  • API queries can be returned in your choice of json, xml, or yaml format. To specify, use the Accept header in your GET request:
    curl -H "Accept: application/json" https://opencourseproject.com/api/v1/course/
    Alternatively, you may append ?format=json to the end of the url.
  • Large sets of data will be paginated with a limit of 20 objects per page. Each result will contain a meta object which has limit and a next URI which you may navigate to in order to get to the next page of data.
  • To avoid pagination, you can append ?limit=0 to the end of the url. It is requested that you avoid this unless absolutely necessary to avoid large I/O spikes. When possible, use filters so that your queries don't result in data sets needing to be paginated in the first place.
  • To filter objects, use field names in the query. For instance, https://opencourseproject.com/api/v1/course/?days=MWF finds all courses which meet Monday, Wednesday, and Friday. You can further filter objects, for instance https://opencourseproject.com/api/v1/course/?days=MWF&meeting_times__start_time=10:00:00 finds all courses which meet Monday, Wednesday, and Friday at 10am.
  • See the endpoint details for information about which fields you can use to filter your queries. If you'd like to filter on a sub-object, you can use the __ (double underscore) accessor. For instance, https://opencourseproject.com/api/v1/course/?instructor__rmp_score=3 finds all courses where the instructor's RateMyProfessor score is 3.0.
  • You can use __gt (greater than), __lt (less than), __gte (greater than or equal to), __lte (less than or equal to), __contains, __icontains (case-insensitive), __startswith or __endswith modifiers to make advanced queries. For instance, https://opencourseproject.com/api/v1/course/?seats__gte=3 finds all courses where there are at least 3 open seats.

GET /term/

A Term represents a semester where classes are offered.

Fields:
  • value: a Term ID which is unique for this Term.
  • name: the name of this Term.

GET /instructor/

An Instructor represents a professor who teaches a course.

Fields:
  • first_name: the first name of the Instructor. This could be a single-character intitial if the full first name is not known.
  • last_name: the last name of the Instructor.
  • rmp_link: the RateMyProfessor page for this Instructor, if known.

GET /course/

A Course represents a class that is offered in a specified term.

Fields:
  • term: the Term object in which this Course is offered.
  • crn: the Course Registration Number of this Course.
    • WARNING: CRNs are not necessarily unique. To query a specific Course you must offer a Term ID value and a CRN value.
  • course: the course and course number of this Course. (ex: ACCT 201).
  • course_link: the link to the Course on CNU's website.
  • section: the section of this Course.
  • title: the Course title.
  • bookstore_link: the link to the Course on CNU's bookstore.
  • hours: the number of credit hours.
  • attributes: course Attributes. See the Attribute endpoint for details.
  • ctype: the type of course (ex: Lec, Lab, etc).
  • location: the building and room number of this Course, if any.
  • instructor: the Instructor object of this Course, if any.
  • seats: the seats left.
  • status: Open or Closed, depending on how many seats are left.
  • meeting_times: the days and times this Course meets (there could be several).
    • Meeting times have the following fields:
    • days: the days (MW, TR, MWF, etc.) for which this meeting time applies.
    • start_time: the timecode in HH:MM:SS format that the meeting time starts.
    • end_time: the timecode in HH:MM:SS format that the meeting time ends.

Course data is updated every 2 hours, and can be monitored on the Dashboard. If you are regularly querying courses, you can cache course data and assume it is unchanged until the next processing period.

GET /material/

A Material represents a required text for a Course.

Fields:
  • term: the Term for the course_crn.
  • course_crn: the Course crn to which this Material belongs.
  • isbn: the ISBN number for the text.
  • title: the title of the text.
  • author: the author of the text.
  • publisher: the publisher of the text.
  • edition: the edition of the text.
  • year: the publishing year of the text.

GET /attribute/

An Attribute represents a course classification that meets University requirements for a specific field. This could include courses in a Liberal Learning Foundation, Area of Inquiry, courses that are Writing Intensive, or Honors courses.

Fields:
  • value: an Attribute ID.
  • name: the full name of this Attribute.

GET /courseversion/

A CourseVersion represents the state of a Course at a given time in history. The first created CourseVersion represents its fields and details when it was first indexed, and the most recent CourseVersion represents the current state of the object, and is identical to the Course object it represents.

Fields:
  • term: the Term for the course_crn.
  • course_crn: the Course crn to which this Material belongs.
  • time_created: the date and time this version was stored.
  • data: a JSON object listing the fields of the Course.

Private Endpoints

The following endpoints are considered "private" and require you to use your account API key to access them. In addition to GETting information from the API you may also add and remove data to/from these endpoints using POST and DELETE respectively.

Log In and return to this page to find your key.

GET /schedule/

A Schedule is a listing of courses that you have added to a Term.

Fields:
  • term: the Term which the courses are scheduled for.
  • course_crn: the course CRN.

POST /schedule/

To add a course to your schedule with this API, simply send a POST request where the body includes the following items:

  • term: the Term resource to add this course to.
  • course_crn: the course CRN.

For example, to add this course (CRN: 5984) to your Fall Semester 2015 (Term ID: 201600) schedule, send the following request:

curl --dump-header - -H "Content-Type: application/json" -H "Authorization: ApiKey USERNAME:API_KEY" -X POST --data '{"term": "/api/v1/term/201600/", "course_crn": "5984"}' https://opencourseproject.com/api/v1/schedule/
A successful POST returns HTTP 201 CREATED.

DELETE /schedule/

To delete a course from your schedule, specify it with the resource_url given from your GET schedule query request.

For example, if you want to delete the following item from your schedule: {"course_crn": 5984, "id": 1, "resource_uri": "/api/v1/schedule/1/", "term": {"name": "Fall Semester 2015", "resource_uri": "/api/v1/term/201600/", "value": 201600}} send the following request:

curl --dump-header - -H "Content-Type: application/json" -H "Authorization: ApiKey USERNAME:API_KEY" -X DELETE  https://opencourseproject.com/api/v1/schedule/1/
A successful DELETE returns HTTP 204 NO CONTENT.

GET /follow/

A Follow is a listing of courses that you have decided to follow and recieve status updates for.

Fields:
  • term: the Term which the courses are scheduled for.
  • course_crn: the course CRN.

POST /follow/

To start following a course with this API, simply send a POST request where the body includes the following items:

  • term: the Term resource that the course belongs to.
  • course_crn: the course CRN.

For example, to follow this course (CRN: 5984) which belongs to Fall Semester 2015 (Term ID: 201600), send the following request:

curl --dump-header - -H "Content-Type: application/json" -H "Authorization: ApiKey USERNAME:API_KEY" -X POST --data '{"term": "/api/v1/term/201600/", "course_crn": "5984"}' https://opencourseproject.com/api/v1/follow/
A successful POST returns HTTP 201 CREATED.

DELETE /follow/

To stop following a course, specify it with the resource_url given from your GET schedule query request.

For example, if you want to delete the following item from your schedule: {"course_crn": 5984, "id": 1, "resource_uri": "/api/v1/follow/1/", "term": {"name": "Fall Semester 2015", "resource_uri": "/api/v1/term/201600/", "value": 201600}} send the following request:

curl --dump-header - -H "Content-Type: application/json" -H "Authorization: ApiKey USERNAME:API_KEY" -X DELETE  https://opencourseproject.com/api/v1/follow/1/
A successful DELETE returns HTTP 204 NO CONTENT.

GET /profile/

A Profile stores personal user data and preferences.

Fields:
  • learning_community: the LC the user is in.
  • default_term: the default Term to use when searching.
  • facebook_id: the ID of the user's linked Facebook profile.
  • preferred_name: the user's preferred name.
  • show_archived_terms: whether to show old terms in dropdowns.
  • show_colors_schedule: whether to colorize classes on the schedule.
  • show_details_schedule: whether to show class details on the schedule.

POST /profile/

To update your profile, send a POST request where the body includes the fields and values to change.

For example, to change your preferred name, send the following request:

curl --dump-header - -H "Content-Type: application/json" -H "Authorization: ApiKey USERNAME:API_KEY" -X POST --data '{"preferred_name": "Dave"}' https://opencourseproject.com/api/v1/profile/
A successful POST to an existing profile will update that profile and return HTTP 400 BAD REQUEST with an error message explaining that the changes have been made to the existing object. This should not be considered an error and is simply a limitation of the API framework.

Non-API Resources

In addition to RESTful API methods, raw assets compiled to populate this service are available to anyone interested.
  • Exam schedule information is created using spreadsheet files and are downloadable at https://opencourseproject.com/static/assets/xl/exam_schedule_TERM.xlsx where TERM is a valid Term ID (ex: 201600 for Fall Semester 2015). See the details of the Term endpoint for more information on Term IDs.
    • Exam spreadsheets are created by hand for each term using the tables extracted from the official CNU-provided PDF using the fantastic Tabula to reduce risk of human transcription errors.
    • Not all current Terms will have an exam spreadsheet. Spreadsheets are created for all Spring and Fall semesters when the official schedule is posted to the CNU website.
    • Data is organized by sheet, the name of the sheet being the exam day in the format mm-dd-yyyy that the cells apply to.
    • The first cell in each column is the exam period in the format hh:mm-hh:mm where the first time is the start time and the second is the end time.
    • Each following cell in a column contains the applicable courses that will have an exam during the period, in the format DAY hh:mm-hh:mm where DAY could be any combination of M, T, W, R, F, MW, T/R, etc. and the times are start and end times of the course as explained above.