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:
course_id
course_code
dept
Name | Description | Example |
---|---|---|
course_id | The ID of the course to search for. | 538057 |
course_code | A code containing an abbreviated department and course number | CPSC-121 |
dept | A 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,
}