NJS-ErgastF1API
NJS-ErgastF1API copied to clipboard
Conversion of the ergast.com API from PHP to nodeJS
NJS-ErgastF1API
Conversion of the ergast.com API from PHP to nodeJS
Getting Started
Instructions for Use Using Docker Compose
- install docker
- download and unzip the contents repository
- cd into the root folder and run:
docker compose up - give everything a minute or to to come up and then test the API at:
http://localhost:8080/
Test
After verifying that everything works, here's what you can try to add after the base URL
- drivers
- constructors
- pitstops
- laps
- standings/constructors
- standings/drivers
- races
- status
- circuits
- seasons
- qualifying
- results
Optional get parameters
- year
- round
- constructor
- circuit
- driver
- grid
- result
- fastest
- status
- driverStandings
- constructorStandings
- laps
- pitstop
Example
- Returns all the drivers who raced in 2019 :
http://localhost:8080/drivers?year=2019 - Returns all the lap times made by Vettel in the 2019 Canadian Grand Prix :
http://localhost:8080/laps?year=2019&round=7&driver=vettel
Extra
- You can specify in the url to have more results at a time, adding
?limit=(number)&offset=(number) - If you want to see the SQL query generated by the request you made, add
?sql=trueto the web address
Authors
- Davide Albiero - Initial work