Skip to main content

Python client for propzapi, the props-first sports odds API. Player props, odds, fixtures and live scores as clean JSON.

Project description

propzapi

Python client for propzapi, the props-first sports odds API.

Player props, game odds, fixtures and live scores as clean JSON. No scraping, no per-sportsbook parsers.

pip install propzapi

Get a key

Free tier is 500 credits a month, no card. Grab one from propzapi.com/app, or mint one in code:

from propzapi import register

print(register())
# {'api_key': 'pk_live_...', 'plan': 'free', 'credits': 500}

Quickstart

from propzapi import Propzapi

client = Propzapi("pk_live_...")        # or set PROPZAPI_API_KEY

# Player props, the thing most odds APIs cover thinly
props = client.props(league="NFL", market="player_passing_yards")

# Game odds grouped by book
odds = client.odds(league="NBA", market="h2h")

# Fixtures and live scores
games = client.events(league="NBA", status="live")

# What each call cost you
print(client.last_credits_cost)

Player props

Props are the point of this API. Markets are named player_<stat>:

League Markets
NFL player_passing_yards, player_passing_tds, player_rushing_yards, player_receiving_yards, player_receptions
NBA player_points, player_rebounds, player_assists, player_threes
MLB player_strikeouts, player_hits, player_home_runs, player_total_bases
NHL player_shots_on_goal, player_goals, player_saves

Leave market unset to get every prop on the slate.

for event in client.props(league="NBA", market="player_points"):
    for book in event["books"]:
        print(event["home_team"], book["book"], book["markets"])

Methods

Method Returns
client.props(league=, sport=, market=, limit=) list of events with prop lines
client.odds(league=, sport=, market=, limit=) list of events with odds by book
client.events(league=, sport=, status=, limit=) list of fixtures and scores
client.event(event_id) one event with all its lines
client.books() list of sportsbook names
client.account() your plan and credit balance
register() a fresh free key, no auth needed

market on odds() takes h2h, spreads, totals or player_props. Leave it unset for all game markets together.

Credits

propzapi meters by market and returns the exact cost of each call in an X-Credits-Cost header. The client reads it for you:

client.props(league="NFL")
client.last_credits_cost     # what that call actually cost
client.last_response         # the full payload, if you want the rest

Errors

Everything raises PropzapiError, with the status code attached:

from propzapi import Propzapi, PropzapiError

try:
    client.props(league="NFL")
except PropzapiError as e:
    print(e.status)   # 401 bad key, 402 out of credits, 429 rate limited
    print(e.payload)  # decoded body when there is one

Notes

  • Not a sportsbook. propzapi is a data provider and takes no wagers.
  • Bring your own requests.Session if you want retries or connection reuse: Propzapi(key, session=my_session).

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

propzapi-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

propzapi-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file propzapi-0.1.0.tar.gz.

File metadata

  • Download URL: propzapi-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for propzapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5288c2584e8d8d7650b484db9e8d73e5f029a578f3ca3ed39f68c334394a7fe8
MD5 6e746c1532ec06deb8c0b00d4b92a124
BLAKE2b-256 7dcf805d3583e48d01ae6031572e2d4844891bc3db922bae31b9bdd21678afb0

See more details on using hashes here.

File details

Details for the file propzapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: propzapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for propzapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c595f1d46e2cb30fc49f5145cd18e723fca111e87fd40e5bca1ff9d03a4700b
MD5 f72fd89d4a8e8c836e5be64814ddd058
BLAKE2b-256 9f85663ea9cf10f25ec9245d9fe650a9c95ef58787281c73a54ab91f5894969c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page