ChipaDocs /
Documentation /
StakeAPI
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
Module What it does
StakeAPI Client Main async client β casino, sports, user, and betting methods
AuthManager Token storage, expiry tracking, cURL credential extraction
Data Models Pydantic models: User, Game, SportEvent, Bet, Transaction, Statistics
Endpoints & GraphQL URL constants and pre-built GraphQL query strings
Exceptions Full exception hierarchy with examples and fix guidance
Utilities safe_decimal, format_currency, validate_bet_amount, and more
Quick Navigation
By task
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
Method Returns Description
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
Method Returns Description
get_sports_events(sport=None)List[SportEvent]Live and upcoming events
StakeAPI β User
Method Returns Description
get_user_profile()UserProfile: username, country, verified
get_user_balance()DictAvailable and vault balances by currency
StakeAPI β Betting
Method Returns Description
place_bet(bet_data)BetSubmit a bet
get_bet_history(limit=50)List[Bet]Recent bet history
StakeAPI β Low-level
Method Returns Description
_graphql_request(query, variables, operation_name)DictRaw GraphQL call
_request(method, endpoint, params, data)DictRaw HTTP call
close()β Close the HTTP session
AuthManager
Method Returns Description
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
Function Returns Description
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.