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

soccer-data

v1.0.6

Published

npm module to fetch up to date soccer data.

Readme

soccer-data

npm version

A library to make fetching up to date soccer data easy. Most functions don't require an API key but some require it. Information is fetched from TheSportsDB.

How to use

  • In your terminal, change to your project's root directory.
  • Install the module by running npm install soccer-data in your terminal.
  • In the JavaScript file where you wish to use this tool, import the module by writing
    • const soccerData = require('soccer-data')
  • or import functions you wish to use using ES6 syntax
    • const { setAPIKey, teamDetails } = require('soccer-data')
  • All functions except setApiKey will return promises, make sure to use asynchronous functions and ensure they resolve.

Methods

setApiKey(key)

Set an API key to be able to use the methods that require it.

| param | type | required | | ----- | ------ | -------- | | key | string | true |

API Key Required

Before using these methods you must obtain and set a valid API Key from TheSportsDB using setAPIKey(key).

allPlayersInTeam(teamId)

Returns array of players' details in a team.

| param | type | required | | ------ | ------ | -------- | | teamId | string | true |

allPlayersInTeamName(teamName)

Returns array of players' details in a team.

| param | type | required | | -------- | ------ | -------- | | teamName | string | true |

API Key Not Required

These methods do not require an API Key.

teamByShortCode(teamShortCode)

Returns team details by team short code e.g. Ars for Arsenal.

| param | type | required | | --------------- | ------ | -------- | | teamShortCode | string | true |

searchTeamName(teamName)

Returns team details by team name.

| param | type | required | | -------- | ------ | -------- | | teamName | string | true |

searchPlayerName(playerName)

Returns player details by player name.

| param | type | required | | ---------- | ------ | -------- | | playerName | string | true |

searchEventName(eventName)

Returns event details by event name.

| param | type | required | | --------- | ------ | -------- | | eventName | string | true |

allLeagues(country)

Returns array of all leagues. If country parameter is provided, only leagues in said country are returned.

| param | type | required | | ------- | ------ | -------- | | country | string | false |

allSeasonsInLeague(leagueId)

Returns array of all seasons in league by league id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true |

allTeamsInLeague(leagueId)

Returns array of all teams in league by league id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true |

allPlayersInTeam(teamId)

Returns array of all players in team by team id.

| param | type | required | | ------ | ------ | -------- | | teamId | string | true |

leagueDetails(leagueId)

Returns league details by id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true |

teamDetails(teamId)

Returns team details by id.

| param | type | required | | ------ | ------ | -------- | | teamId | string | true |

playerDetails(playerId)

Returns player details by id.

| param | type | required | | -------- | ------ | -------- | | playerId | string | true |

eventDetails(eventId)

Returns event details by id.

| param | type | required | | ------- | ------ | -------- | | eventId | string | true |

playerHonours(playerId)

Returns player honours by player id.

| param | type | required | | -------- | ------ | -------- | | playerId | string | true |

playerFormerTeams(playerId)

Returns player former teams by player id.

| param | type | required | | -------- | ------ | -------- | | playerId | string | true |

playerContracts(playerId)

Returns player contracts by player id.

| param | type | required | | -------- | ------ | -------- | | playerId | string | true |

leagueTable(leagueId, seasonId)

Returns league table by league id and season id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true | | seasonId | string | true |

nextFiveEventsByTeam(teamId)

Returns next 5 events by team id.

| param | type | required | | ------ | ------ | -------- | | teamId | string | true |

nextFiveEventsByTeam(teamId)

Returns last 5 events by team id.

| param | type | required | | ------ | ------ | -------- | | teamId | string | true |

nextFifteenEventsByLeague(leagueId)

Returns next 15 events by league id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true |

lastFifteenEventsByLeague(leagueId)

Returns last 15 events by league id.

| param | type | required | | -------- | ------ | -------- | | leagueId | string | true |