You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

openf1-client

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openf1-client

Library for querying data from the OpenF1 API

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
15
-42.31%
Maintainers
1
Weekly downloads
 
Created
Source

OpenF1 Client

A lightweight, zero-dependency TypeScript client for the OpenF1 API.

Features

  • ✅ Written in TypeScript with full type support.
  • ✅ Zero-dependencies.
  • ✅ ES Module.
  • ✅ Simple and easy to use.

Installation

npm install openf1-client

Usage

Here's a quick example of how to use the client to fetch session data:

import { OpenF1Client } from 'openf1-client'

const client = new OpenF1Client()

async function getSpanishGrandPrixSession() {
  try {
    const sessions = await client.getSessions({
      meetingKey: 1229, // Spanish Grand Prix 2024
      sessionName: 'Race'
    })
    console.log(sessions)
  } catch (error) {
    console.error('Error fetching sessions:', error)
  }
}

getSpanishGrandPrixSession()

Client Options

By default, the client returns data with snake_case keys, as provided by the OpenF1 API. You can enable automatic camelCase conversion during client initialization:

const client = new OpenF1Client({ camelize: true })

If you would like additional info about the requests being made by the client, you can enable the debug option:

const client = new OpenF1Client({ debug: true })

API

The client provides methods for all supported OpenF1 API endpoints:

  • getCarData(params)
  • getDrivers(params)
  • getIntervals(params)
  • getLaps(params)
  • getLocation(params)
  • getMeetings(params)
  • getPit(params)
  • getPosition(params)
  • getRaceControl(params)
  • getSessions(params)
  • getSessionResults(params) (beta)
  • getStartingGrid(params) (beta)
  • getStints(params)
  • getTeamRadio(params)
  • getWeather(params)

For detailed information on available query parameters for each endpoint, please refer to the official OpenF1 API Documentation.

Contributing

Contributions are welcome! Please open an issue or submit a merge request.

License

MIT

Keywords

openf1

FAQs

Package last updated on 12 Jul 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