Skip to main content

EndzoneAPI for Python

Python client for the EndzoneAPI NFL data API. It has no required dependencies (standard library only) and works on Python 3.9 and newer. Pandas is optional.

Install

pip install endzoneapi
pip install "endzoneapi[pandas]"   # only if you want DataFrames

Set your key

Get a free key at https://endzoneapi.com/signup. Free accounts get 500 credits a month.

export ENDZONEAPI_API_KEY=your_key_here
from endzoneapi import Client

client = Client()                      # reads ENDZONEAPI_API_KEY
client = Client(api_key="your_key")    # or pass it in

Examples

1. Player props for one game

get_player_props returns every player's line, by sportsbook, for one market. Pass estimate_only=True first to see the credit cost without being charged.

from endzoneapi import Client, to_dataframe

client = Client()

print(client.get_player_props(game_id="2025_01_KC_LAC", estimate_only=True))

props = client.get_player_props(
    game_id="2025_01_KC_LAC",
    market="player_pass_yds",
    bookmaker="draftkings",
)
df = to_dataframe(props, key="props")
print(df[["player_name", "line", "over_odds", "under_odds"]])

2. Props for every game in a week

Loop over a week of games and stack the results. This is the usual shape of a props model's data pull.

import pandas as pd
from endzoneapi import Client, to_dataframe

client = Client()

games = client.get_games(season=2025, week=1, limit=2)["games"]
frames = []
for game in games:
    props = client.get_player_props(game_id=game["game_id"], market="player_rush_yds")
    frames.append(to_dataframe(props, key="props"))
week = pd.concat(frames, ignore_index=True)
print(len(week), "lines from", len(games), "games")
print(week.groupby("bookmaker").size())

3. Find a player, then pull his stats

Player ids are GSIS ids. search_players finds them by name.

from endzoneapi import Client

client = Client()

mahomes = client.search_players("Mahomes", limit=1)["players"][0]
stats = client.get_player_stats(mahomes["player_id"], season=2025)
print(mahomes["name"], mahomes["team"])
print(stats)

Credits

Every method returns the data object from the response. After each call, client.last_credits_used and client.last_credits_remaining hold the counters from the X-Credits-Used and X-Credits-Remaining headers. Methods that take estimate_only=True return the price of a call without running or charging it.

Pandas

from endzoneapi import to_dataframe

df = to_dataframe(data)                # finds the main list in the response
df = to_dataframe(data, key="rows")    # or name the list yourself

Nested fields become dotted columns. Install pandas separately or with pip install "endzoneapi[pandas]".

Errors

Every error is an APIError subclass, with the server's message and the HTTP status.

Exception Status Meaning
AuthError 401 Missing, invalid or revoked key
InsufficientCreditsError 402 Not enough credits for the call
NotFoundError 404 The id or name does not exist
RateLimitError 429 Too many requests; has .retry_after when the server sends it
APIError 400, 5xx Bad arguments or a server problem
APIConnectionError none No response (network or timeout)
from endzoneapi import Client, APIError, InsufficientCreditsError, RateLimitError

client = Client()
try:
    data = client.list_teams()
except InsufficientCreditsError:
    print("Out of credits, top up at https://endzoneapi.com")
except RateLimitError as exc:
    print("Slow down, retry after", exc.retry_after)
except APIError as exc:
    print(exc.status_code, exc.message)

The client retries 429 and 5xx responses and connection failures up to 3 times with backoff, and honors Retry-After. Set Client(max_retries=0) to turn that off.

If you see CERTIFICATE_VERIFY_FAILED on a python.org install for macOS, run the "Install Certificates.command" script that came with Python, or pip install certifi (the client uses it when present).

Options

Client(
    api_key=None,                          # defaults to $ENDZONEAPI_API_KEY
    base_url="https://mcp.endzoneapi.com",           # point at another host
    timeout=60.0,                          # seconds per request
    max_retries=3,
)

client.call("tool_name", {"arg": "value"}) calls any tool by name, which helps when the API adds a tool before this package does.

Tools

Method names match the API tool names. Arguments are keyword arguments; required ones can also be passed positionally. Each method's docstring lists its arguments (help(client.list_teams)).

Method Credits What it does
list_teams 1 List teams
get_standings 2 Standings
get_team_stats 5 Team stats
get_games 5 Games
get_schedule 2 Schedule
get_game_detail 10 Game detail
get_head_to_head 10 Head to head
search_players 2 Search players
get_player_stats 5 Player stats
get_player_leaders 5 Player leaders
get_injuries 2 Injuries
get_depth_chart 2 Depth chart
get_snap_counts 5 Snap counts
get_plays 10 Plays
get_advanced_stats 5 Advanced stats
get_odds 10 Odds
get_line_movement 25 Line movement
get_player_props 10 Player props
get_prop_history 10 Prop history
get_alt_lines 10 Alt lines

Full API reference: https://endzoneapi.com/docs

Used by

NoPunt, our NFL predictions site, runs on this API.

License

MIT

Metadata

Release files for endzoneapi 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for endzoneapi 0.1.3
File Size Uploaded Provenance Actions
endzoneapi-0.1.3.tar.gz 16.9 kB With provenance Details for endzoneapi-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for endzoneapi 0.1.3
File Interpreter ABI Platform Actions
endzoneapi-0.1.3-py3-none-any.whl Python 3 none any Details for endzoneapi-0.1.3-py3-none-any.whl

Total release size: 33.0 kB

Release files / endzoneapi-0.1.3.tar.gz

Download URL endzoneapi-0.1.3.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93e2d1575d176abd862f1fd2cc06755afb00aea25bda00692e3244e411a8419e
BLAKE2b-256 checksum
How to use checksums
6a9625e6d8de354d0ff4c2d301524adeeae9013e4b3a5398b3e750798fc46f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / endzoneapi-0.1.3-py3-none-any.whl

Download URL endzoneapi-0.1.3-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64a1eaf663fec635906974f9097d1d7e18e351efeb79f766f1cb932a74e4e6f8
BLAKE2b-256 checksum
How to use checksums
5320410983d0a51c5a7f308617fe26fa0dc1a8ee0c087356777866c7fd94fb70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for endzoneapi 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for endzoneapi-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page