从 API 读取亚洲让球盘与大小盘盘口

哪些数据行包含亚洲让球盘与大小球,盘口位置,以及走地盘口如何根据实时比分计算。

5 分钟阅读 ·

本指南从比赛的 id 开始,首次请求展示了如何查找比赛。此处比赛处于走地状态,亚洲让球盘的盘口可能会从当前比分开始计算。

盘口类型

亚洲让球盘和大小球分为四种盘口类型,可通过 odd_type_ids 查询。每行的盘口数值位于 hc。

盘口类型
type_id名称含义
0AH1Asian handicap, home
1AH2Asian handicap, away
8OverTotal goals over, Asian lines included (the line is in hc, e.g. 2.25 or 2.75). The coverage pages list the Asian lines as Asian Over/Under.
9UnderTotal goals under, Asian lines included (the line is in hc, e.g. 2.25 or 2.75). The coverage pages list the Asian lines as Asian Over/Under.

如何请求

将比赛传入 match_ids,四种类型传入 odd_type_ids,全场传入 odd_period_ids。类型与阶段为过滤器:若省略,响应将包含该比赛的所有盘口和阶段。

curl -X POST https://oddfeeds.com/api/v1/feeds \
  -H "Authorization: Bearer ofk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"scope":"odds","match_ids":[13675188],"odd_type_ids":[0,1,8,9],"odd_period_ids":[1]}'

返回结果 · API 于 2026年11月26日 返回的结果,仅展示前几行。

JSON 返回结果: 如何请求
{
  "status": "ok",
  "data": {
    "prematch": [],
    "inplay": [
      {
        "id": 401955490,
        "active": 1,
        "match_id": 13675188,
        "event_id": 72586828,
        "bookmaker": {
          "id": 26,
          "name": "Bet365"
        },
        "datetime": "2026-11-26T15:17:12",
        "period_id": 1,
        "type_id": 0,
        "order": 1,
        "back_lay_id": 0,
        "liquidity": -1,
        "hc": 0.75,
        "hc_as_draw": 1,
        "price": 1.575,
        "nav": "{\"v\":1,\"scope\":\"inplay\",\"eventId\":\"204400836\",\"oddId\":\"55...",
        "runtime": {
          "play": {
            "codec": 12,
            "display": "1H 12'"
          },
          "points": {
            "home": 0,
            "away": 0
          }
        }
      },
      {
        "id": 401954914,
        "active": 1,
        "match_id": 13675188,
        "event_id": 72457317,
        "bookmaker": {
          "id": 41,
          "name": "yabo"
        },
        "datetime": "2026-11-26T15:17:20",
        "period_id": 1,
        "type_id": 0,
        "order": 1,
        "back_lay_id": 0,
        "liquidity": -1,
        "hc": 1,
        "hc_as_draw": 1,
        "price": 1.41,
        "nav": "{\"v\":1,\"scope\":\"inplay\",\"eventId\":\"5853048\",\"event\":{\"spo...",
        "runtime": {
          "play": {
            "codec": 12,
            "display": "1H 12'"
          },
          "points": {
            "home": 0,
            "away": 0
          }
        }
      }
    ]
  },
  "time": "2026-11-26T15:17:21",
  "ms": "14.54ms"
}

每行对应博彩公司的一个赔率:type_id 说明盘口类型和投注项,hc 提供盘口数值。

盘口及其计算规则

赔率数据行字段说明
字段含义
hcThe handicap / total line, e.g. -0.5 or 2.5. On 1X2 rows (type_id 2, 3, 4) a non-zero hc is a European handicap line, and for correct score (type_id 66) it carries the score; see the type_id table.
hc_as_draw1 when the line counts from the current score, 0 when it counts from kickoff. In-play they differ by the goal difference: at 1-0, -0.25 with 1 equals -1.25 with 0.

在走地状态下,runtime 包含该赔率发布时的比分:当 hc_as_draw 为 1 时,盘口从该比分开始计算。

全场与半场

odd_period_ids 用于指定赔率所对应的比赛阶段:全场、上半场或下半场。

比赛阶段
period_id名称
0First half
1Full time
6Second half

单脚本读取单场比赛的所有盘口

此脚本请求单场比赛的四种类型,并打印每家博彩公司的盘口,将大小球的大盘和小盘并排输出。它从 ODDFEEDS_KEY 读取您的密钥,并从第一个参数获取比赛(即您自己响应中的 match_id)。

// Every Asian handicap and over/under line of one match, per bookmaker.
// Run it with your key and a match id from your own answer:
//   ODDFEEDS_KEY=<your key> node asian-handicap.mjs <match id>
const API = process.env.ODDFEEDS_URL || 'https://oddfeeds.com/api/v1/feeds';
const matchId = Number(process.argv[2]);

const res = await fetch(API, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.ODDFEEDS_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    scope: 'odds',
    match_ids: [matchId],
    odd_type_ids: [0, 1, 8, 9],
    odd_period_ids: [1],
  }),
});
const feed = await res.json();
if (feed.status !== 'ok') throw new Error(`${res.status}: ${feed.error}`);
const rows = [...feed.data.prematch, ...feed.data.inplay];
console.log(`Match ${matchId}: ${rows.length} prices`);

const SIDE = { 0: 'AH home', 1: 'AH away' };
const byBook = new Map();
for (const r of rows) {
  if (!byBook.has(r.bookmaker.name)) byBook.set(r.bookmaker.name, []);
  byBook.get(r.bookmaker.name).push(r);
}
for (const [name, list] of byBook) {
  console.log(name);
  const ah = list.filter((r) => r.type_id <= 1)
    .sort((a, b) => a.type_id - b.type_id || a.hc - b.hc);
  for (const r of ah) {
    const fromScore = r.hc_as_draw ? ' (from the score)' : '';
    console.log(`  ${SIDE[r.type_id]} ${r.hc}${fromScore}: ${r.price}`);
  }
  const totals = new Map();
  for (const r of list.filter((x) => x.type_id === 8 || x.type_id === 9)) {
    if (!totals.has(r.hc)) totals.set(r.hc, {});
    totals.get(r.hc)[r.type_id === 8 ? 'over' : 'under'] = r.price;
  }
  for (const [hc, t] of [...totals].sort((a, b) => a[0] - b[0])) {
    console.log(`  total ${hc}: over ${t.over ?? '-'}, under ${t.under ?? '-'}`);
  }
}

下一步

文档参考表列出了所有盘口类型和阶段,覆盖范围页面列出了每家博彩公司的盘口,其中包括亚洲让球盘和亚洲大小盘。

使用实时数据测试

在免费账户的测试场中,直接通过浏览器使用实时数据运行这些请求。