@apicity/openligadb

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

OpenLigaDB API 供公共足球匹配数据,元数据,站位,计分器使用.

中文使用文档
文档目录27 节
  1. 安装
  2. 快速启动
  3. 匹配数据示例
  4. 下一个匹配和团队窗口示例
  5. 常数和分数
  6. 目录 发现流
  7. 错误和范围
  8. API 参考
  9. 获取可用组
  10. 获取可用的同事
  11. 获取可用体育
  12. 获得可用团队
  13. 调色板
  14. 获取当前组
  15. 获得目标
  16. 获取组表
  17. 最后更改日期
  18. 最后的比赛 同事短棋
  19. 最后的比赛 同事小组
  20. 获取匹配数据
  21. 格玛切斯比特姆
  22. 闪光闪烁
  23. 获得下一场比赛的速记
  24. 获得下一场比赛的团队
  25. 获取结果信息
  26. 摇摆
  27. 许可证

@apicity/ openligadb

npm dependencies TypeScript docs

OpenLigaDB API 供公共足球匹配数据,元数据,站位,计分器使用.

OpenLigaDB是一个公共只读的API. createOpenLigaDB() ,且提供者不发送认证信头.

运行时间依赖性 :

  • zod@^4.6.6 - 请求对端点方法附加计划如下: .schema; 响应计划导出

安装

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

快速启动

import { createOpenLigaDB } from "@apicity/openligadb";

const openligadb = createOpenLigaDB();

匹配数据示例

OpenLigaDB是公开的,不需要API密钥.

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,
});

上游超载 /getmatchdata 路径显示为清晰 by* 方法如此的团队,团体,季节, 和匹配的识别路线无法碰撞.

下一个匹配和团队窗口示例

下一个/ 最后一个快捷键返回一个匹配 。 团队窗口最近返回 由过去/未来一周计数控制的今天前后即将进行的比赛 :

const nextMatch = await openligadb.getnextmatchbyleagueshortcut({
  leagueShortcut: "bl1",
});

const recentAndUpcoming = await openligadb.getmatchesbyteam({
  teamFilterstring: "Bayern",
  weekCountPast: 4,
  weekCountFuture: 2,
});

常数和分数

联盟、团体和最高得分者分享同样的 leagueShortcut 财务报告和审定财务报表 leagueSeason 请求形状 :

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,
});

目录 发现流

OpenLigaDB的公开目录端点在无证书的情况下工作. 常见 流量是运动 - > 联盟 - > 团体、团队和结果元数据:

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,
  });
}

所有路径参数方法都通过 .schema,用于 实例 openligadb.getavailablegroups.schema.safeParse(input)。 。 。 .

错误和范围

  • OpenLigaDB所记录的公开表面只读. 这个包 曝光情况 GET 仅帮助且不发送认证信头 .
  • 公开的上游文件没有记录页标参数, 费率限制头,或这些路线的证书要求, 因此,此提供者不会为他们添加客户端助手 .
  • 非-2xx 响应抛出 OpenLigaDBError 与 status 财务报告和审定财务报表 body。 。 。 . JSON 错误天体作为解析对象保留,而 text/plain 机构 保存为字符串,所以缺少匹配信件不会丢失.
  • 空白的成功机构决心 null; 带有图案的端点助手 通过 : .schema.safeParse(input)。 。 。 .

API 参考

23个终点横跨了18个组. 每个方法都映射出上游的 URL 路径 .

获取可用组

GET openligadb.getavailablegroups

GET https://api.openligadb.de/getavailablegroups/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const groups = await openligadb.getavailablegroups({ leagueShortcut: "bl1", leagueSeason: 2024 });

资料来源: packages/provider/openligadb/src/openligadb.ts

获取可用的同事

GET openligadb.getavailableleagues

GET https://api.openligadb.de/getavailableleagues

成本等级 : cheap

上游区域

const leagues = await openligadb.getavailableleagues();

资料来源: packages/provider/openligadb/src/openligadb.ts

GET openligadb.getavailableleagues.bySeason

GET https://api.openligadb.de/getavailableleagues/{season}

成本等级 : cheap

上游区域

const leagues = await openligadb.getavailableleagues.bySeason({ season: 2024 });

资料来源: packages/provider/openligadb/src/openligadb.ts

获取可用体育

GET openligadb.getavailablesports

GET https://api.openligadb.de/getavailablesports

成本等级 : cheap

上游区域

const sports = await openligadb.getavailablesports();

资料来源: packages/provider/openligadb/src/openligadb.ts

获得可用团队

GET openligadb.getavailableteams

GET https://api.openligadb.de/getavailableteams/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const teams = await openligadb.getavailableteams({ leagueShortcut: "bl1", leagueSeason: 2024 });

资料来源: packages/provider/openligadb/src/openligadb.ts

调色板

GET openligadb.getbltable

GET https://api.openligadb.de/getbltable/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const res = await openligadb.get.getbltable({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

获取当前组

GET openligadb.getcurrentgroup

GET https://api.openligadb.de/getcurrentgroup/{leagueShortcut}

成本等级 : cheap

上游区域

const group = await openligadb.getcurrentgroup({ leagueShortcut: "bl1" });

资料来源: packages/provider/openligadb/src/openligadb.ts

获得目标

GET openligadb.getgoalgetters

GET https://api.openligadb.de/getgoalgetters/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const res = await openligadb.get.getgoalgetters({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

