Skip to content

AustinJVC/assignment1COMP4513

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formula 1 Racing API

A Node + Express API powered by Supabase for exploring Formula 1 racing data, including circuits, races, drivers, constructors, results, qualifying, and standings.

This project was built for COMP 4513 as Assignment 1. It contains multiple API endpoints that allow querying F1 data, returned in JSON format.

Overview

This API provides access to Formula 1 race data. It allows users to explore:

  • Circuits used in different seasons
  • Constructors and their stats
  • Drivers and their results
  • Races by year, round, or circuit
  • Results including position, times, and related data
  • Qualifying sessions and grids
  • Standings for drivers and constructors

The API returns JSON responses and has proper error handling (404 Not Found, 400 Bad Request, etc.).

Tech Stack

  • Node + Express
  • Supabase (DB only)

API Endpoints

Circuits

  • GET /api/circuits → Returns all the circuits
  • GET /api/circuits/:ref → Returns just the specified circuit (use the circuitRef field), e.g., /api/circuits/monaco
  • GET /api/circuits/season/:year → Returns the circuits used in a given season (order by round in ascending order), e.g., /api/circuits/season/2020

Constructors

  • GET /api/constructors → Returns all the constructors
  • GET /api/constructors/:ref → Returns just the specified constructor (use the constructorRef field), e.g., /api/constructors/mclaren

Drivers

  • GET /api/drivers → Returns all the drivers
  • GET /api/drivers/:ref → Returns just the specified driver (use the driverRef field. case sensitive), e.g., /api/drivers/hamilton
  • GET /api/drivers/search/:substring → Returns the drivers whose surname (case insensitive) begins with the provided substring, e.g., /api/drivers/search/sch
  • GET /api/drivers/race/:raceId → Returns the drivers within a given race, e.g., /api/drivers/race/1106

Races

  • GET /api/races/:raceId → Returns just the specified race.
  • GET /api/races/season/:year → Returns the races within a given season ordered by round, e.g., /api/races/season/2020
  • GET /api/races/season/:year/:round → Returns a specific race within a given season specified by the round number, e.g., to return the 4th race in the 2022 season: /api/races/season/2022/4
  • GET /api/races/circuits/:ref → Returns all the races for a given circuit (use the circuitRef field), ordered by year, e.g. /api/races/circuits/monza
  • GET /api/races/circuits/:ref/season/:start/:end → Returns all the races for a given circuit between two years (include the races in the provided years), e.g., /api/races/circuits/monza/season/2015/2020
    /api/races/circuits/monza/season/2020/2020

Results

  • GET /api/results/:raceId → Returns the results for the specified race, e.g., /api/results/1106
  • GET /api/results/driver/:ref → Returns all the results for a given driver, e.g., /api/results/driver/max_verstappen
  • GET /api/results/drivers/:ref/seasons/:start/:end → Returns all the results for a given driver between two years, e.g., /api/results/drivers/sainz/seasons/2022/2022

Qualifying

  • GET /api/qualifying/:raceId → Returns the qualifying results for the specified race, e.g., /api/qualifying/1106

Standings

  • GET /api/standings/drivers/:raceId → Returns the current season driver standings table for the specified race, sorted by position in ascending order.
  • GET /api/standings/constructors/:raceId → Returns the current season constructors standings table for the specified race, sorted by position in ascending order.

Error Handling

The API handles the following errors:

  • 500 Internal Server Error – Database or server issues
  • 404 Not Found – No data exists for given ref, year, or raceId
  • 400 Bad Request – Invalid parameters (e.g., start year > end year for ranged queries)

Example Requests

Base URL: https://api.austinvc.ca

Hosting Notes

Credits

  • Assignment: COMP 4513 (Mount Royal University)
  • Instructor Guidelines: Assignment #1 specification
  • Developer: Austin Vande Cappelle

About

Assignment 1 for COMP 4513. Node server which serves data via Supabase.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors