@apicity/openligadb
OpenLigaDB API provider for public soccer match data, metadata, standings, and scorers.
OpenLigaDB is a public read-only API. createOpenLigaDB() does not take credentials, and the provider does not send auth headers.
Runtime dependencies:
zod@^4.6.6— request schemas attached to endpoint methods as.schema; response schemas exported
Installation
npm install @apicity/openligadb
# or
pnpm add @apicity/openligadb
Quick Start
import { createOpenLigaDB } from "@apicity/openligadb";
const openligadb = createOpenLigaDB();
Matchdata Examples
OpenLigaDB is public and does not require an API key.
import { createOpenLigaDB } from "@apicity/openligadb";
const openligadb = createOpenLigaDB();
const match = await openligadb.getmatchdata.byId({ matchId: 68720 });
const season = await openligadb.getmatchdata.byLeagueSeason({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
The overloaded upstream /getmatchdata paths are exposed as explicit
by* methods so team, group, season, and match-id routes cannot collide.
Next Match And Team Window Examples
The next/last shortcuts return one match. Team windows return recent and upcoming matches around today, controlled by past/future week counts:
const nextMatch = await openligadb.getnextmatchbyleagueshortcut({
leagueShortcut: "bl1",
});
const recentAndUpcoming = await openligadb.getmatchesbyteam({
teamFilterstring: "Bayern",
weekCountPast: 4,
weekCountFuture: 2,
});
Standings And Scorers Examples
League standings, group tables, and top scorers share the same
leagueShortcut and leagueSeason request shape:
const standings = await openligadb.getbltable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
const groupTable = await openligadb.getgrouptable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
const topScorers = await openligadb.getgoalgetters({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
Catalog Discovery Flow
OpenLigaDB's public catalog endpoints work without credentials. A common flow is sports -> leagues -> groups, teams, and result metadata:
import { createOpenLigaDB } from "@apicity/openligadb";
const openligadb = createOpenLigaDB();
const sports = await openligadb.getavailablesports();
const leagues = await openligadb.getavailableleagues.bySeason({
season: 2024,
});
const league = leagues.find((item) => item.leagueShortcut === "bl1");
if (league) {
const groups = await openligadb.getavailablegroups({
leagueShortcut: league.leagueShortcut!,
leagueSeason: Number(league.leagueSeason),
});
const teams = await openligadb.getavailableteams({
leagueShortcut: league.leagueShortcut!,
leagueSeason: Number(league.leagueSeason),
});
const resultInfo = await openligadb.getresultinfos({
leagueId: league.leagueId,
});
}
All path-parameter methods expose request schemas via .schema, for
example openligadb.getavailablegroups.schema.safeParse(input).
Errors And Scope
- OpenLigaDB's documented public surface is read-only. This package
exposes
GEThelpers only and never sends auth headers. - The public upstream docs do not document pagination parameters, rate-limit headers, or credential requirements for these routes, so this provider does not add client-side helpers for them.
- Non-2xx responses throw
OpenLigaDBErrorwithstatusandbody. JSON error bodies stay as parsed objects, whiletext/plainbodies are preserved as strings so missing-match messages are not lost. - Empty success bodies resolve to
null; endpoint helpers with schemas expose request validation through.schema.safeParse(input).
API Reference
23 endpoints across 18 groups. Each method mirrors an upstream URL path.
getavailablegroups
GET openligadb.getavailablegroups
GET https://api.openligadb.de/getavailablegroups/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const groups = await openligadb.getavailablegroups({ leagueShortcut: "bl1", leagueSeason: 2024 });
getavailableleagues
GET openligadb.getavailableleagues
GET https://api.openligadb.de/getavailableleagues
Cost tier: cheap
const leagues = await openligadb.getavailableleagues();
GET openligadb.getavailableleagues.bySeason
GET https://api.openligadb.de/getavailableleagues/{season}
Cost tier: cheap
const leagues = await openligadb.getavailableleagues.bySeason({ season: 2024 });
getavailablesports
GET openligadb.getavailablesports
GET https://api.openligadb.de/getavailablesports
Cost tier: cheap
const sports = await openligadb.getavailablesports();
getavailableteams
GET openligadb.getavailableteams
GET https://api.openligadb.de/getavailableteams/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const teams = await openligadb.getavailableteams({ leagueShortcut: "bl1", leagueSeason: 2024 });
getbltable
GET openligadb.getbltable
GET https://api.openligadb.de/getbltable/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const res = await openligadb.get.getbltable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
getcurrentgroup
GET openligadb.getcurrentgroup
GET https://api.openligadb.de/getcurrentgroup/{leagueShortcut}
Cost tier: cheap
const group = await openligadb.getcurrentgroup({ leagueShortcut: "bl1" });
getgoalgetters
GET openligadb.getgoalgetters
GET https://api.openligadb.de/getgoalgetters/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const res = await openligadb.get.getgoalgetters({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
getgrouptable
GET openligadb.getgrouptable
GET https://api.openligadb.de/getgrouptable/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const res = await openligadb.get.getgrouptable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
getlastchangedate
GET openligadb.getlastchangedate
GET https://api.openligadb.de/getlastchangedate/{leagueShortcut}/{leagueSeason}/{groupOrderId}
Cost tier: cheap
const changedAt = await openligadb.getlastchangedate({
leagueShortcut: "bl1",
leagueSeason: 2024,
groupOrderId: 1,
});
getlastmatchbyleagueshortcut
GET openligadb.getlastmatchbyleagueshortcut
GET https://api.openligadb.de/getlastmatchbyleagueshortcut/{leagueShortcut}
Cost tier: cheap
const match = await openligadb.getlastmatchbyleagueshortcut({ leagueShortcut: "bl1" });
getlastmatchbyleagueteam
GET openligadb.getlastmatchbyleagueteam
GET https://api.openligadb.de/getlastmatchbyleagueteam/{leagueId}/{teamId}
Cost tier: cheap
const match = await openligadb.getlastmatchbyleagueteam({
leagueId: 4500,
teamId: 40,
});
getmatchdata
GET openligadb.getmatchdata.byId
GET https://api.openligadb.de/getmatchdata/{matchId}
Cost tier: cheap
const res = await openligadb.getmatchdata.byId({ matchId: 68720 });
GET openligadb.getmatchdata.byLeagueSeason
GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}
Cost tier: cheap
const res = await openligadb.getmatchdata.byLeagueSeason({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
GET openligadb.getmatchdata.byLeagueSeasonGroup
GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}/{groupOrderId}
Cost tier: cheap
const res = await openligadb.getmatchdata.byLeagueSeasonGroup({
leagueShortcut: "bl1",
leagueSeason: 2024,
groupOrderId: 1,
});
GET openligadb.getmatchdata.byLeagueSeasonTeam
GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}/{teamFilterstring}
Cost tier: cheap
const res = await openligadb.getmatchdata.byLeagueSeasonTeam({
leagueShortcut: "bl1",
leagueSeason: 2024,
teamFilterstring: "Bayern",
});
GET openligadb.getmatchdata.byTeams
GET https://api.openligadb.de/getmatchdata/{teamId1}/{teamId2}
Cost tier: cheap
const res = await openligadb.getmatchdata.byTeams({ teamId1: 16, teamId2: 40 });
getmatchesbyteam
GET openligadb.getmatchesbyteam
GET https://api.openligadb.de/getmatchesbyteam/{teamFilterstring}/{weekCountPast}/{weekCountFuture}
Cost tier: cheap
const matches = await openligadb.getmatchesbyteam({
teamFilterstring: "Bayern",
weekCountPast: 4,
weekCountFuture: 2,
});
getmatchesbyteamid
GET openligadb.getmatchesbyteamid
GET https://api.openligadb.de/getmatchesbyteamid/{teamId}/{weekCountPast}/{weekCountFuture}
Cost tier: cheap
const matches = await openligadb.getmatchesbyteamid({
teamId: 40,
weekCountPast: 4,
weekCountFuture: 2,
});
getnextmatchbyleagueshortcut
GET openligadb.getnextmatchbyleagueshortcut
GET https://api.openligadb.de/getnextmatchbyleagueshortcut/{leagueShortcut}
Cost tier: cheap
const match = await openligadb.getnextmatchbyleagueshortcut({ leagueShortcut: "bl1" });
getnextmatchbyleagueteam
GET openligadb.getnextmatchbyleagueteam
GET https://api.openligadb.de/getnextmatchbyleagueteam/{leagueId}/{teamId}
Cost tier: cheap
const match = await openligadb.getnextmatchbyleagueteam({
leagueId: 4500,
teamId: 40,
});
getresultinfos
GET openligadb.getresultinfos
GET https://api.openligadb.de/getresultinfos/{leagueId}
Cost tier: cheap
const resultInfo = await openligadb.getresultinfos({ leagueId: 4500 });
swagger
GET openligadb.swagger.v1.swaggerJson
GET https://api.openligadb.de/swagger/v1/swagger.json
Cost tier: cheap
const res = await openligadb.swagger.v1.swaggerJson();
Part of the apicity monorepo.
License
MIT — see LICENSE.