Historical closing lines for NFL player props in Python
Pull a receiver's prop closing lines against his results, see how a line moved before kickoff, then measure how often a kind of prop hit, with its sample and interval.
Every script run against the live API on December 4, 2026. One full run: 107 credits.
A closing line is the last number a sportsbook posted before kickoff. For a player prop it is the market's final read on what a player would do in that game, which makes it the benchmark for any question about how props have behaved. This tutorial pulls those lines for NFL players with the EndzoneAPI Python client and measures them, using receiving yards as the example.
It has four parts. First, one receiver's closing line against what he gained, game by game. Second, how that line moved from its opening to the close in one game. Third, the fair probability across books, which takes each book's margin out of its prices. Fourth, get_prop_backtest, which answers a question about a whole kind of prop, here receiving yards overs for wide receivers on road underdogs, without pulling every row, and returns the sample size, a 95% interval and a split by season.
Everything on this page describes past games. A past hit rate is not a forecast, and nothing here is a recommendation about any wager. Prop lines are held from the 2023 season.
One full run costs 107 credits: 2 for the player search, 10 each for the history, movement and probability calls, and 75 for three backtests at 25. The free 500 credits a month cover four full runs (428 credits). With one backtest instead of three a run is 57 credits, and the free credits cover eight of those.
1. Install the client and set your key
The client has no required dependencies. This tutorial uses pandas for tables and matplotlib for the chart. The client reads your key from ENDZONEAPI_API_KEY. It needs Python 3.9 or newer.
pip install "endzoneapi[pandas]" matplotlib
export ENDZONEAPI_API_KEY=your_key_here2. Pull a player's closing lines against his results
search_players turns a name into the GSIS id every prop tool takes. get_prop_history then returns one row per game for one market: the closing line (the median across books), the opening line (the first capture; the same as the close where only one was taken), the price on each side, how many books are in the number, what the player actually recorded from our box scores, and whether he went over or under.
The call below asks for Ja'Marr Chase's 2025 regular season in receiving yards (player_reception_yds). History is priced at 10 credits for every 25 games a call covers, so limit=25 keeps it at 10. The script also adds move, the closing line minus the opening line.
from endzoneapi import Client, to_dataframe
client = Client() # reads ENDZONEAPI_API_KEY
player = client.search_players("Ja'Marr Chase", active=True)["players"][0]
print(player["player_id"], player["name"], player["position"], player["team"])
history = client.get_prop_history(
player["player_id"],
"player_reception_yds",
from_date="2025-09-01",
to_date="2026-02-28",
limit=25,
)
games = to_dataframe(history, key="games")
games["move"] = games["line"] - games["open_line"]
games.to_csv("chase_receiving_yards.csv", index=False)
print(history["summary"])
print(games[["game_id", "open_line", "line", "move", "actual", "result"]].to_string(index=False))
print("credits left:", client.last_credits_remaining)Output
00-0036900 Ja'Marr Chase WR CIN
{'games': 16, 'graded': 16, 'overs': 10, 'unders': 6, 'pushes': 0, 'over_rate': 0.625, 'avg_line': 82, 'avg_actual': 88.3}
game_id open_line line move actual result
2025_01_CIN_CLE 85.5 85.5 0.0 26 under
2025_02_JAX_CIN 86.5 84.5 -2.0 165 over
2025_03_CIN_MIN 69.5 72.5 3.0 50 under
2025_04_CIN_DEN 64.5 68.5 4.0 23 under
2025_05_DET_CIN 65.5 65.5 0.0 110 over
2025_06_CIN_GB 63.5 65.5 2.0 94 over
2025_07_PIT_CIN 71.5 74.5 3.0 161 over
2025_08_NYJ_CIN 87.5 87.5 0.0 91 over
2025_09_CHI_CIN 90.5 90.5 0.0 111 over
2025_11_CIN_PIT 94.5 94.5 0.0 30 under
2025_13_CIN_BAL 93.5 92.5 -1.0 110 over
2025_14_CIN_BUF 87.5 86.5 -1.0 44 under
2025_15_BAL_CIN 91.5 88.5 -3.0 132 over
2025_16_CIN_MIA 87.5 87.5 0.0 109 over
2025_17_ARI_CIN 85.5 87.5 2.0 60 under
2025_18_CLE_CIN 81.5 80.5 -1.0 96 over
credits left: 507| Column | Meaning |
|---|---|
| open_line, line | The first and the closing line, each the median across books |
| move | line minus open_line, added by the script |
| actual | Receiving yards he recorded in the game |
| result | over or under the closing line; a game that lands on a whole-number line is a push, left out of the rate |
| books | Books in the closing line (5 to 7 here); over_odds and under_odds are the prices |
He went over in 10 of 16 games (62.5%) with an average closing line of 82 and an average of 88.3 yards. That is 16 games: a player's own history is too short to say anything about a pattern, and splitting it by whether the line moved up (5 games), down (5) or stayed put (6) leaves groups too small to read. The fourth step is for questions that need hundreds of games.
The largest move was 2025_04_CIN_DEN: the line opened at 64.5 and closed at 68.5. The next step looks at it.
3. See how the line moved before kickoff
get_prop_movement returns every capture we hold for one player in one game, book by book and oldest first, with the line, both prices and the minutes before the scheduled start. line_change is the last capture's line minus the first. The script picks the game with the largest move from the file in the last step, summarises each book, then prints one book's full timeline.
import pandas as pd
from endzoneapi import Client
client = Client()
PLAYER_ID = "00-0036900" # Ja'Marr Chase, from search_players
games = pd.read_csv("chase_receiving_yards.csv")
big = games.loc[games["move"].abs().idxmax()]
print("largest move:", big["game_id"], "opened", big["open_line"], "closed", big["line"])
movement = client.get_prop_movement(str(big["game_id"]), PLAYER_ID, "player_reception_yds")
rows = []
for book in movement["books"]:
snaps = book["snapshots"]
rows.append({
"bookmaker": book["bookmaker"],
"captures": len(snaps),
"first_line": snaps[0]["line"],
"last_line": snaps[-1]["line"],
"change": book["line_change"],
"first_min_before": snaps[0]["minutes_before_scheduled_start"],
"last_min_before": snaps[-1]["minutes_before_scheduled_start"],
})
print(pd.DataFrame(rows).to_string(index=False))
one = next(b for b in movement["books"] if b["bookmaker"] == "betonlineag")
print(pd.DataFrame(one["snapshots"])[["minutes_before_scheduled_start", "line", "over_odds", "under_odds"]].to_string(index=False))
print("credits left:", client.last_credits_remaining)Output
largest move: 2025_04_CIN_DEN opened 64.5 closed 68.5
bookmaker captures first_line last_line change first_min_before last_min_before
betmgm 7 66.5 65.5 -1 2879.4 119.4
betonlineag 7 64.5 68.5 4 2879.4 119.4
bovada 2 67.5 67.5 0 140.9 119.4
draftkings 7 64.5 68.5 4 2879.4 119.4
espnbet 7 64.5 68.5 4 2879.4 119.4
fanduel 7 63.5 68.5 5 2879.4 119.4
pinnacle 7 64.5 67.5 3 2879.4 119.4
minutes_before_scheduled_start line over_odds under_odds
2879.4 64.5 -114 -114
1439.4 64.5 -114 -114
740.6 64.5 -114 -114
500.9 64.5 -118 -110
359.4 66.5 -115 -112
140.9 68.5 -115 -112
119.4 68.5 -115 -112
credits left: 497The opening and closing lines in the history table are the median of these books' first and last lines: 64.5 and 68.5. Five of the seven books moved up by 3 to 5 points. One moved the other way (BetMGM, 66.5 to 65.5), and Bovada has two captures only, in the last 141 minutes, so it has no opening line in the usual sense. The number of captures varies by game and book, so check captures before treating a first line as an open.
The timeline shows the shape for one book: 64.5 from 48 hours out until about 8 hours before the game, 66.5 at about 6 hours, then 68.5 at 141 minutes.
4. Read the fair probability across books
A book's price carries its margin: the over and under implied probabilities add to more than 1. get_prop_probabilities combines the books into one number per line. avg_implied_prob averages each book's implied probability, margin included. fair_prob takes the margin out of each book's two prices first, then averages, so the two sides add to 1. Only identical lines are combined, and books_used says how many books each number rests on. It serves the latest pre-game prices, which for a played game are the closing ones.
import pandas as pd
from endzoneapi import Client
client = Client()
PLAYER_ID = "00-0036900"
GAME_ID = "2025_04_CIN_DEN" # the game with the largest move, from the last step
probs = client.get_prop_probabilities(GAME_ID, market="player_reception_yds", player_id=PLAYER_ID)
prop = probs["props"][0]
print(prop["player_name"], prop["label"], "consensus line", prop["consensus_line"])
rows = [
{
"line": x["line"],
"books": x["books_used"],
"over_implied": x["over"]["avg_implied_prob"],
"over_fair": x["over"]["fair_prob"],
"under_implied": x["under"]["avg_implied_prob"],
"under_fair": x["under"]["fair_prob"],
}
for x in prop["lines"]
]
print(pd.DataFrame(rows).to_string(index=False))
print("credits left:", client.last_credits_remaining)Output
Ja'Marr Chase receiving yards consensus line 68.5
line books over_implied over_fair under_implied under_fair
68.5 4 0.534 0.503 0.528 0.497
67.5 2 0.540 0.510 0.518 0.490
65.5 1 0.541 0.503 0.535 0.497
credits left: 487At the 68.5 line, 4 books put the fair probability of the over at 0.503 and the under at 0.497. The implied figures, 0.534 and 0.528, add to 1.062: the extra 0.062 is the books' margin, which the fair figures remove. The other two lines each rest on fewer books (2 and 1), so they are those books' views, not a consensus.
5. Measure a whole kind of prop with get_prop_backtest
get_prop_backtest answers "how often did this kind of prop go over" without pulling every row. It takes a market and a side, and any of: seasons, weeks, position, team, opponent, home_away, team_role (the player's team as favorite or underdog by the consensus closing spread) and bounds on the closing line or the fair probability. It returns one result per player per game at the median closing line: the hit rate, its 95% interval, the average fair probability the market implied, and each season on its own. Each call is 25 credits.
The script runs three cuts of receiving yards overs: wide receivers on road underdogs, all wide receivers as the baseline, and road-underdog wide receivers with a closing line of 50 or more, a narrower cut. Read the sample size and the interval before the hit rate.
import json
import time
import pandas as pd
from endzoneapi import Client
client = Client()
cuts = {
"WR over, road underdogs": dict(position="WR", home_away="away", team_role="underdog"),
"WR over, all games": dict(position="WR"),
"WR over, road underdogs, line 50+": dict(position="WR", home_away="away", team_role="underdog", line_min=50),
}
out = {}
for name, filters in cuts.items():
out[name] = client.get_prop_backtest("player_reception_yds", side="over", **filters)
time.sleep(1.1) # the limit is 60 requests a minute
json.dump(out, open("backtests.json", "w"))
rows = []
for name, r in out.items():
lo, hi = r["hit_rate_interval_95"]
rows.append({
"cut": name, "n": r["results"], "hits": r["hits"], "hit_rate": r["hit_rate"],
"interval_95": f"{lo:.3f} to {hi:.3f}", "fair_prob": r["avg_fair_prob"],
"games": r["games"], "players": r["players"],
})
print(pd.DataFrame(rows).to_string(index=False))
seasons = {name: pd.DataFrame(r["by_season"]).set_index("season") for name, r in out.items()}
first = list(out)[0]
print(first)
print(seasons[first][["results", "hits", "hit_rate", "avg_fair_prob"]].to_string())
print("all games")
print(seasons["WR over, all games"][["results", "hits", "hit_rate", "avg_fair_prob"]].to_string())
print("credits left:", client.last_credits_remaining)Output
cut n hits hit_rate interval_95 fair_prob games players
WR over, road underdogs 1882 871 0.463 0.440 to 0.485 0.501 611 257
WR over, all games 6318 3103 0.491 0.479 to 0.503 0.501 1032 292
WR over, road underdogs, line 50+ 479 218 0.455 0.411 to 0.500 0.503 397 71
WR over, road underdogs
results hits hit_rate avg_fair_prob
season
2023 522 243 0.466 0.500
2024 520 248 0.477 0.502
2025 503 213 0.423 0.502
2026 337 167 0.496 0.500
all games
results hits hit_rate avg_fair_prob
season
2023 1685 832 0.494 0.501
2024 1716 846 0.493 0.502
2025 1797 863 0.480 0.502
2026 1120 562 0.502 0.500
credits left: 337What the numbers say, for 2023 through the current 2026 season:
- Road underdogs. Wide receivers on road underdogs went over in 871 of 1,882 results (46.3%), 95% interval 44.0% to 48.5%, across 611 games and 257 players. The average fair probability of the over at the close was 50.1%, outside that interval.
- Baseline. All wide receivers went over in 3,103 of 6,318 (49.1%), interval 47.9% to 50.3%, which contains the 50.1% fair probability. So the market's closing lines were close to level across the whole group, and the road-underdog cut sat below it.
- A narrower cut. With a closing line of 50 or more, the road-underdog result was 218 of 479 (45.5%), interval 41.1% to 50.0%. The interval is wider because the sample is a quarter of the size, and its top, 50.0%, is just under the 50.3% fair probability.
- By season. The road-underdog rate was 46.6% (522 results), 47.7% (520), 42.3% (503) and 49.6% (337, 2026 so far). It was below 50% in three seasons and at 50% in the fourth. At 500 results a single season's own interval runs roughly 4 points either side, so no one season settles anything.
How to read this: results from the same game share conditions, so the interval is a rough guide, not a precise one. Three cuts were run here, and the more filters you try, the more likely one looks unusual by chance, which is why the by-season split and the interval come with every result. A hit rate describes what happened. It is not a forecast of the next game, and it is not a recommendation.
6. Chart the hit rate by season
The by-season split is the quickest check on whether a result is one bad year or a pattern. The script reads the file the last step saved, so it costs no credits.
import json
import matplotlib.pyplot as plt
import pandas as pd
out = json.load(open("backtests.json"))
road = pd.DataFrame(out["WR over, road underdogs"]["by_season"]).set_index("season")
every = pd.DataFrame(out["WR over, all games"]["by_season"]).set_index("season")
chart = pd.DataFrame({
"Road underdogs": road["hit_rate"],
"All games": every["hit_rate"],
"Fair probability": road["avg_fair_prob"],
})
ax = chart.plot(kind="bar", figsize=(9, 4), ylim=(0.35, 0.55))
ax.set_ylabel("Share of receiving yards overs that hit")
ax.set_xlabel("Season")
plt.tight_layout()
plt.savefig("wr_overs_by_season.png", dpi=150)
print(chart.round(3).to_string())Output
Road underdogs All games Fair probability
season
2023 0.466 0.494 0.500
2024 0.477 0.493 0.502
2025 0.423 0.480 0.502
2026 0.496 0.502 0.500- Road underdogs
- All games
- Fair probability
From the backtests above: 1,882 road-underdog results and 6,318 across all games, 2023 to 2026. The 2026 season is not finished. The fair probability is the market's own at the close.
The road-underdog bars sit below the other two in 2023, 2024 and 2025 and level with them in 2026. Change the filters in the last step to test another kind of prop: a different market such as player_receptions or player_rush_yds, side="under", or team_role="favorite". Keep the sample size and the interval beside every number you report.
Tools and credits
- search_players: 1 call, 2 credits.
- get_prop_history: 1 call, 10 credits (limit=25, one call).
- get_prop_movement: 1 call, 10 credits.
- get_prop_probabilities: 1 call, 10 credits.
- get_prop_backtest: 3 calls, 75 credits.
One full run: 107 credits.
What you can do with the data
You may store these rows, train models and backtest on them, and build products that show your users what you derive. You may not redistribute the rows, or the lines as a raw feed, as a dataset or API of its own. Lines and prices are market information: this guide works out no stake, payout or profit, recommends no wager and links to no sportsbook. A past hit rate is not a forecast.
Details: data timing and rights.
What to do next
Start with 500 free credits every month
No card. pip install endzoneapi, REST or MCP.