First, log in and apply for a key. Your request should be reviewed within 48 business hours. For now, each project is allotted 10,000 API requests per day. All of your requests to the API must include your key using the key parameter.

The base URL for the Course Data API is:

http://api.asg.northwestern.edu/

To retrieve data from the API, send an HTTP GET request to the base URL + an endpoint. For instance, pasting http://api.asg.northwestern.edu/terms/?key=YOUR_KEY in your browser will return a string in JSON representing a list of terms. (Using a browser extension such as JSONView during development is highly recommended.) Making the same request would look like this using JavaScript with jQuery:

var params = {
  key: YOUR_KEY
};

$.getJSON('http://api.asg.northwestern.edu/terms/', params, function(data) {
  // data is the JavaScript array that results from parsing the response
  console.log(data);
});

Using Python with the requests library:

import requests

params = {
  'key': YOUR_KEY
}
response = requests.get('http://api.asg.northwestern.edu/terms/', params=params)
# calling response.json() returns the response as a Python dictionary or list
print response.json()

You can find clients for various languages under the GitHub organization for this project. As of this writing, there are Python and Ruby wrappers available.

The API is accessible using HTTP or HTTPS. HTTPS should be used to avoid browser warnings if the application making requests is served over HTTPS.

All responses are formatted in JSON (JavaScript Object Notation). Responses are gzipped when possible. Include an Accept-Encoding: gzip header in your requests to enable this and reduce bandwidth usage by 60 to 90%, depending on the size of the response.

You can specify sites to allow cross-site requests from for each project. For instance, adding www.example.com as an allowed referrer will cause Access-Control-Allow-Origin: www.example.com to be included in the headers of your API responses.

Endpoints

Returns a list of terms for which course data is available. Each term object will have the following structure:

{
  "id": 4560, 
  "name": "2014 Fall", 
  "start_date": "2014-09-23", 
  "end_date": "2014-12-12"
}

Lists all schools at Northwestern University. Each object includes the symbol and full name of the school:

{
  "symbol": "JOUR",
  "name": "Medill School of Journalism, Media, Integrated Marketing Communications"
}

Returns a list of subjects. You can filter by term and school—filtering by term is recommended because subjects have changed over the years. Objects are structured like this:

{
  "symbol": "ACCOUNT",
  "name": "Accounting"
}

Returns a list of courses.

Examples

To find all Spanish courses offered during Winter 2014, send a request to /courses with the parameters term set to 4530 and subject set to SPANISH, i.e.

http://api.asg.northwestern.edu/courses/?key=YOUR_KEY&term=4530&subject=SPANISH

Parameters

To query the /courses endpoint, you must include a minimum set of parameters. These combinations are listed here:

  • instructor
  • id (multiple accepted up to 200)
  • term, subject
  • term, room

You can include additional parameters to narrow down your search. Here are descriptions of all available parameters:

Name Description
id id of the course. Uniquely idenfities a course; used only by this API
term id of the term
subject symbol representing the subject of the course e.g. BIOL_SCI, PHIL
instructor id of the instructor who teaches the course
room id of the room in which the course is held
catalog_num departmental catalog number of the course, including the sequence number
meeting_days days of the week when the course meets
start_time HH:MM (24-hour clock) time of day when the course starts
end_time HH:MM (24-hour clock) time of day when the course stops
start_date YYYY-MM-DD date when the course starts
end_date YYYY-MM-DD date when the course stops
seats number of seats available
component what part of the course it is e.g. LEC, LAB
section a particular occurrence of this course. Used to help identify the course if multiple professors or times are offered in a given term
class_num the University's class number for the course (not unique)
course_id the University's id number for the course (not unique)

The start_time, end_time, start_date, end_date, and seats expect exact values by default. You can append __lt, __gt, __lte, or __gte to each of them to filter by values that are less than or greater than and/or equal to the value you specify.

Response format

Course data is returned in lists of objects. Each object has the following structure:

{
  "id": 78818,
  "title": "Music and Mind",
  "term": "2010 Fall",
  "instructor": "Richard D Ashley",
  "subject": "MUS_THRY",
  "catalog_num": "251-0",
  "section": "20",
  "room": "Music Administration Building 229",
  "meeting_days": "MoWeFr",
  "start_time": "09:00",
  "end_time": "09:50",
  "seats": 20,
  "topic": null,
  "component": "LEC",
  "class_num": 16834,
  "course_id": 19151
}
topic is the title of a topics course, which are courses that all have the same subject and number e.g. EECS 395. It may be null.

