RESTful API for slot machine simulation
The Slot Machine API provides two main endpoints for interacting with a fully-featured slot machine game engine. The API supports both single spins for interactive gameplay and bulk simulations for statistical analysis.
Base URL: /slot/api/
Response Format: JSON (spin endpoint) and Server-Sent Events (simulate endpoint)
Execute a single spin and return the results immediately.
| Parameter | Type | Required | Description |
|---|---|---|---|
| bet | float | No | Bet amount per spin (0.10 to 100). Default: 1 |
| multiplier | integer | No | Bonus round multiplier (1-5). Default: 1 |
| Field | Type | Description |
|---|---|---|
| reels | array[][] | 5x3 grid of symbols representing the final reel positions |
| bonus | object | Bonus round information (triggered, scatters, freeSpins, multiplier) |
| win | float | Total win amount (after max win cap applied) |
| winningLines | array | Array of winning paylines with symbol, matches, and payout |
| maxWinCapped | boolean | True if win exceeded max win cap (5000x bet) |
| uncappedWin | float | Win amount before max cap applied |
Execute a bulk simulation with real-time progress updates via Server-Sent Events (SSE).
| Parameter | Type | Required | Description |
|---|---|---|---|
| spins | integer | No | Number of spins to simulate. Default: 1,000,000 |
| bet | float | No | Bet amount per spin (0.10 to 100). Default: 1 |
| Event Type | Description | Frequency |
|---|---|---|
| start | Simulation started | Once at beginning |
| progress | Progress update with RTP and completion percentage | Every 2,500 spins |
| complete | Final results with full analytics | Once at end |
| error | Error message | On error |
| Symbol | 5 of a Kind | 4 of a Kind | 3 of a Kind |
|---|---|---|---|
| 🍒 Cherry | €2.10 | €1.05 | €0.42 |
| 🍋 Lemon | €2.85 | €1.43 | €0.57 |
| 🍊 Orange | €4.20 | €2.10 | €0.84 |
| 🍇 Grape | €6.80 | €3.40 | €1.36 |
| 🍉 Watermelon | €11.50 | €5.75 | €2.30 |
| ⭐ Star | €29 | €14.50 | €5.80 |
| 💎 Diamond | €78 | €39 | €15.60 |
| 🎰 Jackpot | €240 | €120 | €48 |
The API returns appropriate HTTP status codes and JSON error messages:
HTTP 500: Internal server error (game engine failure)