SGApps API Documentation

Why use SGApps API?

  1. All non-real-time data is cached for faster API call times.
  2. All return data is GZIP compressed for smaller data sizes.
  3. All requests have CORS headers on them, so you can call them from client-side JavaScript in the browser.
  4. Cleaner URLs and easy-to-understand API organization for all data sources.

Endpoints:

/events

GET /events

Output: XML of upcoming myUMBC events.

Example:
fetch("https://api.sga.umbc.edu/events")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /events/group/{group_token}

Inputs:

Parameter Type Notes
group_token String Group tokens are parts of the group URL on myUMBC.

Output: XML of upcoming myUMBC events of the specified group.

Example:
fetch("https://api.sga.umbc.edu/events/group/sga")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });

/laundry

GET /laundry/rooms

Output: JSON of information about all laundry rooms at UMBC.

Example:
fetch("https://api.sga.umbc.edu/laundry/rooms")
    .then(res => res.json())
    .then(data => {
        console.log(JSON.parse(JSON.stringify(data)));
    });
GET /laundry/rooms/{room_id}

Inputs:

Parameter Type Notes
room_id Integer Room IDs can be found through the /laundry/rooms endpoint.

Output: JSON of information about all laundry machines in the specified room.

Example:
fetch("https://api.sga.umbc.edu/laundry/rooms/4841014")
    .then(res => res.json())
    .then(data => {
        console.log(JSON.parse(JSON.stringify(data)));
    });
GET /menus/{location}/{date}

Inputs:

Parameter Type Notes
location String Possible Values: (admin | dhall | skylight)
date String Must be in YYYY-MM-DD format

Output: JSON of menu of that location for the day with all meal periods.

Example:
fetch("https://api.sga.umbc.edu/menus/dhall/2020-1-31")
    .then(res => res.json())
    .then(data => {
        console.log(JSON.parse(JSON.stringify(data)));
    });

/news

GET /news

Output: XML of most recently published Retriever articles in RSS format

Example:
fetch("https://api.sga.umbc.edu/news")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /news/page/{page_num}
Parameter Type Notes
page_num Integer Number must be greater than 0
Example:
fetch("https://api.sga.umbc.edu/news/page/5")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });

/posts

GET /posts

Output: XML of recent community myUMBC posts.

Example:
fetch("https://api.sga.umbc.edu/posts")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /posts/group/{group_token}

Inputs:

Parameter Type Notes
group_token String Group tokens are parts of the group URL on myUMBC.

Output: XML of recent myUMBC posts of the specified group.

Example:
fetch("https://api.sga.umbc.edu/posts/group/sga")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });

/transit

GET /transit/arrival-estimates

Output: JSON of arrival estimates for all transit stops.

fetch("https://api.sga.umbc.edu/transit/arrival-estimates")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/arrival-estimates/routes/{route_ids}

Inputs:

Parameter Type Notes
route_ids String Can be one or have comma-separated list of route IDs that can be found from other transit endpoints.

Output: JSON of arrival estimates for all transit stops on specific route(s).

Example:
fetch("https://api.sga.umbc.edu/transit/arrival-estimates/routes/4000482")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/arrival-estimates/stops/{stop_ids}

Inputs:

Parameter Type Notes
stop_ids String Can be one or have comma-separated list of stop IDs that can be found from other transit endpoints.

Output: JSON of arrival estimates for all transit stops on specific route(s).

Example:
fetch("https://api.sga.umbc.edu/transit/arrival-estimates/stops/4066762")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/routes

Output: JSON of information about all transit routes.

Example:
fetch("https://api.sga.umbc.edu/transit/routes")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/segments

Output: JSON of Encoded Polylines for all route segments.

Example:
fetch("https://api.sga.umbc.edu/transit/segments")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/segments/routes/{route_ids}

Inputs:

Parameter Type Notes
route_ids String Can be one or have comma-separated list of route IDs that can be found from other transit endpoints.

Output: JSON of Encoded Polylines for route segments from specified route.

Example:
fetch("https://api.sga.umbc.edu/transit/segments/routes/4000482")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/stops

Output: JSON of information for all transit stops.

Example:
fetch("https://api.sga.umbc.edu/transit/stops")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/vehicles

Output: JSON of all active transit vehicles.

Example:
fetch("https://api.sga.umbc.edu/transit/vehicles")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });
GET /transit/vehicles/routes/{route_ids}

Inputs:

Parameter Type Notes
route_ids String Can be one or have comma-separated list of route IDs that can be found from other transit endpoints.

Output: JSON of all active transit vehicles on specified route.

Example:
fetch("https://api.sga.umbc.edu/transit/vehicles/routes/4000482")
    .then(res => res.text())
    .then(data => {
        console.log(data);
    });