Whisky API
The Whisky API provides comprehensive access to gaming analytics, statistics, and real-time data from the Whisky Gaming Protocol. It serves as the data layer for applications that need to display gaming information, track performance, or integrate Whisky data into their systems.Overview
The Whisky API is a secure, high-performance REST API that indexes blockchain data from the Whisky protocol and provides fast, aggregated access to:- Real-time Analytics: Live statistics and metrics
- Historical Data: Game history and event logs
- Pool Information: Liquidity pool status and metrics
- Player Statistics: Individual player performance data
- Platform Analytics: Creator and platform performance
Base URL
Authentication
The API is secured for internal use only. All endpoints require a valid API key.API Key Authentication
Include your API key in one of these ways: Header Method:Environment Setup
Add the following to your.env file:
Core Endpoints
System Status
Check API Status
Get Sync Status
Trigger Manual Sync
Analytics & Statistics
Platform Statistics
creator(optional): Filter by specific creator addressstartTime(optional): Filter from specific timestamp
Individual Player Stats
user(required): Player wallet addresscreator(optional): Filter by specific creatortoken(optional): Filter by specific token
Top Players Leaderboard
sortBy(optional): Sort byusd_profit,usd_volume,token_profit,token_volume(default:usd_profit)limit(optional): Number of results (default: 10)offset(optional): Pagination offsetcreator(optional): Filter by specific creatortoken(optional): Filter by specific tokenpool(optional): Filter by specific poolstartTime(optional): Filter from specific timestamp
Game Events & History
Settled Games
page(optional): Page number (default: 0)itemsPerPage(optional): Items per page (default: 10)onlyJackpots(optional): Filter only jackpot winscreator(optional): Filter by specific creatorpool(optional): Filter by specific pooltoken(optional): Filter by specific tokenuser(optional): Filter by specific playerorderBy(optional): Sort bytime,multiplier,usd_profit(default:time)sorting(optional):ASCorDESC(default:DESC)
Pool Changes
pool(required): Pool address to filter by
Platform & Creator Data
Top Platforms
limit(optional): Number of results (default: 10)days(optional): Time period in days (default: 7)sortBy(optional): Sort byusd_volume,usd_revenue(default:usd_volume)
Platforms by Pool
Token & Pool Data
Top Tokens
creator(optional): Filter by specific creator
Pool Analytics
Get Pool Ratio Changes:Chart & Time Series Data
Daily Plays Chart
Daily USD Volume Chart
creator(optional): Filter by specific creator
DAO Fee Collection Chart
creator(optional): Filter by specific creator
Usage Examples
Quick Health Check
Get Recent Activity
Monitor Specific Pool
Track Specific Player
JavaScript/TypeScript Integration
Using Fetch API
Using Axios
Error Handling
The API returns standard HTTP status codes:200- Success400- Bad Request (invalid parameters)401- Unauthorized (invalid API key)404- Not Found429- Rate Limited500- Internal Server Error
Error Response Format
Rate Limiting
The API implements rate limiting to ensure fair usage:- Standard Tier: 100 requests per minute
- Premium Tier: 1000 requests per minute
- Enterprise Tier: Custom limits
Data Freshness
- Real-time Data: Game events and pool changes are indexed within 30 seconds
- Analytics Data: Statistics are updated every 5 minutes
- Historical Data: Available for the last 12 months
- Chart Data: Available for the last 300 days
Best Practices
1. Caching
Implement appropriate caching for frequently accessed data:2. Pagination
Use pagination for large datasets:3. Error Handling
Implement robust error handling:4. Monitoring
Monitor API usage and performance:Integration with Other Components
The Whisky API works seamlessly with other Whisky components:With Whisky Explorer
The Explorer uses the API to display real-time dashboards and analytics.With Whisky Core SDK
Applications can use both the API for data and the SDK for transactions.With Whisky React SDK
React applications can fetch data from the API and display it using React components.Support
For API support and questions:- Documentation: This documentation
- Community: Discord Server
- Issues: GitHub Issues
- Email: support@whisky.casino
