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

api-football-sdk

v1.1.0

Published

Fully typed API-Football v3 SDK

Readme

API-Football SDK

A complete, fully-typed TypeScript SDK for API-FOOTBALL v3.

NPM Version License: MIT

Features

  • Full Coverage: Every documented endpoint (Timezones, Countries, Leagues, Teams, Fixtures, Odds, Players, etc.).
  • Strongly Typed: Comprehensive TypeScript interfaces for every request parameter and response payload.
  • Dual Provider Support: Seamlessly switch between direct API-Sports and RapidAPI.
  • Robust Core: Built-in support for retries, timeouts, and rate-limit tracking.
  • Zero Dependencies: Uses the native fetch API (Node.js 18+, Bun, Deno, or Browser).

Installation

npm install api-football-sdk
# or
yarn add api-football-sdk
# or
pnpm add api-football-sdk

Quick Start

Basic Usage (Direct API-Sports)

import { ApiFootballClient } from "api-football-sdk";

const football = new ApiFootballClient({
  apiKey: "your_api_sports_key",
});

// Fetch current Premier League standings
const { response } = await football.standings.get({
  league: 39,
  season: 2024,
});

console.log(response[0].league.standings);

RapidAPI Usage

const football = new ApiFootballClient({
  apiKey: "your_rapidapi_key",
  provider: "rapidapi",
});

Usage Guide

Resource Namespaces

The SDK is organized into intuitive namespaces that match the API documentation:

  • client.fixtures - All fixture related data (live, rounds, head-to-head, etc.)
  • client.leagues - League info and seasons
  • client.teams - Team info, statistics, and countries
  • client.players - Player data, top scorers, assists, squads
  • client.odds - Pre-match and live odds, bookmakers, bets
  • client.standings - League standings
  • client.countries - List of supported countries
  • ... and many more.

Example: Nested Resources

For complex endpoints like Fixtures, sub-resources are used for better organization:

// Get statistics for a specific fixture
const stats = await football.fixtures.statistics.get({ fixture: 215662 });

// Get live scores for specific leagues
const live = await football.fixtures.live({ league: "39-61" });

Rate Limit Tracking

The client automatically tracks rate limits from response headers:

const res = await football.fixtures.get({ id: 215662 });

console.log(football.rateLimit);
// Output: { requestsRemaining: 99, requestsLimit: 100, dailyRemaining: 7450 }

Advanced Configuration

const football = new ApiFootballClient({
  apiKey: "...",
  timeout: 15000, // 15s timeout
  maxRetries: 3, // Retry on 5xx errors or timeouts
  retryDelay: 1000, // Base delay for linear backoff
});

API Coverage

| Category | Client Property | Key Methods | | :--------------- | :----------------------------------------------------------- | :-------------------------------------------- | | Global | timezone, countries | list(), get() | | Competitions | leagues, standings | get(), seasons() | | Teams | teams, venues | get(), statistics(), seasons() | | Matches | fixtures | get(), live(), headToHead(), rounds() | | In-Match | fixtures.statistics, fixtures.events, fixtures.lineups | get() | | Athletes | players, coaches | get(), seasons(), squads.get() | | Rankings | players.topScorers, players.topAssists | get() | | Betting | odds, odds.live | get(), mapping.get(), bets.get() | | Extras | injuries, predictions, transfers, trophies | get() |

TypeScript Support

This SDK is written in TypeScript and provides full type definitions out of the box. You get IntelliSense for both request parameters and complex response shapes, reducing the need to constantly check the documentation.

License

MIT © [Your Name/Organization]