Nextbus Public API

Nextbus has an API which allows you to query for stops, routes, and vehicle locations. The base URL is:$COMMAND

The return format is XML. Possible commands are:

Command Possible parameters Description
routeConfig Returns the list of all routes and stops and the lat/lon of each stop.
predictions stopId or r (route) or s (stop), optional d (direction) Returns predictions for a particular route or stop, optionally returning results only for a particular direction.
predictionsForMultiStops multiple 'stops' parameters, these are: routeTag|dirTag|stopId Returns predictions for a set of route/stop combinations. Again direction is optional and can be null.
vehicleLocations t, time of the last vehicle locations request Returns a list of vehicles and their locations. You can specify the t parameter, which will only show you vehicles which have moved since t.

More complete documentation is available here.

Unfortunately, there are some problems with this API; for example, if one would like all buses which stop at the Hill Center, one would either have to run one query for each of Hill's three stop IDs or build a predictionsForMultiStops query.

The code in the Rutgers Mobile App for handling this case is open source:, however, for those of you who are scared of javascript, an API based on this library is available for the duration of the hackathon.

Sugabus API

Base url:

The return format is JSON. Queries:

URL Parameters Description
/route/$ROUTE $ROUTE is a route tag List of predictions for the requested route
/stop/$STOP $STOP is a stop tag OR stop title List of predictions for the requested stop
/active List of active routes and stops (ie, buses are running)
/nearby/$LAT/$LON $LAT and $LON are latitude and longitutde Nearby stops to the given lat lon
/locations Vehicle locations. This always gets the vehicles which have moved in the last 15 minutes.
/config Retrieves the 'agency cache'. This contains a list of all routes and stops, as well as a sorted array of routes and stops for display in the app.

This is also open source. It's a pretty straightforward flatiron/node.js app written in CoffeeScript.

For a list of routes and stops, do a /config query; you'll get a big json object. It will have properties 'sortedStops' and 'sortedRoutes'.

The responses come straight out of nextbusjs, so see the nextbusjs wiki for more information.


If you're working in Node.js or Appcelerator Titanium, you can use nextbusjs directly. It will need a route configuration, which you can cache yourself, or pull the one we use for mobile:

Here's an example in CoffeeScript:

request = require 'request'
nextbus = require 'nextbus'
rutgers = nextbus.client()
request '', (err, response, body) ->
   if err then return console.dir err                                               
   rutgers.setAgencyCache (JSON.parse body), 'rutgers' 
After doing the above, you can call the prediction methods on the rutgers object. See the nextbusjs wiki for more information.


The full guide for using the RuEvents feeds can be found here. Basically, you make queries to

and you will receive RSS. You can pass options on the query string, like so:

to retreive events within 7 days. All query parameters and return values are fully documented in the pdf file above.


The dining data can be found here:

This is the same file which is loaded by the Rutgers Mobile Application. It is updated every couple of hours. Dining Services has a public API which provides the foods for one meal for one location; we simply pull all of the meals for all of the locations and cat them into one big file.

We unfortunately do not have the ability to query different days or query for nutritional data at this time.


The scores feed shows scores for all games:

These feeds can be queried based on sport ID:



Sport IDs:

Name ID
Baseball 19
Basketball - Men 11
Basketball - Women 12
Crew - Women 24
Cross Country 6
Field Hockey 4
Football 1
Golf - Men 7
Golf - Women 8
Gymnastics 14
Lacrosse - Men 21
Lacrosse - Women 22
Soccer - Men 2
Soccer - Women 3
Softball 20
Swimming & Diving 15
Tennis - Women 10
Track & Field - Men 16
Track & Field - Women 17
Volleyball - Women 5
Wrestling 18


We have hours of operation and some general information about the recreation facilities about Rutgers. It's available in json format at the following url:

The data will look something like this:

    "Busch Campus": {
        "Sonny Werblin Recreation Center": {
            "FacilityAddress": "656 Bartholomew Road, Piscataway, NJ 08854",
            "FacilityBusiness": "732-445-0462",
            "FacilityInformation": "732-445-0460",
            "FacilityBody": "The Sonny Werblin Recreation Center is a state-of-the-art recreation facility. Located on the Busch Campus, the Center is a 150,000 square foot facility dedicated to the recreational sports and fitness needs of the student body. Imagine a full ... to Route #287 or Route #1. Follow the respective directions for those roads.  \n\n",
            "FacilityBrief": "3 Basketball / Volleyball/ Badminton Courts\n6 Racquet Ball Courts\n2 Squash Courts\n50 Meter Olympic Pool\n2 Lap pools\nFitness Center\n3 Outdoor Sand Volleyball courts",
            "meetingareas": {
                "Fitness Center": {
                    "2/27/2013": "7:00AM - 11:00PM",
                    "2/28/2013": "6:00AM - 11:00PM",


                    "4/5/2013": "7:00AM - 8:30PM",
                    "4/6/2013": "10:30AM - 6:00PM"
                "Multisports Bay 1 (Badminton)": {
                    "2/27/2013": "8:30AM - 11:30PM",
                    "2/28/2013": "8:30AM - 8:30PM",





This API can give you a list of all of the buildings we have data at Rutgers. You can also query for buildings by buildingno.

The whole database, along with a lunr index (javascript full text search) and kd-tree (for doing nearby queries) can be found here:

It's a JSON object with a `lunr` property, a `kdree` property and an `all` property. The indexer and the code used to utilize the database from within the app can be found here. The data looks something like this:

    title: "Douglass Campus Center",
    campus_name: "Douglass",
    location: {
      name: "Douglass Campus Center",
      street: "100 GEORGE STREET",
      city: "New Brunswick",
      state: "New Jersey",
      state_abbr: "NJ",
      postal_code: "08901-1412",
      country: "United States",
      country_abbr: "US",
      latitude: "40.484707",
      longitude: "-74.436640"
    offices: ["SA-Student Affairs, VP", "SA-Student Life"]

You can also pull the latest data for a particular buildingno from:$BUILDING_NO/json

Schedule of Classes

The SOC API allows you to grab a list of courses for a subject / campus / semester / level. You can request a key for this API here. After requesting a key, you can hit the API like this:

Semesters are specified as two numbers concatenated together; the first is the month during which that semester starts (9 = September = fall semester) and the second is the year. Level can be U or G. Campus can be one of

  • New Brunswick: NB
  • Newark: NK
  • Camden: CM
  • Online Courses: ONLINE
  • Freehold WMHEC / RU-BCC: WM
  • Mays Landing / RU-ACCC: AC
  • Denville / RU-Morris: MC
  • McGuire-Dix-Lakehurst / RU-JBMDL: J
  • North Branch / RU-RVCC: RV
  • Camden County College: CC
  • Cumberland County College: CU

Example output:

    title: "INTRO COMPUTER SCI",
    synopsisUrl: "",
    courseNotes: null,
    campusCode: "NB",
    courseNumber: "111",
    sections: [
        index: "37452",
        number: "61",
        campusCode: "NB",
        openStatus: false,
        meetingTimes: [
            campusAbbrev: "BUS",
            startTime: "0500",
            meetingDay: "T",
            roomNumber: "117",
            meetingModeDesc: "LEC",
            campusName: "BUSCH",
            endTime: "0620"
            campusAbbrev: "BUS",
            startTime: "0500",
            meetingDay: "TH",
            roomNumber: "117",

Autocompletion Code

The code that runs the autocomplete for SOC in the mobile app is open source. You can find it here. It does intelligent autocompletion; recognizing abbreviations and course numbers, as well as doing naive fulltext search.

If you need help with any of the above APIs: