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

@zafronix/football-sdk

v0.2.0

Published

Typed TypeScript client for the Zafronix football APIs — 29 competitions plus cross-competition player, referee, and club data, analytics, and a natural-language /ask endpoint. One key.

Readme

@zafronix/football-sdk

A small, typed TypeScript client for the Zafronix Sports APIs — 29 football competitions (World Cup, Champions League, the top-5 European leagues and their cups, and more), the cross-competition entity APIs (player careers, referee analytics, club honours), and the AI-native surfaces: natural-language ask, semanticSearch, and the resolve identity join layer. One key works across everything.

Zero dependencies. Uses the global fetch (Node 18+, Bun, Deno, or the browser).

Install

npm install @zafronix/football-sdk

Get a free API key at https://api.zafronix.com/signup.

Quick start

import { ZafronixFootball } from '@zafronix/football-sdk';

const zfx = new ZafronixFootball({ apiKey: process.env.ZAFRONIX_API_KEY! });

// Cross-competition player career (typed)
const { career } = await zfx.players.career('lionel-messi-1987');
console.log(career?.totalAppearances, career?.goals);

// Any competition, same shape
const wc2026 = await zfx.competition('world-cup').matches({ year: 2026 });
const table  = await zfx.competition('premier-league').standings();

// Referee analytics + club honours
const ref  = await zfx.referees.analytics('michael-oliver');
const club = await zfx.clubs.honours('real-madrid');

// Ask a question in plain English
const answer = await zfx.ask('Who has won more, Real Madrid or Barcelona?');
console.log(answer.answer);

API

Competitions

zfx.competitions;                                  // catalog: { slug, path, label, mode, format }[]
const c = zfx.competition('champions-league');     // by slug or path
await c.tournaments();
await c.tournament(2024);
await c.matches({ year: 2024, stage: 'final' });
await c.teams();
await c.team('Real Madrid');
await c.standings({ year: 2024, group: 'A' });     // leagues + group stages
await c.bracket({ year: 2024 });                   // knockout competitions
await c.players();
await c.search('Zidane');
await c.onThisDay('05-25');
await c.raw('/aggregates/champions');              // any endpoint under this competition

Footballer API — zfx.players

await zfx.players.search('messi', { limit: 10 });
await zfx.players.get('lionel-messi-1987');
await zfx.players.career('lionel-messi-1987');                 // → PlayerCareerResponse
await zfx.players.leaderboard({ by: 'goals', limit: 10 });     // 'goals' | 'appearances'
await zfx.players.records({ top: 5 });
await zfx.players.resolve({ externalId: 'wikidata:Q615' });    // or { name, born }

Referee API — zfx.referees

await zfx.referees.get('michael-oliver');
await zfx.referees.analytics('michael-oliver');                // → RefereeAnalyticsResponse
await zfx.referees.leaderboard({ by: 'finals', limit: 10 });   // 'matches' | 'finals'
await zfx.referees.resolve({ externalId: 'wikidata:Q794992' });

Club API — zfx.clubs

await zfx.clubs.get('real-madrid');
await zfx.clubs.honours('real-madrid');                        // → ClubHonoursResponse
await zfx.clubs.leaderboard({ limit: 10 });                    // most-decorated
await zfx.clubs.resolve({ name: 'Inter' });                    // any spelling variant

Cross-competition analytics — zfx.analytics

await zfx.analytics.h2h('Real Madrid', 'Barcelona');
await zfx.analytics.teamRecord('Brazil');
await zfx.analytics.onThisDay('07-09');                        // defaults to today (UTC)

Natural language — zfx.ask

const r = await zfx.ask('How has Brazil performed across all competitions?');
r.interpreted.intent;   // 'team_record'
r.answer;               // one-line answer, grounded in the data
r.data;                 // the structured result

Semantic search — zfx.semanticSearch

Meaning-based discovery of the right competition, endpoint, or capability.

const s = await zfx.semanticSearch('European club knockout tournament');
s.results[0].title;     // 'UEFA Champions League API'
// Narrow by kind + cap results:
await zfx.semanticSearch('penalty shootout details', { type: 'endpoint', limit: 3 });

Identity join layer — zfx.resolve

Turn any external id (Wikidata / FBref / Transfermarkt), a Zafronix id, or a name into the right entity — player, club, or referee — with its cross-walk ids, the competitions it appears across, and links to the full record. Bring the id you already have, get ours.

const m = await zfx.resolve({ wikidata: 'Q615' });
m.match.type;           // 'player'
m.match.name;           // 'Lionel Messi'
m.match.externalIds;    // { wikidata: 'Q615', fbref: 'd70ce98e', transfermarkt: '28003' }
m.match.links.career;   // full-record URL

await zfx.resolve({ fbref: '53a2f082' });                 // → Real Madrid (club)
await zfx.resolve({ name: 'Collina', type: 'referee' });  // disambiguate a name

Errors

Non-2xx responses throw a ZafronixApiError with status, url, and the parsed body:

import { ZafronixApiError } from '@zafronix/football-sdk';
try {
  await zfx.players.get('nobody');
} catch (e) {
  if (e instanceof ZafronixApiError) console.error(e.status, e.message);
}

Notes

  • One key, every API. The same key works across all competitions and entity APIs. The daily request cap is shared. See pricing.
  • Goals in player/records endpoints count competitions Zafronix covers (tournaments + club cups); domestic-league scorer data isn't in the source.
  • Full REST reference: api.zafronix.com/docs. Try endpoints live in the playground.

MIT © Zafronix LLC