@apicity/thesportsdb

中文文档
0.26.0发布于 2026/11/05MITTypeScriptES Module近 30 天下载 3612

TheSportsDB V1 and V2 sports data API provider.

原始使用文档
文档目录48 节
  1. Installation
  2. Quick Start
  3. V2 Authentication
  4. Operational Notes
  5. Search Examples
  6. Player Lookup Examples
  7. API Reference
  8. all
  9. allCountries
  10. allLeagues
  11. allSports
  12. eventResults
  13. eventsday
  14. eventshighlights
  15. eventslast
  16. eventsnext
  17. eventsnextleague
  18. eventspastleague
  19. eventsseason
  20. eventstv
  21. filter
  22. list
  23. livescore
  24. lookup
  25. lookupAllPlayers
  26. lookupcontracts
  27. lookupEvent
  28. lookupEventStats
  29. lookupformerteams
  30. lookuphonours
  31. lookupLineup
  32. lookupmilestones
  33. lookupplayer
  34. lookupplayerstats
  35. lookupTimeline
  36. lookupTv
  37. playerresults
  38. schedule
  39. search
  40. searchAllLeagues
  41. searchAllSeasons
  42. searchAllTeams
  43. searchEvents
  44. searchFilename
  45. searchPlayers
  46. searchTeams
  47. searchVenues
  48. License

@apicity/thesportsdb

npm dependencies TypeScript docs

TheSportsDB V1 and V2 sports data API provider.

Runtime dependencies:

  • zod@^4.6.6 — request schemas attached to endpoint methods as .schema; response schemas exported

Installation

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

Quick Start

import { createTheSportsDB } from "@apicity/thesportsdb";

const thesportsdb = createTheSportsDB({ apiKey: process.env.THESPORTSDB_API_KEY });

V2 Authentication

V1 calls default to TheSportsDB's free 123 key in the URL path when apiKey is omitted. V2 is premium-only and sends the same apiKey in the X-API-KEY header; V2 methods throw locally if no key is configured.

const thesportsdb = createTheSportsDB({
  apiKey: process.env.THESPORTSDB_API_KEY!,
});

const teams = await thesportsdb.v2.search.team({
  teamName: "Manchester United",
});

For V1 premium calls, the same apiKey option is encoded into the path segment instead of a header:

const premiumV1 = createTheSportsDB({
  apiKey: process.env.THESPORTSDB_API_KEY!,
});

const broadcasts = await premiumV1.v1.eventstv({
  channel: "Peacock_Premium",
});

Operational Notes

All implemented TheSportsDB endpoints are read-only GET calls. The provider does not expose mutating endpoints.

The implemented API surface has no pagination parameters. Upstream responses use endpoint-specific wrapper arrays and documented result limits; empty and no-result wrappers remain representable as null or empty arrays.

Non-2xx responses throw TheSportsDBError with status and parsed body where possible. Rate-limit responses keep their upstream 429 status and body. V2 methods throw a local 401 before fetch when no apiKey is configured for X-API-KEY authentication.

Search Examples

TheSportsDB V1 uses the free 123 key by default. Pass apiKey only when you have a premium key.

import { createTheSportsDB } from "@apicity/thesportsdb";

const thesportsdb = createTheSportsDB();

const teams = await thesportsdb.v1.searchTeams({
  team: "Arsenal",
});

const events = await thesportsdb.v1.searchEvents({
  event: "Arsenal_vs_Chelsea",
  season: "2016-2017",
  date: "2015-04-26",
});

const filename = await thesportsdb.v1.searchFilename({
  filename: "English_Premier_League_2015-04-26_Arsenal_vs_Chelsea",
});

const players = await thesportsdb.v1.searchPlayers({
  player: "Danny Welbeck",
});

const venues = await thesportsdb.v1.searchVenues({
  venue: "Wembley",
});

No-result V1 searches preserve TheSportsDB's nullable wrapper arrays, such as { teams: null } or { player: null }.

Player Lookup Examples

Player lookup, honours, former-team, milestone, contract, result, and statistics routes use TheSportsDB's numeric player id.

import { createTheSportsDB } from "@apicity/thesportsdb";

const thesportsdb = createTheSportsDB({
  apiKey: process.env.THESPORTSDB_API_KEY,
});

const player = await thesportsdb.v1.lookupplayer({ idPlayer: 34145937 });
const honours = await thesportsdb.v1.lookuphonours({ idPlayer: 34147178 });
const stats = await thesportsdb.v1.lookupplayerstats({ idPlayer: 34146304 });

No-result responses preserve TheSportsDB's wrapper key with a null value, for example { players: null }.

V1 uses an API key in the URL path. The provider defaults to the public free key 123; pass apiKey to use your own key. V2 uses the same apiKey option as an X-API-KEY header and is available under thesportsdb.v2.

