Skip to main content

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:
Authorization Method:

Environment Setup

Add the following to your .env file:

Core Endpoints

System Status

Check API Status

Response:

Get Sync Status

Response:

Trigger Manual Sync

Analytics & Statistics

Platform Statistics

Query Parameters:
  • creator (optional): Filter by specific creator address
  • startTime (optional): Filter from specific timestamp
Response:

Individual Player Stats

Query Parameters:
  • user (required): Player wallet address
  • creator (optional): Filter by specific creator
  • token (optional): Filter by specific token
Response:

Top Players Leaderboard

Query Parameters:
  • sortBy (optional): Sort by usd_profit, usd_volume, token_profit, token_volume (default: usd_profit)
  • limit (optional): Number of results (default: 10)
  • offset (optional): Pagination offset
  • creator (optional): Filter by specific creator
  • token (optional): Filter by specific token
  • pool (optional): Filter by specific pool
  • startTime (optional): Filter from specific timestamp
Response:

Game Events & History

Settled Games

Query Parameters:
  • page (optional): Page number (default: 0)
  • itemsPerPage (optional): Items per page (default: 10)
  • onlyJackpots (optional): Filter only jackpot wins
  • creator (optional): Filter by specific creator
  • pool (optional): Filter by specific pool
  • token (optional): Filter by specific token
  • user (optional): Filter by specific player
  • orderBy (optional): Sort by time, multiplier, usd_profit (default: time)
  • sorting (optional): ASC or DESC (default: DESC)
Response:

Pool Changes

Query Parameters:
  • pool (required): Pool address to filter by

Platform & Creator Data

Top Platforms

Query Parameters:
  • limit (optional): Number of results (default: 10)
  • days (optional): Time period in days (default: 7)
  • sortBy (optional): Sort by usd_volume, usd_revenue (default: usd_volume)
Response:

Platforms by Pool

Token & Pool Data

Top Tokens

Query Parameters:
  • creator (optional): Filter by specific creator

Pool Analytics

Get Pool Ratio Changes:
Get Total Pool Volume:
Get Daily Pool Volume:

Chart & Time Series Data

Daily Plays Chart

Response:

Daily USD Volume Chart

Query Parameters:
  • creator (optional): Filter by specific creator

DAO Fee Collection Chart

Query Parameters:
  • 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 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid API key)
  • 404 - Not Found
  • 429 - Rate Limited
  • 500 - 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
Rate limit headers are included in responses:

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: