/scarletmaps

A GraphQL API for the Rutgers University bus system

Primary LanguageRustMIT LicenseMIT

ScarletMaps

Welcome to the ScarletMaps API. This is a GraphQL API built on top of the Transloc service used by Rutgers University. It aims to provide extensive information about Rutgers routes and stops in a flexible manner. Because this is a GraphQL endpoint, the responses can be tailored to the user's specific needs.

Clients

Name Platform Repository Description
ScarletMaps Web scarletmaps-web Web client
ScarletMaps Android scarletmaps-android Android client

Types

This API provides four root types

  • route(id: int!)

    • id int!
    • name String!
    • areas [String!]!
    • segments [String!]!
    • stops [Stop!]
  • stop(id: int!)

    • id int!
    • name String!
    • area String!
    • routes [Route!]
  • routes(active: bool)

  • stops(active: bool)

Examples

For example, the user can model a request to return the names of the currently active routes and their served areas.

model

{
  routes (active: true) {
    names
    areas
  }
}

request

axios.post('https://api.scarletbus.com/graphql/', {
    query: {
      {
        routes (active: true) {
          names
          areas
        }
      }
    }
});
/*
{
  routes[
    {
      name: "A",
      areas: ["Busch", "College Ave"]
    },
    {
      name: "B",
      areas: ["Busch", Livingston]
    }
    ....
  ]
}

*/

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.