各博彩公司对同一注开出的价格不同,比价就是挑最好的那个。这个脚本比较美国博彩公司的每条NFL盘口。
一次请求多家博彩公司
一个请求返回一场比赛的全部博彩公司,因此无需再做拼接。region=us只保留美国博彩公司,limit=3请求接下来的三场比赛。这次调用花1积分。
运行脚本
把密钥导出为DINO_API_KEY,用Python 3运行下面的脚本。
import json import os from datetime import datetime, timezone from urllib.request import Request, urlopen URL = "https://api.dino.markets/v2/odds?league=nfl®ion=us&limit=3" request = Request(URL, headers={"Authorization": f"Bearer {os.environ['DINO_API_KEY']}"}) with urlopen(request, timeout=30) as response: events = json.load(response)["events"] now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") for event in events: if event["start_time"] <= now: # only games that have not started continue prices = {} # (market, outcome, point) -> [(decimal, american, book)] for book in event["books"]: for market in book["markets"]: for o in market["outcomes"]: key = (market["key"], o["name"], o.get("point")) prices.setdefault(key, []).append((float(o["price"]), o["american"], book["name"])) print(" at ".join(p["name"] for p in sorted(event["participants"], key=lambda p: p["role"]))) for (market, name, point), offers in sorted(prices.items(), key=str): if len(offers) < 2: # nothing to compare at this line continue best, worst = max(offers), min(offers) if best[0] == worst[0]: # every book offers the same price continue label = f"{market} {name}" if point is not None: label += f" {float(point):+g}" if market == "spread" else f" {float(point):g}" extra = 100 * (best[0] - worst[0]) print(f" {label}: {best[1]} at {best[2]}, worst {worst[1]} at {worst[2]}, {extra:.2f} more per 100 staked ({len(offers)} books)")
输出中的第一场比赛,运行于2026年11月25日03:33 UTC:
Green Bay Packers at Los Angeles Rams moneyline Green Bay Packers: +120 at FanDuel, worst +112 at Bally Bet, 8.00 more per 100 staked (5 books) moneyline Los Angeles Rams: -134 at DraftKings, worst -142 at FanDuel, 4.20 more per 100 staked (5 books) spread Green Bay Packers +2.5: -108 at FanDuel, worst -110 at DraftKings, 1.70 more per 100 staked (5 books) spread Los Angeles Rams -2.5: -109 at DraftKings, worst -112 at FanDuel, 2.40 more per 100 staked (5 books) total Over 43.5: -114 at betPARX, worst -121 at DraftKings, 5.40 more per 100 staked (4 books) total Under 43.5: +101 at DraftKings, worst -106 at Bally Bet, 7.00 more per 100 staked (4 books)
读懂价差
在包装工队上投注100中奖时,按2.20(美式+120)返还220,按2.12(美式+112)返还212。注项和风险相同,价格更好的博彩公司多付8。
同类比较
让分或大小分只能在相同盘口值下比较。脚本按盘口、结果和point对价格分组,所以大小分44与43.5分开列出。只有一家博彩公司提供的盘口值,以及所有博彩公司价格相同的盘口值,都会被跳过。
常见问题
包含交易所和预测市场吗?
用region=us时不包含。它们在region=us_ex中,你也可以在books中点名指定。
为什么没有备选盘?
API对让分和大小分提供各博彩公司的主盘。
看到最佳价格时还能下到吗?
请先到博彩公司核对。updated_at表示价格首次被看到的时间,价格随时可能变动。
其他运动也能用吗?
能。把league改成GET /v2/leagues中任意一个比赛类联赛。