Guide: Python
NRL player-prop line shopping in Python
By the end of this guide you will have a Python script that lays every NRL player prop at your bookmakers side by side: the best price on each try scorer, each book's line on each over/under, how much more a winning bet pays at the best book, and any middle the lines leave open. It takes about fifteen minutes, and the free plan runs it.
Before you start
What you need
- Python
- 3.9 or later, with
requestsinstalled. - A key
- The free Developer plan covers the NRL in season with every listed book but bet365. Shopping pays off with more books to shop between: add Neds, PointsBet, Unibet, Dabble or Betr to
BOOKS, on any plan. - Time
- About fifteen minutes to read and run.
The player props page shows how to spot a book whose line differs from the rest. This guide turns that into a shopping list: for every bet you might make on a player, where it pays most.
Status, 13 Oct 2026. /v1 opens to keys shortly; until then requests are redirected to the docs, and the script stops with a message that says so. Written against the SockOdds v1 contract and tested against its schemas, on a mock that serves the v1 shape. A run against the live feed is pending; its date and league will be added here when it has run. The NRL is off season until March, so that first run will read NFL props, which the same code handles unchanged.
Why shop
The same bet, paid differently
Props are where bookmakers disagree most visibly, because each book sets its own line and price on hundreds of players a round. Taking the best price every time is the cheapest edge a punter can have. Say a player's anytime try is 3.40 at one book and 3.00 at another: a winning dollar returns $2.40 profit at the first and $2.00 at the second, which is 20% more profit for exactly the same bet.
Over/under props add a second dimension. One book might hang a player's tackles at 30.5 while the others sit at 28.5. That is not a better or worse price, it is a different bet, and the script keeps the two apart, except in the one case where they combine cleanly: a middle.
Step 1
Settings
import math
import os
import sys
import time
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from urllib.parse import urljoin
import requests
API = "https://api.sockodds.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SOCKODDS_KEY']}"}
# Books you hold an account with. Every plan reads each listed book but bet365.
BOOKS = ["sportsbet", "tab", "ladbrokes"]
# The coming round. Each game returned is one object, plus one for every price it carries.
LOOKAHEAD = timedelta(days=7)
# True asks for every line each book offers, so more books meet at the same number.
ALTERNATES = False
BOOKS holds the books you have accounts with, because the best price at a book you cannot bet with is no use to you. ALTERNATES asks for every line each book offers instead of only its main one. Every extra line brings more prices, and each price is one more object, so it uses more quota as well as making the report longer; it starts off.
Step 2
Read the round
def get(url, params=None):
"""GET with the key. Waits when the API says to (over the per-minute limit, or briefly
busy); stops with the API's own reason on any other refusal, a used-up month included."""
for _ in range(5):
r = requests.get(url, params=params, headers=HEADERS, timeout=30)
problem = r.json() if "problem+json" in r.headers.get("content-type", "") else {}
if r.status_code in (429, 503) and problem.get("title") != "Monthly allowance reached":
time.sleep(max(1.0, float(r.headers.get("retry-after", 60))))
continue
if r.status_code >= 500:
r.raise_for_status() # a server error: the caller decides whether to try again
if problem:
raise SystemExit(f'{problem["status"]} {problem["title"]}: {problem["detail"]}')
if r.status_code != 200 or "json" not in r.headers.get("content-type", ""):
raise SystemExit(f"{r.status_code} from {r.url}: not a JSON answer from the API")
return r.json()
raise SystemExit(f"{url}: still asked to wait after five tries")
def every(url, params):
"""Every item of a listing, following links.next (which may be relative) across pages."""
while url:
page = get(url, params)
yield from page["data"]
url, params = (urljoin(url, page["links"]["next"]) if page["links"]["next"] else None), None
def fetch_events(league):
"""Every game in the window with every market at your books, across all pages."""
now = datetime.now(timezone.utc)
params = {
"league": league,
"bookmakers": ",".join(BOOKS),
"starts_after": now.strftime("%Y-%m-%dT%H:%M:%SZ"),
"starts_before": (now + LOOKAHEAD).strftime("%Y-%m-%dT%H:%M:%SZ"),
}
if ALTERNATES:
params["alternates"] = "true"
return list(every(f"{API}/odds", params))
One request per page returns every game in the coming week with every market at your books, props included, in the same response as the head to head. No markets filter is sent, so no prop key has to be known in advance. The arbitrage guide explains the paging and the error handling line by line.
Step 3
Find the props, whatever they are called
def player_of(market, o):
"""The player an outcome is about: a prop's subject, or the runner in a try scorer market."""
subject = market["subject"]
if subject and "id" in subject: # a player; a team subject has a key instead
return subject["name"]
if o["side"].startswith("pl_"): # one outcome per player, such as first try scorer
return o["name"]
return None
def collect(event):
"""Every player prop in one event, as (player, market, period) -> line -> side -> {book: price},
plus each book's main line on the over/under props."""
props = defaultdict(lambda: defaultdict(lambda: defaultdict(dict)))
main_lines = defaultdict(dict)
for market in event["markets"]:
for o in market["outcomes"]:
player = player_of(market, o)
if player is None:
continue
key = (player, market["name"], market["period"])
side = "yes" if o["side"].startswith("pl_") else o["side"]
for p in o["prices"]:
if not p.get("available") or not p["decimal_odds"]:
continue
props[key][o["line"]][side][p["bookmaker"]] = p["decimal_odds"]
if o["side"] == "over" and not market["alternate"]:
main_lines[key][p["bookmaker"]] = o["line"]
return props, main_lines
Player markets come in two shapes, and player_of recognises both by structure rather than by name:
- A market about one player, such as anytime try scorer, tries, run metres or tackles. Its
subjectis the player, carrying a playerid(a team subject carries akeyinstead). An anytime market has a single side,yes; an over/under hasoverandunderat aline. - One market with a runner per player, such as first try scorer. It has no subject; instead every outcome stands for one player, with that player's ID in
side.
Matching on shape means the script needs no list of NRL market keys, and the same file reads AFL disposals or NFL receiving yards. If you want the keys anyway, GET /v1/markets?league=nrl lists every market in the sport with a subject of player on the props.
collect files every price under the player, the market, the period and the line, so two books are only ever compared at the same number. It also notes each book's main line (a market with alternate false) for the middle check in step 5.
Step 4
Measure the gap as profit, not cents
def more_profit(best, worst):
"""How much more a winning bet pays at the best price than at the worst."""
return (best - 1) / (worst - 1) - 1
Ten cents means a lot on a 1.50 favourite and little on a 9.00 first try scorer. Comparing what a winning bet earns puts every prop on one scale:
more profit = (best − 1) ÷ (worst − 1) − 1
At 1.90 against 1.85 that is 0.90 ÷ 0.85 − 1 = 6% more on every winning bet, which over a season of props is the difference shopping makes.
Step 5
Find the middles between lines
def middle(lines, main_lines):
"""Over at the lowest main line, under at the highest: the counts that win both, and the odds."""
if len(set(main_lines.values())) < 2:
return None
low, high = min(main_lines.values()), max(main_lines.values())
over, under = lines[low].get("over"), lines[high].get("under")
wins = list(range(math.floor(low) + 1, math.ceil(high)))
if not over or not under or not wins:
return None
o_book, u_book = max(over, key=over.get), max(under, key=under.get)
payout = 1 / (1 / over[o_book] + 1 / under[u_book]) # per dollar staked across both bets
pushes = [int(n) for n in (low, high) if n == int(n)] # a whole-number line refunds on its own count
return {"over": (low, over[o_book], o_book), "under": (high, under[u_book], u_book),
"wins": wins, "pushes": pushes, "hit": 2 * payout - 1, "miss": payout - 1}
def counts(wins):
"""[29, 30] -> '29 or 30'; [29, 30, 31] -> '29 to 31'."""
if len(wins) == 1:
return str(wins[0])
return f"{wins[0]} or {wins[1]}" if len(wins) == 2 else f"{wins[0]} to {wins[-1]}"
When books disagree on the number, the over at the lowest line and the under at the highest can both win. With 28.5 at one book and 30.5 at another, a count of 29 or 30 wins both bets; anything else wins one and loses the other. range(floor(low) + 1, ceil(high)) gives exactly those counts, and it handles whole-number lines too: over 28 and under 30 both win only on 29. A count of exactly 28 or 30 pushes one bet, which returns its stake, while the other wins.
The stakes are split so that a single win pays the same either way (the same split as an arbitrage), which makes the outcome two numbers:
payout = 1 ÷ (1/over price + 1/under price)
- If it lands: both bets win, 2 × payout − 1 on the total staked.
- If not: one bet wins and the other loses, payout − 1, a small loss when the two prices add up to more than 100%. On whole-number lines a count exactly on a line pushes that bet, which returns its stake, while the other wins: a smaller profit than a hit.
Whether a middle is worth it depends on how often the count lands in the window, which the script does not guess. It shows the window and both numbers, and leaves that call to you.
Step 6
Print the shopping list
def report(event, props, main_lines):
print(event["name"])
for key, lines in sorted(props.items()):
player, market, period = key
print(f" {player}, {market}" + ("" if period == "full" else f" ({period})"))
for line in sorted(lines, key=lambda n: -1 if n is None else n):
for side, prices in sorted(lines[line].items()):
book = max(prices, key=prices.get)
number = "" if line is None else f"{line:g}"
text = f" {side:<5} {number:<5} {prices[book]:>5.2f} {book}"
if len(prices) > 1:
worst = min(prices.values())
gain = more_profit(prices[book], worst)
text += f" ({len(prices)} books: {gain:.0%} more profit than {worst:.2f})"
print(text)
m = middle(lines, main_lines[key])
if m:
(low, o_price, o_book), (high, u_price, u_book) = m["over"], m["under"]
print(f" middle: over {low:g} at {o_book} ({o_price:.2f}) and under {high:g} at {u_book} "
f"({u_price:.2f}) both win on {counts(m['wins'])}: {m['hit']:+.0%} if it lands, "
f"{m['miss']:+.1%} if not" + (f"; on {counts(m['pushes'])} one bet pushes and the "
"other wins" if m["pushes"] else ""))
def main(league="nrl"):
events = fetch_events(league)
for event in events:
props, main_lines = collect(event)
if props:
report(event, props, main_lines)
print(f"{league.upper()} games checked: {len(events)}. Books: {', '.join(BOOKS)}")
One block per player and market: each line and side with the best price and the book offering it, how many of your books quote that exact number, and how much more the best of them pays than the worst. A middle, if there is one, closes the block.
The whole file
prop_shop.py
Save it, install requests, set your key and run it. A second argument swaps the books for one run:
python3 -m pip install requests
export SOCKODDS_KEY="paste-your-key-here"
python3 prop_shop.py
python3 prop_shop.py nrl sportsbet,tab,neds
"""NRL player-prop line shopping: every player prop at the books you bet with, side by side.
export SOCKODDS_KEY="your-key"
python prop_shop.py # NRL at the books in BOOKS
python prop_shop.py afl # another league
python prop_shop.py nrl sportsbet,tab,neds # other books for this run
A price can be minutes old: check it at the bookmaker before betting.
"""
import math
import os
import sys
import time
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from urllib.parse import urljoin
import requests
API = "https://api.sockodds.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SOCKODDS_KEY']}"}
# Books you hold an account with. Every plan reads each listed book but bet365.
BOOKS = ["sportsbet", "tab", "ladbrokes"]
# The coming round. Each game returned is one object, plus one for every price it carries.
LOOKAHEAD = timedelta(days=7)
# True asks for every line each book offers, so more books meet at the same number.
ALTERNATES = False
def get(url, params=None):
"""GET with the key. Waits when the API says to (over the per-minute limit, or briefly
busy); stops with the API's own reason on any other refusal, a used-up month included."""
for _ in range(5):
r = requests.get(url, params=params, headers=HEADERS, timeout=30)
problem = r.json() if "problem+json" in r.headers.get("content-type", "") else {}
if r.status_code in (429, 503) and problem.get("title") != "Monthly allowance reached":
time.sleep(max(1.0, float(r.headers.get("retry-after", 60))))
continue
if r.status_code >= 500:
r.raise_for_status() # a server error: the caller decides whether to try again
if problem:
raise SystemExit(f'{problem["status"]} {problem["title"]}: {problem["detail"]}')
if r.status_code != 200 or "json" not in r.headers.get("content-type", ""):
raise SystemExit(f"{r.status_code} from {r.url}: not a JSON answer from the API")
return r.json()
raise SystemExit(f"{url}: still asked to wait after five tries")
def every(url, params):
"""Every item of a listing, following links.next (which may be relative) across pages."""
while url:
page = get(url, params)
yield from page["data"]
url, params = (urljoin(url, page["links"]["next"]) if page["links"]["next"] else None), None
def fetch_events(league):
"""Every game in the window with every market at your books, across all pages."""
now = datetime.now(timezone.utc)
params = {
"league": league,
"bookmakers": ",".join(BOOKS),
"starts_after": now.strftime("%Y-%m-%dT%H:%M:%SZ"),
"starts_before": (now + LOOKAHEAD).strftime("%Y-%m-%dT%H:%M:%SZ"),
}
if ALTERNATES:
params["alternates"] = "true"
return list(every(f"{API}/odds", params))
def player_of(market, o):
"""The player an outcome is about: a prop's subject, or the runner in a try scorer market."""
subject = market["subject"]
if subject and "id" in subject: # a player; a team subject has a key instead
return subject["name"]
if o["side"].startswith("pl_"): # one outcome per player, such as first try scorer
return o["name"]
return None
def collect(event):
"""Every player prop in one event, as (player, market, period) -> line -> side -> {book: price},
plus each book's main line on the over/under props."""
props = defaultdict(lambda: defaultdict(lambda: defaultdict(dict)))
main_lines = defaultdict(dict)
for market in event["markets"]:
for o in market["outcomes"]:
player = player_of(market, o)
if player is None:
continue
key = (player, market["name"], market["period"])
side = "yes" if o["side"].startswith("pl_") else o["side"]
for p in o["prices"]:
if not p.get("available") or not p["decimal_odds"]:
continue
props[key][o["line"]][side][p["bookmaker"]] = p["decimal_odds"]
if o["side"] == "over" and not market["alternate"]:
main_lines[key][p["bookmaker"]] = o["line"]
return props, main_lines
def more_profit(best, worst):
"""How much more a winning bet pays at the best price than at the worst."""
return (best - 1) / (worst - 1) - 1
def middle(lines, main_lines):
"""Over at the lowest main line, under at the highest: the counts that win both, and the odds."""
if len(set(main_lines.values())) < 2:
return None
low, high = min(main_lines.values()), max(main_lines.values())
over, under = lines[low].get("over"), lines[high].get("under")
wins = list(range(math.floor(low) + 1, math.ceil(high)))
if not over or not under or not wins:
return None
o_book, u_book = max(over, key=over.get), max(under, key=under.get)
payout = 1 / (1 / over[o_book] + 1 / under[u_book]) # per dollar staked across both bets
pushes = [int(n) for n in (low, high) if n == int(n)] # a whole-number line refunds on its own count
return {"over": (low, over[o_book], o_book), "under": (high, under[u_book], u_book),
"wins": wins, "pushes": pushes, "hit": 2 * payout - 1, "miss": payout - 1}
def counts(wins):
"""[29, 30] -> '29 or 30'; [29, 30, 31] -> '29 to 31'."""
if len(wins) == 1:
return str(wins[0])
return f"{wins[0]} or {wins[1]}" if len(wins) == 2 else f"{wins[0]} to {wins[-1]}"
def report(event, props, main_lines):
print(event["name"])
for key, lines in sorted(props.items()):
player, market, period = key
print(f" {player}, {market}" + ("" if period == "full" else f" ({period})"))
for line in sorted(lines, key=lambda n: -1 if n is None else n):
for side, prices in sorted(lines[line].items()):
book = max(prices, key=prices.get)
number = "" if line is None else f"{line:g}"
text = f" {side:<5} {number:<5} {prices[book]:>5.2f} {book}"
if len(prices) > 1:
worst = min(prices.values())
gain = more_profit(prices[book], worst)
text += f" ({len(prices)} books: {gain:.0%} more profit than {worst:.2f})"
print(text)
m = middle(lines, main_lines[key])
if m:
(low, o_price, o_book), (high, u_price, u_book) = m["over"], m["under"]
print(f" middle: over {low:g} at {o_book} ({o_price:.2f}) and under {high:g} at {u_book} "
f"({u_price:.2f}) both win on {counts(m['wins'])}: {m['hit']:+.0%} if it lands, "
f"{m['miss']:+.1%} if not" + (f"; on {counts(m['pushes'])} one bet pushes and the "
"other wins" if m["pushes"] else ""))
def main(league="nrl"):
events = fetch_events(league)
for event in events:
props, main_lines = collect(event)
if props:
report(event, props, main_lines)
print(f"{league.upper()} games checked: {len(events)}. Books: {', '.join(BOOKS)}")
if __name__ == "__main__":
if len(sys.argv) > 2:
BOOKS = sys.argv[2].split(",")
main(sys.argv[1] if len(sys.argv) > 1 else "nrl")
This file and its tests are going into a public repository; the link goes here when it exists. Until then, the file above is the one the tests run.
A run
What it prints
Run on 13 Oct 2026 against the v1 schema mock. Its only fixture is an AFL game with made-up prices, so this run uses afl and the mock's four books to show every part of the report. It shows the output's shape, not real prices.
Carlton v Richmond
Patrick Cripps, Player disposals over/under
over 28.5 1.90 pinnacle (3 books: 6% more profit than 1.85)
under 28.5 1.90 pinnacle (3 books: 6% more profit than 1.85)
over 30.5 1.80 tab
under 30.5 1.95 tab
middle: over 28.5 at pinnacle (1.90) and under 30.5 at tab (1.95) both win on 29 or 30: +92% if it lands, -3.8% if not
AFL games checked: 1. Books: sportsbet, tab, pinnacle, kalshi
Reading it
Where the numbers come from
Three books hang Patrick Cripps's disposals at 28.5 and TAB at 30.5, so 28.5 is compared across three books and 30.5 stands alone. At 28.5 the best over pays 6% more profit than the worst.
1/1.90 + 1/1.95 = 52.63% + 51.28% = 103.92%
Each dollar across the middle pays back 1 ÷ 1.0392 = 96.2 cents when one side wins, a 3.8% loss, and twice that, $1.92, when 29 or 30 lands. On $100 the split is $50.65 on the over and $49.35 on the under.
NRL notes
Team lists, late outs and timing
- Teams change until close to kick-off. Squads are named early in the week and can change until about an hour before the game, and prop lines move when they do. Run the script again after the final teams are in.
- A player who does not play is usually a void bet on their props, but each book sets its own rule, and some markets settle differently. Read the terms of the market you bet.
- First try scorer prices are long, so a small difference in price is a large difference in profit. They are where the profit measure in step 4 earns its place.
Changing it
Other leagues, books and lines
- Another league:
python3 prop_shop.py aflfor disposals and goals,nflfor yards and touchdowns,mlbfor hits. Nothing else changes. - More books: add keys to
BOOKS, or pass them for one run. The bookmakers page lists every key and which plan includes it. - Alternate lines: set
ALTERNATES = True. More books then meet at the same numbers, so more of the report is a straight price comparison. Middles stay on main lines, where each book's own number is.
The limits, said plainly.
- A price can be up to ten minutes old before it is withheld, so it can have moved by the time you reach the bookmaker. Check it there before betting.
- Comparing different lines needs a view on how often each count happens; the script compares prices only at the same number, and middles only where the window is clear.
- Bookmakers can limit accounts and set their own settlement rules. Fast Odds API supplies data only; whether and how you bet is your call.
Which NRL props does it cover?
Every market whose subject is a player, such as anytime try scorer, tries, run metres or tackles wherever the books price them, plus runner markets such as first try scorer, where each outcome is a player. GET /v1/markets?league=nrl lists the keys.
Why not just take the highest price?
At the same line, do exactly that; the script shows it first. Across different lines a higher price can be a worse bet, because the line moved against you, so the script never ranks 28.5 against 30.5 on price alone.
How much quota does a run use?
Every plan counts credits, as SockOdds's pricing page reads on 18 November 2026. A league's featured markets cost one credit each for every page of up to 25 games, but props are other markets, counted once for each game: each prop market a game returns, times the regions billed, and three named books bill one region. So a run's cost follows the props the round carries; read x-credits-last on a test run before you schedule it. The free plan's 1,000 credits a month are for building and testing; checking every round after team lists belongs on Starter, with 30,000, or above.
Can it tell me when a prop moves?
Not by itself; it reads once and prints. The Discord bot guide builds a loop that posts moves to a channel, and a prop's market key can be added to it.
Start now
Your first Australian price is one request away.
Free key, no card, AFL and NRL included. Keys are issued on sockodds.com.