API Reference

🎰 New to Stake.com? Sign up with code WY7953wQ to claim your welcome bonus and support StakeAPI’s development β†’ Create your Stake.com account
πŸ’¬ Need help? Join the Chipa Discord Β· ⚑ Go no-code with ChipaEditor

Complete technical reference for every class, method, and model in StakeAPI.

Modules

ModuleWhat it does
StakeAPI ClientMain async client β€” casino, sports, user, and betting methods
AuthManagerToken storage, expiry tracking, cURL credential extraction
Data ModelsPydantic models: User, Game, SportEvent, Bet, Transaction, Statistics
Endpoints & GraphQLURL constants and pre-built GraphQL query strings
ExceptionsFull exception hierarchy with examples and fix guidance
Utilitiessafe_decimal, format_currency, validate_bet_amount, and more

Quick Navigation

By task

I want to…Go to…
Make my first API callGetting Started β†’ Quick Start
Authenticate with Stake.comGetting Started β†’ Authentication
Get my account balanceClient β†’ get_user_balance()
Browse casino gamesClient β†’ get_casino_games()
Place a betClient β†’ place_bet()
Write a raw GraphQL queryEndpoints β†’ GraphQL Queries
Handle errors properlyExceptions
Validate / format amountsUtilities

By class

  • StakeAPI β€” get_user_balance(), get_casino_games(), get_sports_events(), place_bet(), get_bet_history(), get_user_profile(), _graphql_request()
  • AuthManager β€” set_access_token(), is_token_expired(), extract_access_token_from_curl(), get_cookies()
  • User β€” id, username, verified, country, currency
  • Game β€” name, category, provider, rtp, min_bet, max_bet
  • SportEvent β€” home_team, away_team, odds, live, start_time
  • Bet β€” amount, potential_payout, status, placed_at
  • Transaction β€” type, amount, currency, status
  • Statistics β€” total_bets, win_rate, biggest_win

All Methods at a Glance

StakeAPI β€” Casino

MethodReturnsDescription
get_casino_games(category=None)List[Game]List available games, optionally filtered
get_game_details(game_id)GameFull details for a single game

StakeAPI β€” Sports

MethodReturnsDescription
get_sports_events(sport=None)List[SportEvent]Live and upcoming events

StakeAPI β€” User

MethodReturnsDescription
get_user_profile()UserProfile: username, country, verified
get_user_balance()DictAvailable and vault balances by currency

StakeAPI β€” Betting

MethodReturnsDescription
place_bet(bet_data)BetSubmit a bet
get_bet_history(limit=50)List[Bet]Recent bet history

StakeAPI β€” Low-level

MethodReturnsDescription
_graphql_request(query, variables, operation_name)DictRaw GraphQL call
_request(method, endpoint, params, data)DictRaw HTTP call
close()β€”Close the HTTP session

AuthManager

MethodReturnsDescription
get_auth_headers()Dict[str, str]Headers with access token
get_cookies()Dict[str, str]Session cookie dict
set_access_token(token, expires_in)β€”Store/update the token
set_session_cookie(cookie)β€”Store/update the session cookie
is_token_expired()boolTrue if token is stale
clear_tokens()β€”Wipe all stored credentials
extract_access_token_from_curl(cmd) (static)Optional[str]Parse token from cURL
extract_session_from_curl(cmd) (static)Optional[str]Parse session from cURL

Utilities

FunctionReturnsDescription
validate_api_key(key)boolFormat check
safe_decimal(value)Optional[Decimal]Safe type conversion
parse_datetime(s)Optional[datetime]ISO 8601 parsing
format_currency(amount, currency)strDisplay string
calculate_win_rate(wins, total)floatWin %
validate_bet_amount(amount, min, max)boolRange check
sanitize_game_name(name)strSafe string

All API methods require a valid Stake.com account and a cf_clearance cookie.


Level Up Your StakeAPI Setup

  • 🎰 Create your Stake.com account β†’ β€” Register with referral code WY7953wQ to unlock your welcome bonus, rakeback, and exclusive rewards. Using our link keeps StakeAPI free and actively maintained.
  • πŸ’¬ Join the Chipa Discord β†’ β€” Get real-time support, share your bots and strategies, and connect with hundreds of other StakeAPI developers.
  • ⚑ Try ChipaEditor β†’ β€” Build, backtest, and deploy betting & trading strategies with our AI-powered, no-code editor. The perfect companion to StakeAPI.