Documentation
API Guide

Guide

Information and examples on how to use the API.

Base URL

All endpoints in the API have the same base URL:

https://tuffysearch.com/api

Endpoint Guides

/courses

Examples and code snippets will be available on each page. Here is a list of possible queries you can make:

Parameters

All parameters are optional. If no parameters are provided, all courses will be returned (currently disabled). If multiple parameters are provided, the API will use the parameter with the highest priority. The order of priority is as follows:

  1. course_id
  2. course_code
  3. dept
NameDescriptionExample
course_idThe ID of the course to search for.538057
course_codeA code containing an abbreviated department and course numberCPSC-121
deptA department abbreviation OR full name. Letters must be correctly capitalized if using full name.CPSC, Computer-Science

Response Structure

All responses from the API will be sent in the following JSON format. The error field will only be present if success is false. data will always be a list if there are results (even if only one result is found), or null if there are no results.

{
  "success": boolean,
  "data": CourseObject[] | null,
  "error": ErrorObject | undefined,
}

CourseObject Type

{
  "title": string,
  "description": string,
  "department": string,
  "course_id": number,
  "course_code": string,
}

ErrorObject Type

{
  "message": string,
  "code": string,
}