获取组表

GET openligadb.getgrouptable

GET https://api.openligadb.de/getgrouptable/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const res = await openligadb.get.getgrouptable({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

最后更改日期

GET openligadb.getlastchangedate

GET https://api.openligadb.de/getlastchangedate/{leagueShortcut}/{leagueSeason}/{groupOrderId}

成本等级 : cheap

上游区域

const changedAt = await openligadb.getlastchangedate({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
  groupOrderId: 1,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

最后的比赛 同事短棋

GET openligadb.getlastmatchbyleagueshortcut

GET https://api.openligadb.de/getlastmatchbyleagueshortcut/{leagueShortcut}

成本等级 : cheap

上游区域

const match = await openligadb.getlastmatchbyleagueshortcut({ leagueShortcut: "bl1" });

资料来源: packages/provider/openligadb/src/openligadb.ts

最后的比赛 同事小组

GET openligadb.getlastmatchbyleagueteam

GET https://api.openligadb.de/getlastmatchbyleagueteam/{leagueId}/{teamId}

成本等级 : cheap

上游区域

const match = await openligadb.getlastmatchbyleagueteam({
  leagueId: 4500,
  teamId: 40,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

获取匹配数据

GET openligadb.getmatchdata.byId

GET https://api.openligadb.de/getmatchdata/{matchId}

成本等级 : cheap

上游区域

const res = await openligadb.getmatchdata.byId({ matchId: 68720 });

资料来源: packages/provider/openligadb/src/openligadb.ts

GET openligadb.getmatchdata.byLeagueSeason

GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}

成本等级 : cheap

上游区域

const res = await openligadb.getmatchdata.byLeagueSeason({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

GET openligadb.getmatchdata.byLeagueSeasonGroup

GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}/{groupOrderId}

成本等级 : cheap

上游区域

const res = await openligadb.getmatchdata.byLeagueSeasonGroup({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
  groupOrderId: 1,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

GET openligadb.getmatchdata.byLeagueSeasonTeam

GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}/{teamFilterstring}

成本等级 : cheap

上游区域

const res = await openligadb.getmatchdata.byLeagueSeasonTeam({
  leagueShortcut: "bl1",
  leagueSeason: 2024,
  teamFilterstring: "Bayern",
});

资料来源: packages/provider/openligadb/src/openligadb.ts

GET openligadb.getmatchdata.byTeams

GET https://api.openligadb.de/getmatchdata/{teamId1}/{teamId2}

成本等级 : cheap

上游区域

const res = await openligadb.getmatchdata.byTeams({ teamId1: 16, teamId2: 40 });

资料来源: packages/provider/openligadb/src/openligadb.ts

格玛切斯比特姆

GET openligadb.getmatchesbyteam

GET https://api.openligadb.de/getmatchesbyteam/{teamFilterstring}/{weekCountPast}/{weekCountFuture}

成本等级 : cheap

上游区域

const matches = await openligadb.getmatchesbyteam({
  teamFilterstring: "Bayern",
  weekCountPast: 4,
  weekCountFuture: 2,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

闪光闪烁

GET openligadb.getmatchesbyteamid

GET https://api.openligadb.de/getmatchesbyteamid/{teamId}/{weekCountPast}/{weekCountFuture}

成本等级 : cheap

上游区域

const matches = await openligadb.getmatchesbyteamid({
  teamId: 40,
  weekCountPast: 4,
  weekCountFuture: 2,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

获得下一场比赛的速记

GET openligadb.getnextmatchbyleagueshortcut

GET https://api.openligadb.de/getnextmatchbyleagueshortcut/{leagueShortcut}

成本等级 : cheap

上游区域

const match = await openligadb.getnextmatchbyleagueshortcut({ leagueShortcut: "bl1" });

资料来源: packages/provider/openligadb/src/openligadb.ts

获得下一场比赛的团队

GET openligadb.getnextmatchbyleagueteam

GET https://api.openligadb.de/getnextmatchbyleagueteam/{leagueId}/{teamId}

成本等级 : cheap

上游区域

const match = await openligadb.getnextmatchbyleagueteam({
  leagueId: 4500,
  teamId: 40,
});

资料来源: packages/provider/openligadb/src/openligadb.ts

获取结果信息

GET openligadb.getresultinfos

GET https://api.openligadb.de/getresultinfos/{leagueId}

成本等级 : cheap

上游区域

const resultInfo = await openligadb.getresultinfos({ leagueId: 4500 });

资料来源: packages/provider/openligadb/src/openligadb.ts

摇摆

GET openligadb.swagger.v1.swaggerJson

GET https://api.openligadb.de/swagger/v1/swagger.json

成本等级 : cheap

上游区域

const res = await openligadb.swagger.v1.swaggerJson();

资料来源: packages/provider/openligadb/src/openligadb.ts

部分 辣点 单相机.

许可证

麻省理工学院——见 自由主义。 。 。 .

版本与发布记录

@apicity/openligadb 共发布 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/openligadb 的常见问题

@apicity/openligadb 是什么?

OpenLigaDB API 供公共足球匹配数据,元数据,站位,计分器使用.

如何安装 @apicity/openligadb?

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

@apicity/openligadb 支持 TypeScript 吗?

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

@apicity/openligadb 支持 ESM 还是 CommonJS?

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

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

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

@apicity/openligadb 可以商用吗?

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

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

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

@apicity/openligadb 还在维护吗?

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