Python SDK for the PropLine player props betting odds API
Project description
PropLine Python SDK
Official Python client for the PropLine player props API — real-time betting odds for MLB, NBA, NHL, and NFL.
Installation
pip install propline
Quick Start
from propline import PropLine
client = PropLine("your_api_key")
# List available sports
sports = client.get_sports()
# [{"key": "baseball_mlb", "title": "MLB", "active": True}, ...]
# Get today's NBA games
events = client.get_events("basketball_nba")
for event in events:
print(f"{event['away_team']} @ {event['home_team']}")
# Get player props for a game
odds = client.get_odds("basketball_nba", event_id=events[0]["id"],
markets=["player_points", "player_rebounds", "player_assists"])
for bookmaker in odds["bookmakers"]:
for market in bookmaker["markets"]:
for outcome in market["outcomes"]:
print(f"{outcome['description']} {outcome['name']} "
f"{outcome['point']} @ {outcome['price']}")
Get Your API Key
- Go to prop-line.com
- Enter your email
- Get your API key instantly — 500 requests/day, no credit card required
Available Sports
| Key | Sport |
|---|---|
baseball_mlb |
MLB |
basketball_nba |
NBA |
hockey_nhl |
NHL |
football_nfl |
NFL |
Available Markets
MLB
pitcher_strikeouts, pitcher_earned_runs, pitcher_hits_allowed, batter_hits, batter_home_runs, batter_rbis, batter_total_bases, batter_stolen_bases, batter_walks, batter_singles, batter_doubles, batter_runs
NBA
player_points, player_rebounds, player_assists, player_threes, player_points_rebounds_assists, player_double_double
NHL
player_goals, player_shots_on_goal, goalie_saves, player_blocked_shots
Game Lines (all sports)
h2h, spreads, totals
Examples
Get MLB pitcher strikeout props
from propline import PropLine
client = PropLine("your_api_key")
events = client.get_events("baseball_mlb")
for event in events:
odds = client.get_odds("baseball_mlb", event_id=event["id"],
markets=["pitcher_strikeouts"])
print(f"\n{event['away_team']} @ {event['home_team']}")
for bk in odds["bookmakers"]:
for mkt in bk["markets"]:
for o in mkt["outcomes"]:
if o["point"]:
print(f" {o['description']} {o['name']} {o['point']}: {o['price']}")
Get historical line movement (Pro only)
history = client.get_odds_history("baseball_mlb", event_id=16,
markets=["pitcher_strikeouts"])
for market in history["markets"]:
for outcome in market["outcomes"]:
print(f"\n{outcome['description']}:")
for snap in outcome["snapshots"]:
print(f" {snap['recorded_at']}: {snap['price']} @ {snap['point']}")
Error Handling
from propline import PropLine, AuthError, RateLimitError, PropLineError
client = PropLine("your_api_key")
try:
odds = client.get_odds("baseball_mlb", event_id=1)
except AuthError:
print("Invalid API key")
except RateLimitError:
print("Daily limit exceeded — upgrade at prop-line.com/#pricing")
except PropLineError as e:
print(f"API error: {e.status_code} — {e.detail}")
Links
- Website: prop-line.com
- API Docs: prop-line.com/docs
- Dashboard: prop-line.com/dashboard
- API Reference: api.prop-line.com/docs
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file propline-0.1.0.tar.gz.
File metadata
- Download URL: propline-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ddc1fac48266e7bf388f725cd5af2ed818c12f1acf21897841c5443aeade3b
|
|
| MD5 |
2c8bbf7141408b1478a45f54f293d03b
|
|
| BLAKE2b-256 |
22a1c3db0997fb46f71ce33fd1e2422050c046b005a808bf6d823a6a72428f4d
|
File details
Details for the file propline-0.1.0-py3-none-any.whl.
File metadata
- Download URL: propline-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a0828fab12f9f83314c2594635ad1e18cecf440a847a37dca2918c7e7bef139
|
|
| MD5 |
1c63d79136e73c9fbec503bb5f578308
|
|
| BLAKE2b-256 |
de48cef219b197247f1ae5a2ea487e9ac3834e4b9aca3920e31b4cdfbe235682
|