const league = await thesportsdb.v1.lookup.league({ idLeague: 4328 });
const table = await thesportsdb.v1.lookup.table({
  idLeague: 4328,
  season: "2020-2021",
});
const team = await thesportsdb.v1.lookup.team({ idTeam: 133604 });

const nextLeagueEvents = await thesportsdb.v2.schedule.next.league({
  idLeague: 4328,
});
const liveSoccer = await thesportsdb.v2.livescore.bySport({
  sport: "soccer",
});

V2 is premium-only and sends the same apiKey as an X-API-KEY header. V2 lookup method names mirror the path segments:

const player = await thesportsdb.v2.lookup.player({ idPlayer: 34172575 });
const lineup = await thesportsdb.v2.lookup.eventLineup({
  idEvent: 1937584,
});
const highlights = await thesportsdb.v2.lookup.eventHighlights({
  idEvent: 2044892,
});

API Reference

84 endpoints across 40 groups. Each method mirrors an upstream URL path.

all

GET thesportsdb.v2.all.countries

GET https://www.thesportsdb.com/api/v2/json/all/countries

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.all.countries();

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

GET thesportsdb.v2.all.leagues

GET https://www.thesportsdb.com/api/v2/json/all/leagues

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.all.leagues();

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

GET thesportsdb.v2.all.sports

GET https://www.thesportsdb.com/api/v2/json/all/sports

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.all.sports();

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

allCountries

GET thesportsdb.v1.allCountries

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/all_countries.php

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.allCountries();

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

allLeagues

GET thesportsdb.v1.allLeagues

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/all_leagues.php

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.allLeagues();

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

allSports

GET thesportsdb.v1.allSports

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/all_sports.php

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.allSports();

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

eventResults

GET thesportsdb.v1.eventResults

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventresults.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventResults({ /* ... */ });

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

eventsday

GET thesportsdb.v1.eventsday

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventsday.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventsday({ /* ... */ });

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

eventshighlights

GET thesportsdb.v1.eventshighlights

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventshighlights.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventshighlights({ /* ... */ });

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

eventslast

GET thesportsdb.v1.eventslast

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventslast.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventslast({ /* ... */ });

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

eventsnext

GET thesportsdb.v1.eventsnext

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventsnext.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventsnext({ /* ... */ });

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

eventsnextleague

GET thesportsdb.v1.eventsnextleague

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventsnextleague.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventsnextleague({ /* ... */ });

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

eventspastleague

GET thesportsdb.v1.eventspastleague

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventspastleague.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventspastleague({ /* ... */ });

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

eventsseason

GET thesportsdb.v1.eventsseason

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventsseason.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventsseason({ /* ... */ });

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

eventstv

GET thesportsdb.v1.eventstv

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/eventstv.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.eventstv({ /* ... */ });

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

filter

GET thesportsdb.v2.filter.tv.channel

GET https://www.thesportsdb.com/api/v2/json/filter/tv/channel/{channel}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.filter.tv.channel({ /* ... */ });

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

GET thesportsdb.v2.filter.tv.channelid

GET https://www.thesportsdb.com/api/v2/json/filter/tv/channelid/{idChannel}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.filter.tv.channelid({ /* ... */ });

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

GET thesportsdb.v2.filter.tv.country

GET https://www.thesportsdb.com/api/v2/json/filter/tv/country/{country}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.filter.tv.country({ /* ... */ });

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

GET thesportsdb.v2.filter.tv.day

GET https://www.thesportsdb.com/api/v2/json/filter/tv/day/{date}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.filter.tv.day({ /* ... */ });

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

GET thesportsdb.v2.filter.tv.sport

GET https://www.thesportsdb.com/api/v2/json/filter/tv/sport/{sport}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.filter.tv.sport({ /* ... */ });

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

list

GET thesportsdb.v2.list.players

GET https://www.thesportsdb.com/api/v2/json/list/players/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.list.players({ /* ... */ });

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

GET thesportsdb.v2.list.seasonposters

GET https://www.thesportsdb.com/api/v2/json/list/seasonposters/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.list.seasonposters({ /* ... */ });

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

GET thesportsdb.v2.list.seasons

GET https://www.thesportsdb.com/api/v2/json/list/seasons/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.list.seasons({ /* ... */ });

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

GET thesportsdb.v2.list.teams

GET https://www.thesportsdb.com/api/v2/json/list/teams/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.list.teams({ /* ... */ });

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

livescore

GET thesportsdb.v2.livescore.all

GET https://www.thesportsdb.com/api/v2/json/livescore/all

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.livescore.all();

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

GET thesportsdb.v2.livescore.byLeague

GET https://www.thesportsdb.com/api/v2/json/livescore/{leagueId}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.livescore.byLeague({ /* ... */ });

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

GET thesportsdb.v2.livescore.bySport