Courses (with details)

Query /courses/details just like /courses. Returns courses with additional details such as an overview, descriptions of different aspects of the course, and related discussion and/or lab sections. Here's the structure of a course object:

{
  "id": 56149,
  "title": "Cell Biology",
  "term": "2014 Winter",
  "school": "WCAS",
  "instructor": {
    "name": "Gregory J Beitel",
    "bio": null,
    "address": "Pancoe Pavilion, Room 1407",
    "phone": "847/467-7776",
    "office_hours": "Wed 1-2pm, Fri 4-5pm"
  },
  "subject": "BIOL_SCI",
  "catalog_num": "216-0",
  "section": "20",
  "room": {
    "id": 548,
    "building_id": 119,
    "building_name": "Technological Institute",
    "name": "LR3"
  },
  "meeting_days": "MoWeFr",
  "start_time": "11:00",
  "end_time": "11:50",
  "start_date": "2014-01-06",
  "end_date": "2014-03-15",
  "seats": 220,
  "overview": "Introduction to Cell Biology. Mechanisms that cells use to compartmentalize and transportcellular materials, to move, to regulate growth and death, to communicateand to respond totheir environments.",
  "topic": null,
  "attributes": "Natural Sciences Distro Area ",
  "requirements": "Enrollment Requirements: Prerequisite: Students must completed CHEM 172-0 or CHEM 103-0 to register for this course.",
  "component": "LEC",
  "class_num": 26101,
  "course_id": 19885,
  "course_descriptions": [
    {
      "name": "Class Materials (Required)",
      "desc": "Alberts et al. 2013. Essential Cell Biology, 4th edition. ISBN: 9780815344544. Up to date Clicker"
    },
    {
      "name": "Teaching Method",
      "desc": "Active learning exercises, lectures. Two exams (One in finals week but not cumulative) and multiple quizzes."
    },
    {
      "name": "Registration Requirements",
      "desc": "Prerequisites: CHEM 103 or 172"
    }
  ],
  "course_components": [
    {
      "component": "DIS",
      "meeting_days": "We",
      "start_time": "19:00",
      "end_time": "20:50",
      "section": "60",
      "room": "Technological Institute AUD"
    }
  ]
}
Many of the additional fields may be empty or null. For instance, course_descriptions and course_componenents might be empty lists, some instructor details might be null, and overview, attributes, and requirements might be null.

Returns a list of instructors. Must include the subject parameter. Object format:

{
  "id": 161,
  "name": "Mark P Witte",
  "bio": "Mark Witte is a Distinguished Senior Lecturer and the Director of Undergraduate Studies for economics at Northwestern. While completing his Ph.D., Mark worked as a researcher for the Federal Reserve. His specialties are macroeconomics, public finance, and environmental economics. He often teaches Introduction to Macroeconomics as well as upper-level classes in his specialities, and enjoys teaching 311 because it helps him be ready for his role as coach of Northwestern's Federal Reserve Challenge Team.",
  "address": null,
  "phone": null,
  "office_hours": null,
  "subjects": [
    "ECON",
    "BUS_INST",
    "ECON",
    "GEN_LA"
  ]
}
Here, subjects refers to any subjects in which instructors have ever taught courses.

Returns a list of buildings. When queried without parameters, returns all buildings. Most buildings have latitude and longitude coordinates.

You can get information about particular buildings by including one or more id parameters, or you can filter using lon and lat with the __lt, __gt, __lte, and __gte suffixes. The Northwestern maps link may be null. Object format:

{
  "id": 39,
  "name": "Annenberg Hall",
  "lat": 42.0560662,
  "lon": -87.6745112,
  "nu_maps_link": "http://maps.northwestern.edu/#latlngz=42.056%2C-87.674%2C17&lookupid=86"
}

Returns a list of rooms. You must include a building id using the building parameter, or you can get details about specific rooms by including one or more id parameters. Here's the object representing Tech NG49 as an example:

{
  "id": 626,
  "building_id": 119,
  "name": "NG49",
}

Rooms (with details)

Query /rooms/details just like /rooms. Includes full building data with each room. This is useful when you have some room ids and you need building information.

{
  "id": 339,
  "building": {
    "id": 78,
    "name": "Leverone Hall",
    "lat": 42.0537599,
    "lon": -87.6760697
  },
  "name": "Owen L Coon Auditorium"
}