npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apicity/openf1

v0.6.2

Published

OpenF1 API provider for Formula 1 historical and authenticated live REST data.

Readme

@apicity/openf1

npm dependencies TypeScript docs

OpenF1 API provider for Formula 1 historical and authenticated live REST data.

Runtime dependencies:

  • zod@^4.4.3 — request schemas attached to OpenF1 endpoint methods as .schema

Installation

npm install @apicity/openf1
# or
pnpm add @apicity/openf1

Quick Start

import { createOpenF1 } from "@apicity/openf1";

const openf1 = createOpenF1();

REST Examples

OpenF1 historical REST data is public and does not require an API key.

import { createOpenF1 } from "@apicity/openf1";

const openf1 = createOpenF1();

const meetings = await openf1.v1.meetings({
  year: 2024,
  country_name: ["Singapore", "Monaco"],
});

const recentMeetings = await openf1.v1.meetings({
  filters: [
    { field: "date_start", op: ">=", value: "2024-01-01T00:00:00Z" },
  ],
});

Use arrays for repeated equality filters and filters for OpenF1 comparison operators such as >=, <, and >.

Authenticated REST

OpenF1 live REST access uses the same /v1/{collection} endpoints with a Bearer token. See the OpenF1 auth guide for the upstream token contract.

import { createOpenF1 } from "@apicity/openf1";

const openf1 = createOpenF1();

const token = await openf1.token({
  username: "[email protected]",
  password: "placeholder-password",
});

const liveOpenF1 = createOpenF1({
  accessToken: token.access_token,
});

const liveSessions = await liveOpenF1.v1.sessions({
  session_key: "latest",
});

For refreshable tokens, provide a tokenProvider. The provider is called for REST reads and this package does not store credentials or tokens outside the client instance.

const openf1 = createOpenF1({
  tokenProvider: async () => {
    const token = await fetchTokenSomewhereElse();
    return token.access_token;
  },
});

API Reference

19 endpoints across 19 groups. Each method mirrors an upstream URL path.

carData

GET https://api.openf1.org/v1/car_data{query}

Upstream docs ↗

const res = await openf1.v1.carData({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

championshipDrivers

GET https://api.openf1.org/v1/championship_drivers{query}

Upstream docs ↗

const res = await openf1.v1.championshipDrivers({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

championshipTeams

GET https://api.openf1.org/v1/championship_teams{query}

Upstream docs ↗

const res = await openf1.v1.championshipTeams({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

drivers

GET https://api.openf1.org/v1/drivers{query}

Upstream docs ↗

const res = await openf1.v1.drivers({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

intervals

GET https://api.openf1.org/v1/intervals{query}

Upstream docs ↗

const res = await openf1.v1.intervals({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

laps

GET https://api.openf1.org/v1/laps{query}

Upstream docs ↗

const res = await openf1.v1.laps({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

location

GET https://api.openf1.org/v1/location{query}

Upstream docs ↗

const res = await openf1.v1.location({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

meetings

GET https://api.openf1.org/v1/meetings{query}

Upstream docs ↗

const res = await openf1.v1.meetings({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

overtakes

GET https://api.openf1.org/v1/overtakes{query}

Upstream docs ↗

const res = await openf1.v1.overtakes({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

pit

GET https://api.openf1.org/v1/pit{query}

Upstream docs ↗

const res = await openf1.v1.pit({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

position

GET https://api.openf1.org/v1/position{query}

Upstream docs ↗

const res = await openf1.v1.position({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

raceControl

GET https://api.openf1.org/v1/race_control{query}

Upstream docs ↗

const res = await openf1.v1.raceControl({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

sessionResult

GET https://api.openf1.org/v1/session_result{query}

Upstream docs ↗

const res = await openf1.v1.sessionResult({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

sessions

GET https://api.openf1.org/v1/sessions{query}

Upstream docs ↗

const res = await openf1.v1.sessions({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

startingGrid

GET https://api.openf1.org/v1/starting_grid{query}

Upstream docs ↗

const res = await openf1.v1.startingGrid({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

stints

GET https://api.openf1.org/v1/stints{query}

Upstream docs ↗

const res = await openf1.v1.stints({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

teamRadio

GET https://api.openf1.org/v1/team_radio{query}

Upstream docs ↗

const res = await openf1.v1.teamRadio({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

token

POST https://api.openf1.org/token

Upstream docs ↗

const token = await openf1.token({
  username: "[email protected]",
  password: "placeholder-password",
});

Source: packages/provider/openf1/src/openf1.ts

weather

GET https://api.openf1.org/v1/weather{query}

Upstream docs ↗

const res = await openf1.v1.weather({ /* ... */ });

Source: packages/provider/openf1/src/openf1.ts

Part of the apicity monorepo.

License

MIT — see LICENSE.