GET https://www.thesportsdb.com/api/v2/json/livescore/{sport}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.livescore.bySport({ /* ... */ });

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

lookup

GET thesportsdb.v2.lookup.event

GET https://www.thesportsdb.com/api/v2/json/lookup/event/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.event({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventHighlights

GET https://www.thesportsdb.com/api/v2/json/lookup/event_highlights/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventHighlights({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventLineup

GET https://www.thesportsdb.com/api/v2/json/lookup/event_lineup/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventLineup({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventResults

GET https://www.thesportsdb.com/api/v2/json/lookup/event_results/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventResults({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventStats

GET https://www.thesportsdb.com/api/v2/json/lookup/event_stats/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventStats({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventTimeline

GET https://www.thesportsdb.com/api/v2/json/lookup/event_timeline/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventTimeline({ /* ... */ });

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

GET thesportsdb.v2.lookup.eventTv

GET https://www.thesportsdb.com/api/v2/json/lookup/event_tv/{idEvent}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.eventTv({ /* ... */ });

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

GET thesportsdb.v2.lookup.league

GET https://www.thesportsdb.com/api/v2/json/lookup/league/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.league({ /* ... */ });

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

GET thesportsdb.v2.lookup.player

GET https://www.thesportsdb.com/api/v2/json/lookup/player/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.player({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerContracts

GET https://www.thesportsdb.com/api/v2/json/lookup/player_contracts/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerContracts({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerHonours

GET https://www.thesportsdb.com/api/v2/json/lookup/player_honours/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerHonours({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerMilestones

GET https://www.thesportsdb.com/api/v2/json/lookup/player_milestones/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerMilestones({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerResults

GET https://www.thesportsdb.com/api/v2/json/lookup/player_results/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerResults({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerStats

GET https://www.thesportsdb.com/api/v2/json/lookup/player_stats/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerStats({ /* ... */ });

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

GET thesportsdb.v2.lookup.playerTeams

GET https://www.thesportsdb.com/api/v2/json/lookup/player_teams/{idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.playerTeams({ /* ... */ });

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

GET thesportsdb.v2.lookup.team

GET https://www.thesportsdb.com/api/v2/json/lookup/team/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.team({ /* ... */ });

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

GET thesportsdb.v2.lookup.teamEquipment

GET https://www.thesportsdb.com/api/v2/json/lookup/team_equipment/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.teamEquipment({ /* ... */ });

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

GET thesportsdb.v2.lookup.venue

GET https://www.thesportsdb.com/api/v2/json/lookup/venue/{idVenue}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.lookup.venue({ /* ... */ });

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

GET thesportsdb.v1.lookup.equipment

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupequipment.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookup.equipment({ /* ... */ });

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

GET thesportsdb.v1.lookup.league

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupleague.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookup.league({ /* ... */ });

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

GET thesportsdb.v1.lookup.table

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookuptable.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookup.table({ /* ... */ });

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

GET thesportsdb.v1.lookup.team

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupteam.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookup.team({ /* ... */ });

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

GET thesportsdb.v1.lookup.venue

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupvenue.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookup.venue({ /* ... */ });

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

lookupAllPlayers

GET thesportsdb.v1.lookupAllPlayers

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookup_all_players.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupAllPlayers({ /* ... */ });

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

lookupcontracts

GET thesportsdb.v1.lookupcontracts

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupcontracts.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupcontracts({ /* ... */ });

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

lookupEvent

GET thesportsdb.v1.lookupEvent

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupevent.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupEvent({ /* ... */ });

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

lookupEventStats

GET thesportsdb.v1.lookupEventStats

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupeventstats.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupEventStats({ /* ... */ });

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

lookupformerteams

GET thesportsdb.v1.lookupformerteams

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupformerteams.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupformerteams({ /* ... */ });

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

lookuphonours

GET thesportsdb.v1.lookuphonours

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookuphonours.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookuphonours({ /* ... */ });

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

lookupLineup

GET thesportsdb.v1.lookupLineup

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookuplineup.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupLineup({ /* ... */ });

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

lookupmilestones

GET thesportsdb.v1.lookupmilestones

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupmilestones.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupmilestones({ /* ... */ });

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

lookupplayer

GET thesportsdb.v1.lookupplayer

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupplayer.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupplayer({ /* ... */ });

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

lookupplayerstats

GET thesportsdb.v1.lookupplayerstats

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookupplayerstats.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupplayerstats({ /* ... */ });

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

lookupTimeline

GET thesportsdb.v1.lookupTimeline

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookuptimeline.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupTimeline({ /* ... */ });

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

lookupTv

GET thesportsdb.v1.lookupTv

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/lookuptv.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.lookupTv({ /* ... */ });

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

playerresults

GET thesportsdb.v1.playerresults

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/playerresults.php?id={idPlayer}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.playerresults({ /* ... */ });

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

