chickenstats-api
NHL play-by-play, stats, lines and team data, from the same pipeline behind chickenstats.com. ## Quickstart Get a token on your account's API page. The chickenstats library pages for you and returns a Polars frame (or pandas), from 1.9.2 on: python from chickenstats.api import ChickenStats cs = ChickenStats(token=\"<token>\") # or set CHICKENSTATS_API_TOKEN stats = cs.download_season_stats(season=20162017, sessions=\"P\") Or, from 1.9.3, run chickenstats login once and call ChickenStats() with no token. Anything else sends the token as a bearer token and pages with limit and offset: bash curl -H \"Authorization: Bearer $TOKEN\" \\ \"https://api.chickenstats.com/api/v1/chicken_nhl/play_by_play?season=20162017&sessions=P&limit=100\" A script that signs itself in uses OAuth 2.0 at /api/v1/auth/token (password, refresh and device grants). Log in on the website and every Try it out here uses your session. Try it out asks for 100 rows, so the page stays quick. Leave limit out of your own calls and you get 10,000, or your tier's maximum if that's smaller. ## Quotas and errors Metered responses carry X-Quota-Limit, X-Quota-Used and X-Quota-Remaining, so you can watch your monthly allowance before it runs out. | Status | What it means | | ------ | ------------- | | 400 | limit is over your tier's maximum rows per request | | 401 | The token is missing, invalid or expired | | 403 | Your tier doesn't include this data | | 422 | A parameter failed validation | | 429 | You're over your monthly quota, or the rate limit | Every error comes back as {\"detail\": ..., \"request_id\": ...}, and the id is in the X-Request-ID header too. Send it along if you report a problem.
- API version: 0.3.2
- Package version: 0.3.2
Requirements
Python 3.9+
Installation
pip install chickenstats-api
import chickenstats_api
Getting Started
import chickenstats_api
from chickenstats_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.chickenstats.com
# See configuration.py for a list of all supported configuration parameters.
configuration = chickenstats_api.Configuration(
host = "https://api.chickenstats.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with chickenstats_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = chickenstats_api.AuthApi(api_client)
device_approval = chickenstats_api.DeviceApproval() # DeviceApproval |
try:
# Approve a device sign-in
api_response = api_instance.approve_device_sign_in(device_approval)
print("The response of AuthApi->approve_device_sign_in:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthApi->approve_device_sign_in: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.chickenstats.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthApi | approve_device_sign_in | POST /api/v1/auth/device/approve | Approve a device sign-in |
| AuthApi | confirm_recovery | POST /api/v1/auth/recovery/confirm | Confirm a recovery sign-in |
| AuthApi | end_all_sessions | DELETE /api/v1/auth/sessions | Sign out everywhere |
| AuthApi | get_token | POST /api/v1/auth/token | Get a token |
| AuthApi | make_recovery_codes | POST /api/v1/users/me/recovery-codes | Make recovery codes |
| AuthApi | recover_password | POST /api/v1/password-recovery/ | Send a password reset email |
| AuthApi | reset_password | POST /api/v1/reset-password/ | Reset a password |
| AuthApi | revoke_token | POST /api/v1/auth/revoke | Sign out one session |
| AuthApi | set_password | POST /api/v1/set-password/ | Choose a first password |
| AuthApi | start_device_sign_in | POST /api/v1/auth/device | Start a device sign-in |
| AuthApi | use_recovery_code | POST /api/v1/auth/recovery | Sign in with a recovery code |
| AuthApi | verify_email | POST /api/v1/verify-email | Verify an email address |
| AuthApi | whoami | GET /api/v1/auth/whoami | Who a token signs in as |
| ChangesApi | read_changes | GET /api/v1/chicken_nhl/changes | Changes |
| ChangesApi | read_changes_game_ids | GET /api/v1/chicken_nhl/changes/game_ids | Game IDs with changes |
| GamesApi | read_game | GET /api/v1/chicken_nhl/games/{game_id} | One game |
| GamesApi | read_games | GET /api/v1/chicken_nhl/games | Games |
| InferenceApi | read_pred_goal | GET /api/v1/inference/pred_goal | Expected goals (pred_goal) |
| LinesApi | read_game_lines | GET /api/v1/chicken_nhl/lines/game | Line stats by game |
| LinesApi | read_lines_game_ids | GET /api/v1/chicken_nhl/lines/game_ids | Game IDs with line stats |
| LinesApi | read_season_lines | GET /api/v1/chicken_nhl/lines/season | Line stats by season |
| LiveApi | read_live_games | GET /api/v1/live/games | Live games |
| LiveApi | read_live_pbp | GET /api/v1/live/play_by_play | Live play-by-play |
| PlayByPlayApi | read_pbp | GET /api/v1/chicken_nhl/play_by_play | Play-by-play |
| PlayByPlayApi | read_pbp_game_ids | GET /api/v1/chicken_nhl/play_by_play/game_ids | Game IDs with play-by-play |
| PlayByPlayApi | read_pbp_play_ids | GET /api/v1/chicken_nhl/play_by_play/play_ids | Play IDs |
| PlayersApi | read_player | GET /api/v1/chicken_nhl/players/{api_id} | One player |
| PlayersApi | read_players | GET /api/v1/chicken_nhl/players | Players |
| RapmApi | read_rapm | GET /api/v1/chicken_nhl/rapm | RAPM scores |
| RostersApi | read_roster_game_ids | GET /api/v1/chicken_nhl/rosters/game_ids | Game IDs with rosters |
| RostersApi | read_rosters | GET /api/v1/chicken_nhl/rosters | Rosters |
| ShiftsApi | read_shifts | GET /api/v1/chicken_nhl/shifts | Shifts |
| ShiftsApi | read_shifts_game_ids | GET /api/v1/chicken_nhl/shifts/game_ids | Game IDs with shifts |
| StandingsApi | read_standings | GET /api/v1/chicken_nhl/standings | Standings |
| StatsApi | read_game_stats | GET /api/v1/chicken_nhl/stats/game | Skater stats by game |
| StatsApi | read_season_stats | GET /api/v1/chicken_nhl/stats/season | Skater stats by season |
| StatsApi | read_stats_game_ids | GET /api/v1/chicken_nhl/stats/game_ids | Game IDs with skater stats |
| TeamStatsApi | read_game_team_stats | GET /api/v1/chicken_nhl/team_stats/game | Team stats by game |
| TeamStatsApi | read_season_team_stats | GET /api/v1/chicken_nhl/team_stats/season | Team stats by season |
| TeamStatsApi | read_team_stats_game_ids | GET /api/v1/chicken_nhl/team_stats/game_ids | Game IDs with team stats |
| TeamsApi | read_teams | GET /api/v1/chicken_nhl/teams | Teams |
| UsersApi | authenticator_changed | POST /api/v1/users/me/authenticator/changed | Record an authenticator change |
| UsersApi | confirm_email_change | POST /api/v1/users/email/confirm | Confirm an email change |
| UsersApi | create_api_token | POST /api/v1/users/me/tokens | Make an API token |
| UsersApi | delete_sign_in_method | DELETE /api/v1/users/me/sign-in-methods/{provider} | Remove a sign-in method |
| UsersApi | delete_user_me | DELETE /api/v1/users/me | Delete your account |
| UsersApi | list_api_tokens | GET /api/v1/users/me/tokens | Your API tokens |
| UsersApi | read_link_token | POST /api/v1/users/me/sign-in-methods/link-token | Start linking a sign-in method |
| UsersApi | read_newsletter | GET /api/v1/users/me/newsletter | Newsletter preference |
| UsersApi | read_sign_in_methods | GET /api/v1/users/me/sign-in-methods | Your sign-in methods |
| UsersApi | read_usage | GET /api/v1/users/me/usage | Your usage this month |
| UsersApi | read_user_me | GET /api/v1/users/me | Your account |
| UsersApi | request_email_change | POST /api/v1/users/me/email | Change your email |
| UsersApi | resend_verification | POST /api/v1/users/me/resend-verification | Resend the verification email |
| UsersApi | revoke_all_api_tokens | DELETE /api/v1/users/me/tokens | Revoke every API token |
| UsersApi | revoke_api_token | DELETE /api/v1/users/me/tokens/{token_id} | Revoke an API token |
| UsersApi | signup | POST /api/v1/users/signup | Sign up |
| UsersApi | update_newsletter | PATCH /api/v1/users/me/newsletter | Change newsletter preference |
| UsersApi | update_password_me | PATCH /api/v1/users/me/password | Change your password |
| UsersApi | update_user_me | PATCH /api/v1/users/me | Update your account |
Documentation For Models
- ApiTokenCreate
- ApiTokenCreated
- ApiTokenPublic
- ChangesPublic
- ChangesResponse
- DeviceApproval
- DeviceAuthorization
- EmailChangeConfirm
- EmailChangeRequest
- EmailVerification
- EmailVerified
- GamePublic
- GameResponse
- HTTPValidationError
- LinesGame
- LinesGameResponse
- LinesSeason
- LinesSeasonResponse
- LinkToken
- LiveGamesPublic
- LivePbpPublic
- LivePbpResponse
- Message
- MfaChallenge
- NewPassword
- NewsletterPreference
- Newsletters
- OAuthError
- PasswordRecovery
- PbpPublic
- PbpResponse
- PlayerPublic
- PlayerResponse
- PredGoalResponse
- PredGoalRow
- RapmResponse
- RapmScores
- RecoveryCodes
- RecoveryConfirm
- RecoveryRequest
- RosterPublic
- RosterResponse
- ShiftsPublic
- ShiftsResponse
- SignInMethods
- StandingsPublic
- StandingsResponse
- StatsGame
- StatsGameResponse
- StatsSeason
- StatsSeasonResponse
- TeamPublic
- TeamResponse
- TeamStatsGame
- TeamStatsGameResponse
- TeamStatsSeason
- TeamStatsSeasonResponse
- Token
- UpdatePassword
- Usage
- UserPublic
- UserRegister
- UserUpdateMe
- ValidationError
- ValidationErrorLocInner
- WhoAmI
Documentation For Authorization
Authentication schemes defined for the API:
OAuth2PasswordBearer
- Type: OAuth
- Flow: password
- Authorization URL:
- Scopes: N/A
Author
Metadata
Release files for chickenstats-api 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chickenstats_api-0.3.2.tar.gz | 122.2 kB | With provenance | Details for chickenstats_api-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chickenstats_api-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for chickenstats_api-0.3.2-py3-none-any.whl |
Total release size: 390.7 kB
Release files / chickenstats_api-0.3.2.tar.gz
| Download URL | chickenstats_api-0.3.2.tar.gz |
|---|---|
| Size | 122.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6908916b373f8ad7b548e1b5efd297654ba6c3c1f078d7bf80ef769286745854
|
|
BLAKE2b-256 checksum How to use checksums |
affcdd7d37f4dc5b8effec0dbf06933a3c37ac9d7214cfba97ad5373ee68a142
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / chickenstats_api-0.3.2-py3-none-any.whl
| Download URL | chickenstats_api-0.3.2-py3-none-any.whl |
|---|---|
| Size | 268.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b222574c831d825a4dcdac663bd43be4410b6bd55220e0be4d8f10d59266f3f
|
|
BLAKE2b-256 checksum How to use checksums |
49af5298cfbd51d1c8cb4ef00e9954b674f47ad1ab752e95bb7536cae5039bd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logSecurity for chickenstats-api 0.3.2
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.
Attestation for chickenstats_api-0.3.2.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 Nov 22, 2026.
Transparency logA 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.