📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

f1-api-node

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

f1-api-node

A simple library written in typescript to fetch Formula-1 data

2.1.1
latest
Source
npm
Version published
Weekly downloads
133
111.11%
Maintainers
1
Weekly downloads
 
Created
Source

Formula1 API

Completely Updated and Adjusted according to the New Changes in Formula 1's Website ~ 2025!

f1

The scraper scrapes this website: https://www.formula1.com

Installation

npm i f1-api-node

Example snippet

The following function will print the current lineup of F1 drivers.

const f1Api = require('f1-api-node') 

const myFunction = async () => {
    const driverLineup = await f1Api.getDriverData() // replace this function
    console.log(driverLineup)
}

myFunction()

Functions

1. getConstructorStandings

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch Constructors standings from points tableYes - 1The year from which you want to extract points table for (1950 - current)current year

const stnd

2. getDriverStandings

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch F1 driver standings from points tableYes - 1The year from which you want to extract points table for (1950 - current)current year

driver stnd

3. getDriverLineup

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch the current lineup of F1 driversNo--

driver lineup

4. getTeamLineup

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch the current list of F1 teamsNo--

team lineup

5. getWorldChampions

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch all the world championsNo--

hall of fame

6. getRaceResults

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch race results of all the grand prix in a given yearYes - 1The year from which you want to extract race results (1950 - current)-

race results

7. getRaceSchedule

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch race schedule for an entire yearYes - 1The year from which you want to extract race schedulecurrent year

alt text

8. getFastestLaps

DescriptionNeeds Paramter ?Paramter DescriptionDefault Argument
Fetch fastest laps for all races in a yearYes - 1The year from which you want to extract fastest lapscurrent year

fastest lap

Snapshots

If you want to have a look at the output from the given functions check this.

Accessing API through Docker

The docker image of the rest api can be found on Docker Hub

  • Pull the Image and start the development in no time

1. Pull from Docker Hub

docker pull katheyash/f1-api-node:tagname

2. Pull from Github Container Registry

docker pull ghcr.io/yashkathe/f1-api-node:2
  • The default port is 80

docker run -p 80:80 --name f1-api-node-test-1 katheyash/f1-api-node:1
  • If .env file exists

docker run --env-file ./.env -p 3001:3001 --name f1-api-node-test-1 f1-api-node:1

Usage

WARNING: Abusing this library may result in an IP ban from the host website.
Please use with caution and try to limit the rate and amount of your requests if you value your access to formula1.com

Report Problems

If you have any problems regarding this project, read the following disclaimer.

Keywords

F1

FAQs

Package last updated on 22 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts