Metadata-Version: 2.4
Name: propzapi
Version: 0.1.0
Summary: Python client for propzapi, the props-first sports odds API. Player props, odds, fixtures and live scores as clean JSON.
Author-email: Paper and Beyond <support@propzapi.com>
License: MIT
Project-URL: Homepage, https://propzapi.com
Project-URL: Documentation, https://propzapi.com/docs
Project-URL: Source, https://github.com/paperandbeyond23-gif/propzapi
Project-URL: Changelog, https://github.com/paperandbeyond23-gif/propzapi/releases
Keywords: sports odds,player props,odds api,sports betting data,draftkings,fanduel,nfl,nba,mlb,sportsbook
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25
Dynamic: license-file

# propzapi

Python client for [propzapi](https://propzapi.com), the props-first sports odds API.

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

```bash
pip install propzapi
```

## Get a key

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

```python
from propzapi import register

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

## Quickstart

```python
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.

```python
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:

```python
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:

```python
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

- [Docs](https://propzapi.com/docs)
- [Build an NFL player props model](https://propzapi.com/blog/props-api-nfl-player-props-model)
- [Odds API vs web scraping](https://propzapi.com/blog/odds-api-vs-web-scraping)

## License

MIT
