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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fpl-sdk

v0.1.3

Published

Un-official npm package for the fpl api

Readme

Un-official SDK for the FPL API

This package provides easy access to Fantasy Premier League (FPL) data through the FPL API. It allows you to fetch detailed player information, bootstrap data, and combine them for enriched player data, all with simple functions that return structured data.

Features

  • Fetch Bootstrap Static Data: Get general FPL data such as teams, players, and their details.
  • Fetch Player Summary: Retrieve detailed information about a specific player, including their performance.
  • Fetch Player's Bootstrap Data: Get player data directly from the bootstrap API endpoint.
  • Combine Bootstrap & Element Data: Combine bootstrap and player summary data into a single object for easy use.
  • And Many More: Check repo.

Installation

You can install the package via npm:

npm install fpl-sdk

Usage

1. Get Bootstrap Static Data

The getBootsrapStaticData() function fetches general static data about the players, teams, and FPL setup.

import { getBootsrapStaticData } from "fpl-sdk";

async function fetchBootstrapData() {
  const data = await getBootsrapStaticData();
  console.log(data);
}

fetchBootstrapData();

2. Get Player Summary

The getPlayerSummary(playerId: number) function returns detailed information about a specific player, including performance statistics like total points, form, and transfers.

import { getPlayerSummary } from "fpl-sdk";

async function fetchPlayerSummary(playerId: number) {
  const playerData = await getPlayerSummary(playerId);
  console.log(playerData);
}

fetchPlayerSummary(12345); // Use the player ID

3. Get Player's Bootstrap Data

The getPlayerBootstrapData(playerId: number) function fetches the player's bootstrap data from the FPL API, including their basic statistics.

import { getPlayerBootstrapData } from "fpl-sdk";

async function fetchPlayerBootstrapData(playerId: number) {
  const playerData = await getPlayerBootstrapData(playerId);
  console.log(playerData);
}

fetchPlayerBootstrapData(12345); // Use the player ID

4. Get Combined Data (Bootstrap + Element Summary)

The getCombinedData(playerId: number) function combines both the bootstrap and element player data into a single object. This function is helpful if you want a comprehensive view of a player.

import { getCombinedData } from "fpl-sdk";

async function fetchCombinedPlayerData(playerId: number) {
  const combinedData = await getCombinedData(playerId);
  console.log(combinedData);
}

fetchCombinedPlayerData(12345); // Use the player ID

5. Get Season Fixtures

The getAllFixtures function returns all fixtures of the season Gameweek 1 - 38.

import { getAllFixtures } from "fpl-sdk";

async function fetchAllFixtures() {
  const seasonFixtures = await getAllFixtures();
  console.log(seasonFixtures);
}

fetchAllFixtures();

6. Get Season Fixtures

The getGameWeekFixtures(gwNumber: number) function returns all fixtures of the season. Takes gameweek/event number(1-38).

import { getGameWeekFixtures } from "fpl-sdk";

async function fetchGameWeekFixtures() {
  const gwFixtures = await getGameWeekFixtures(1);
  console.log(gwFixtures);
}

fetchGameWeekFixtures();

7. Get the next gameweek/event number

The getUpcomingGameweekNumber function returns the gameweek number of the next live gameweek.

import { getUpcomingGameweekNumber } from "fpl-sdk";

async function fetchUpcomingGameWeekNumber() {
  const gw = await getUpcomingGameweekNumber();
  console.log(gw);
}

fetchUpcomingGameWeekNumber();

8. Get future gameweeks

The getAllUpcomingFixtures function returns all upcoming season fixtures sorted by kick-off time.

import { getUpcomingGameweekNumber } from "fpl-sdk";

async function fetchAllUpcomingSeasonFixtures() {
  const upcomingFixtures = await getAllUpcomingFixtures();
  console.log(upcomingFixtures);
}

fetchAllUpcomingSeasonFixtures();
More coming soon

Types

This package uses TypeScript and provides the following types for the FPL data:

  • Bootstrap: Contains all the general FPL setup data (teams, players, etc.).
  • PlayerSummary: Contains detailed player performance data.
  • Element: The basic data for each player.
  • Player: A combined type that includes both bootstrap and element data for a player.
  • Fixture: Basic type for a fixture

License

This package is licensed under the MIT License.