@apicity/ openligadb
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 });
获取可用的同事
GET openligadb.getavailableleagues
GET https://api.openligadb.de/getavailableleagues
成本等级 : cheap
const leagues = await openligadb.getavailableleagues();
GET openligadb.getavailableleagues.bySeason
GET https://api.openligadb.de/getavailableleagues/{season}
成本等级 : cheap
const leagues = await openligadb.getavailableleagues.bySeason({ season: 2024 });
获取可用体育
GET openligadb.getavailablesports
GET https://api.openligadb.de/getavailablesports
成本等级 : cheap
const sports = await openligadb.getavailablesports();
获得可用团队
GET openligadb.getavailableteams
GET https://api.openligadb.de/getavailableteams/{leagueShortcut}/{leagueSeason}
成本等级 : cheap
const teams = await openligadb.getavailableteams({ leagueShortcut: "bl1", leagueSeason: 2024 });
调色板
GET openligadb.getbltable
GET https://api.openligadb.de/getbltable/{leagueShortcut}/{leagueSeason}
成本等级 : cheap
const res = await openligadb.get.getbltable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
获取当前组
GET openligadb.getcurrentgroup
GET https://api.openligadb.de/getcurrentgroup/{leagueShortcut}
成本等级 : cheap
const group = await openligadb.getcurrentgroup({ leagueShortcut: "bl1" });
获得目标
GET openligadb.getgoalgetters
GET https://api.openligadb.de/getgoalgetters/{leagueShortcut}/{leagueSeason}
成本等级 : cheap
const res = await openligadb.get.getgoalgetters({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
获取组表
GET openligadb.getgrouptable
GET https://api.openligadb.de/getgrouptable/{leagueShortcut}/{leagueSeason}
成本等级 : cheap
const res = await openligadb.get.getgrouptable({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
最后更改日期
GET openligadb.getlastchangedate
GET https://api.openligadb.de/getlastchangedate/{leagueShortcut}/{leagueSeason}/{groupOrderId}
成本等级 : cheap
const changedAt = await openligadb.getlastchangedate({
leagueShortcut: "bl1",
leagueSeason: 2024,
groupOrderId: 1,
});
最后的比赛 同事短棋
GET openligadb.getlastmatchbyleagueshortcut
GET https://api.openligadb.de/getlastmatchbyleagueshortcut/{leagueShortcut}
成本等级 : cheap
const match = await openligadb.getlastmatchbyleagueshortcut({ leagueShortcut: "bl1" });
最后的比赛 同事小组
GET openligadb.getlastmatchbyleagueteam
GET https://api.openligadb.de/getlastmatchbyleagueteam/{leagueId}/{teamId}
成本等级 : cheap
const match = await openligadb.getlastmatchbyleagueteam({
leagueId: 4500,
teamId: 40,
});
获取匹配数据
GET openligadb.getmatchdata.byId
GET https://api.openligadb.de/getmatchdata/{matchId}
成本等级 : cheap
const res = await openligadb.getmatchdata.byId({ matchId: 68720 });
GET openligadb.getmatchdata.byLeagueSeason
GET https://api.openligadb.de/getmatchdata/{leagueShortcut}/{leagueSeason}
成本等级 : cheap
const res = await openligadb.getmatchdata.byLeagueSeason({
leagueShortcut: "bl1",
leagueSeason: 2024,
});
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,
});
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",
});
GET openligadb.getmatchdata.byTeams
GET https://api.openligadb.de/getmatchdata/{teamId1}/{teamId2}
成本等级 : cheap
const res = await openligadb.getmatchdata.byTeams({ teamId1: 16, teamId2: 40 });
格玛切斯比特姆
GET openligadb.getmatchesbyteam
GET https://api.openligadb.de/getmatchesbyteam/{teamFilterstring}/{weekCountPast}/{weekCountFuture}
成本等级 : cheap
const matches = await openligadb.getmatchesbyteam({
teamFilterstring: "Bayern",
weekCountPast: 4,
weekCountFuture: 2,
});
闪光闪烁
GET openligadb.getmatchesbyteamid
GET https://api.openligadb.de/getmatchesbyteamid/{teamId}/{weekCountPast}/{weekCountFuture}
成本等级 : cheap
const matches = await openligadb.getmatchesbyteamid({
teamId: 40,
weekCountPast: 4,
weekCountFuture: 2,
});
获得下一场比赛的速记
GET openligadb.getnextmatchbyleagueshortcut
GET https://api.openligadb.de/getnextmatchbyleagueshortcut/{leagueShortcut}
成本等级 : cheap
const match = await openligadb.getnextmatchbyleagueshortcut({ leagueShortcut: "bl1" });
获得下一场比赛的团队
GET openligadb.getnextmatchbyleagueteam
GET https://api.openligadb.de/getnextmatchbyleagueteam/{leagueId}/{teamId}
成本等级 : cheap
const match = await openligadb.getnextmatchbyleagueteam({
leagueId: 4500,
teamId: 40,
});
获取结果信息
GET openligadb.getresultinfos
GET https://api.openligadb.de/getresultinfos/{leagueId}
成本等级 : cheap
const resultInfo = await openligadb.getresultinfos({ leagueId: 4500 });
摇摆
GET openligadb.swagger.v1.swaggerJson
GET https://api.openligadb.de/swagger/v1/swagger.json
成本等级 : cheap
const res = await openligadb.swagger.v1.swaggerJson();
部分 辣点 单相机.
许可证
麻省理工学院——见 自由主义。 。 。 .