Complete Example
Here’s a full working example based on the SDK’s main implementation:Step-by-Step Workflow
Initialize the Session
Create a
Bet365AndroidSession instance with your API credentials and configuration:The session automatically configures TLS fingerprinting to mimic Android app requests.
Go to Homepage
Navigate to the Bet365 homepage to initialize cookies and configuration:This method:
- Fetches the homepage HTML
- Retrieves site configuration
- Sets up necessary cookies (
usdi,pstk) - Extracts the SST token for subsequent requests
Extract Available Sports
Retrieve the list of all available sports:Each
Sport object contains:name: The sport’s display name (e.g., “Soccer”, “Tennis”, “Basketball”)PD: The sport’s path descriptor for API requests
Get Sport-Specific Data
Fetch detailed data for a specific sport:This retrieves “splash pods” containing:
- Match listings
- Betting markets
- Odds data
- Competition information
Configuration File Format
Create aconfig.json file with the following structure:
Set
proxy to null or empty string if you don’t need a proxy.Expected Output
When you run the script, you’ll see:- Session initialization confirmation
- Homepage navigation status
- Available sports list with names and PD values
- Pretty-printed tables showing:
- Match names
- Betting markets
- Odds values
- Competition details
Common Use Cases
Next Steps
- Learn how to parse response data
- Implement error handling for robust scraping
- Explore the API Reference for more methods