schedule

GET thesportsdb.v2.schedule.full.team

GET https://www.thesportsdb.com/api/v2/json/schedule/full/team/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.full.team({ /* ... */ });

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

GET thesportsdb.v2.schedule.league

GET https://www.thesportsdb.com/api/v2/json/schedule/league/{idLeague}/{season}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.league({ /* ... */ });

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

GET thesportsdb.v2.schedule.next.league

GET https://www.thesportsdb.com/api/v2/json/schedule/next/league/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.next.league({ /* ... */ });

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

GET thesportsdb.v2.schedule.next.team

GET https://www.thesportsdb.com/api/v2/json/schedule/next/team/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.next.team({ /* ... */ });

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

GET thesportsdb.v2.schedule.next.venue

GET https://www.thesportsdb.com/api/v2/json/schedule/next/venue/{idVenue}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.next.venue({ /* ... */ });

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

GET thesportsdb.v2.schedule.previous.league

GET https://www.thesportsdb.com/api/v2/json/schedule/previous/league/{idLeague}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.previous.league({ /* ... */ });

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

GET thesportsdb.v2.schedule.previous.team

GET https://www.thesportsdb.com/api/v2/json/schedule/previous/team/{idTeam}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.previous.team({ /* ... */ });

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

GET thesportsdb.v2.schedule.previous.venue

GET https://www.thesportsdb.com/api/v2/json/schedule/previous/venue/{idVenue}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.schedule.previous.venue({ /* ... */ });

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

GET thesportsdb.v2.search.event

GET https://www.thesportsdb.com/api/v2/json/search/event/{eventName}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.search.event({ /* ... */ });

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

GET thesportsdb.v2.search.league

GET https://www.thesportsdb.com/api/v2/json/search/league/{leagueName}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.search.league({ /* ... */ });

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

GET thesportsdb.v2.search.player

GET https://www.thesportsdb.com/api/v2/json/search/player/{playerName}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.search.player({ /* ... */ });

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

GET thesportsdb.v2.search.team

GET https://www.thesportsdb.com/api/v2/json/search/team/{teamName}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.search.team({ /* ... */ });

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

GET thesportsdb.v2.search.venue

GET https://www.thesportsdb.com/api/v2/json/search/venue/{venueName}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.get.v2.search.venue({ /* ... */ });

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

searchAllLeagues

GET thesportsdb.v1.searchAllLeagues

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/search_all_leagues.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchAllLeagues({ /* ... */ });

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

searchAllSeasons

GET thesportsdb.v1.searchAllSeasons

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/search_all_seasons.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchAllSeasons({ /* ... */ });

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

searchAllTeams

GET thesportsdb.v1.searchAllTeams

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/search_all_teams.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchAllTeams({ /* ... */ });

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

searchEvents

GET thesportsdb.v1.searchEvents

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/searchevents.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchEvents({ /* ... */ });

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

searchFilename

GET thesportsdb.v1.searchFilename

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/searchfilename.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchFilename({ /* ... */ });

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

searchPlayers

GET thesportsdb.v1.searchPlayers

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/searchplayers.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchPlayers({ /* ... */ });

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

searchTeams

GET thesportsdb.v1.searchTeams

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/searchteams.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchTeams({ /* ... */ });

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

searchVenues

GET thesportsdb.v1.searchVenues

GET https://www.thesportsdb.com/api/v1/json/{apiKey}/searchvenues.php{query}

Cost tier: cheap

Upstream docs ↗

const res = await thesportsdb.v1.searchVenues({ /* ... */ });

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

Part of the apicity monorepo.

License

MIT — see LICENSE.

版本与发布记录

@apicity/thesportsdb 共发布 59 个版本,首次发布于 2026/06/24;过去 12 个月发布了 59 个版本。

版本发布日期距今
0.26.0latest2026/11/051 天前
0.25.02026/11/033 天前
0.24.12026/11/024 天前
0.24.02026/11/014 天前
0.23.12026/11/015 天前
0.23.02026/11/015 天前

关于 @apicity/thesportsdb 的常见问题

@apicity/thesportsdb 是什么?

TheSportsDB V1 and V2 sports data API provider.

如何安装 @apicity/thesportsdb?

在项目目录运行 npm install @apicity/thesportsdb,或使用 pnpm add / yarn add / bun add。

@apicity/thesportsdb 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apicity/thesportsdb 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@apicity/thesportsdb 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apicity/thesportsdb 可以商用吗?

@apicity/thesportsdb 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@apicity/thesportsdb 的下载量有多少?

根据 npm 官方下载统计,@apicity/thesportsdb 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,612 次,日均约 120 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apicity/thesportsdb 还在维护吗?

最新版本 0.26.0 发布于 2026/11/05(1 天前);至今共发布 59 个版本,其中过去 12 个月发布了 59 个;首次发布于 2026/06/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。