Data APIs at IME faculty, NTNU (BETA)

with comments

Best effort JSON API with absolutely no QoS guarantees.

Data is fetched from official databases/services, and ends up here as JSON. Cache information (freshness) is appended to the dataset by the API. For easier debugging, JSONView for Firefox and Chrome is recommended.

Courses

Two modes are available. In single course mode course code is the only required input, and full dataset for a single course is returned. File size is normally less than 10 kB.

/course/[<language>/]<courseCode>

Example queries: /course/tma4105, /course/en/tma4105, /course/tma4130 or /course/tiø4945

In list mode a single dash (-) is used in place of the course code. A list of courses for the current term (spring, summer or autumn) is returned. Only course code and name(s) are included in the list, use single course mode to retrieve the rest. File size is normally close to 1 MB.

/course/[<language>/]-

Example queries: /course/- or /course/en/-

Schedules

Only current term data is reliably present in the database. Upcoming term data is added closer to when the term starts. No exact date is given.

Known bug: activity->weeks sometimes contains duplicate weeks.
Use activity->activitySchedules->weeks until further notice.

Minimum input is the course code. Term and year may be added if needed. If term and year are left unspecified, default values (current term/year) are used.

/schedule/<courseCode>[/<spring|summer|autumn>[/<year>]]

Example queries: /schedule/tma4105/spring/2011, schedule/tma4105/spring or /schedule/tiø4175

Organizational units

Two modes are available. In single organizational unit mode OrgUnitId is the only input, and full dataset of a single unit is returned. File size is normally less than 5kB.

/org/[<language>/]<orgUnitId>

Example queries: /org/827, /org/en/830 or /org/830

In list mode mode a single dash (-) is used in place of the orgUnitId. A hierarchical list of units is returned. Only a limited selection of data is included, use singel organizational unit mode to retrieve the rest. File size is normally close to 35 kB.

/org/[<language>/]-

Example queries: /org/- or /org/en/-

Campuses

In list mode no input is needed, and datasets for all campuses are returned. In filter mode a filter is taken as input, and dataset for a single campus is returned.

/fdv/campuses[/<filterName>:<filterValue>]
FilterDescription
idUnique campus ID from Lydia.
nr"Pretty" number for the campus.

Exampel queries: /fdv/campuses, /fdv/campuses/nr:3 or /fdv/campuses/id:51

Buildings

In list mode no input is needed, and datasets including wings and floors for all buildings are returned. In filter mode a filter is taken as input, and full dataset (also including rooms) for a single building is returned.

/fdv/buildings[/<filterName>:<filterValue>]
FilterDescription
idUnique building ID from Lydia.
nr"Pretty" number for the building. May contain letters and hyphens.

Exampel queries: /fdv/buildings, /fdv/buildings/id:7 or /fdv/buildings/nr:2-240

Rooms

In list mode no input is needed, and datasets for all rooms are returned. It is strongly recommended not to query the full room list repeatedly client-side, as the file size is close to 4 MB. In filter mode a filter is taken as input, and full datasets for one or multiple rooms are returned.

/fdv/rooms[/<filterName>:<filterValue>]
FilterDescription
idUnique room ID from Lydia. Returns a single room.
lydiacodeConcatenation of building- and room number, used e.g. in romres.ntnu.no. Returns a single room.
buildingidUnique building ID from Lydia. Returns multiple rooms from the building.
buildingnr"Pretty" building number, may contain letters and hyphens. Returns multiple rooms from the building.

Exampel queries: /fdv/rooms, /fdv/rooms/buildingid:7, /fdv/rooms/buildingnr:2-240, /fdv/rooms/lydiacode:8103303 or /fdv/rooms/id:4553

Technical details

Same Origin Policy/JSONP

Since the same origin policy normally stops JSON objects from being loaded across different domains, all APIs support the use of a callback URL parameter.

The value of the parameter will be the name of the callback function in the JSONP reply.

<api url>?callback=<name of callback>

Example query: /course/tma4105?callback=foo

jQuery, MooTools and Dojo usage examples

Language (where applicable)

Specifying the language is optional. If set, it must be either "en" or "no". If left out language settings defaults to "no".

Terms of use

This service is built to allow the creation of new and exciting services/mash-ups, by students and other university related persons/activities. At the moment we don't enforce a specific license, but we expect you to share your idéas in the same spirit. (Creative Commons, GPL, ODbL, etc)

Kardemommeloven applies. Don't DoS-attack the server with lots of requests at once. Use local caches and don't invalidate it all at once.

Don't expect 24/7 support. If this page makes no sense to you, your time is probably better spent elsewhere.

The terms may be altered in case of abuse.

Disclaimer

We aim to present valid, official NTNU data. However, due to a (self-enforced) 7 day cache time, irregular updates, endless possibilities of minor errors in a database outside our control, etc etc etc, we offer no guarantees.

Use at your own risk, and please report errors.

Comments/discussion

Statistics

Statistics Chart built using pChart.

Service operated by IME faculty, NTNU Report API errors