1. Player
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
    • Player Bet History
      GET
  • Common
    • Game
      • By Game Code
        • Provably Fair
          • Set Client Seed
          • Verify Result
          • Get Revealed Server Seed
        • Check Session
        • Get Balance
        • Get Provably-Fair State
      • Lobby Game List
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
        • Inquiry My Tickets
        • Get Ticket
      • Round
        • Get My Bets
        • Get My Result
        • Get Round Provably Fair
      • Results
        • Inquiry Results
      • Get Rooms
      • Get Current Round
      • Get Pay Table
  • Appendix
    • Game List
    • Error Codes
    • Rate Limits
  • Language List
    GET
  • Ping
    GET
  • Schemas
    • DemoLoginRequest
    • DemoLoginResponse
    • DemoProfileResponse
    • ProfileResponse
    • GetHistoryResponse
    • BetRecord
    • GameInfo
    • Room
    • GetGameResponse
    • BetRequest
    • Bet
    • BetResponse
    • BetResult
    • GetProvablyFairResponse
    • SetClientSeedRequest
    • SetClientSeedResponse
    • RotateServerSeedResponse
    • VerifyResultRequest
    • VerifyResultResponse
    • GetServerSeedResponse
    • GetStatusResponse
    • JoinRoundResponse
    • PlaceMultiPlayerBetRequest
    • PlaceBetResponse
    • RoundResultResponse
    • SuccessResponse
    • ErrorResponse
  1. Player

Player Bet History

GET
/gapi/v1/player/history
Returns the player's own bet records in the session currency, newest first, with offset pagination. FE calls it for the bet history screen.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_GET_DETAIL)
Rules
Only the caller's own records in the session currency; the currency cannot be changed. Demo sessions see demo history only, real sessions real history only.
Offset pagination: send limit (default 20, max 100) and offset (default 0). The response adds a top-level total; total is ABSENT (not 0) when nothing matches, and data is [].
Filter values that cannot be parsed are ignored rather than rejected (no 400), which widens the result — e.g. a startTime that is not RFC 3339 means no start bound.
Query keys are gameId and roundId (lower-case d); the response keys are gameID and roundID.
resultData is a string that contains JSON — parse it. LOTTO keys: drawnNumber, bottom5, bottom4, bottom3, bottom2, front2, runBot[], runFront[]. THAI-HILO keys: dice[], total, isHI, isLO, isTriple, winAreas[].
Money fields (betAmount, payout, netWin, bets[].betAmount, bets[].winAmount) are decimal strings with trailing zeros trimmed; multiplier and payoutRate are JSON numbers.
gameName follows Accept-Language, then the game-launch language, then English; "" when unavailable.
Shares the GAME_GET_DETAIL rate-limit bucket (300 per 60 s per IP) with GET /gapi/v1/g/thai-hilo/rooms.
Blocked by system-wide maintenance only.
Flow
1.
Validates the token and checks system maintenance.
2.
Forces the currency filter to the session currency and parses the optional filters, dropping any that cannot be parsed.
3.
Reads the player's records (demo or real history) matching the filters, newest first, applying offset and limit, and counts the total.
4.
Fills gameName in the request language.
5.
Returns the records with a top-level total.

Request

Query Params

Header Params

Responses

🟢200OK
application/json
Bodyapplication/json

🟠401Unauthorized
🟠429Too Many Requests
🔴500Internal Server Error
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://dev-api.ambfairgame.com/gapi/v1/gapi/v1/player/history?gameId=2&isWin=true&startTime=2026-09-01T00%3A00%3A00+07%3A00&endTime=2026-09-30T23%3A59%3A59+07%3A00&limit=20&offset=0&roundId=LOTTO-R-20260930-0001' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th'
Response Response Example
200 - One LOTTO win
Filtered page with a single winning LOTTO record.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": [
        {
            "id": 5012,
            "playerID": 1024,
            "playerName": "Player One",
            "gameID": 2,
            "gameName": "Lotto",
            "roundID": "LOTTO-R-20260930-0001",
            "currency": "THB",
            "betAmount": "100",
            "payout": "9000",
            "netWin": "8900",
            "multiplier": 90,
            "isWin": true,
            "resultData": "{\"bottom2\":\"45\",\"bottom3\":\"345\",\"bottom4\":\"2345\",\"bottom5\":\"12345\",\"drawnNumber\":\"012345\",\"front2\":\"01\",\"runBot\":[\"3\",\"4\",\"5\"],\"runFront\":[\"0\",\"1\"]}",
            "betTime": "2026-09-30T08:15:30.123Z",
            "serverSeedHash": "abd523a9738377052883918736551e832c2edf4058589dec2d420718a0a5f33c",
            "bets": [
                {
                    "area": "2-BOTTOM_45",
                    "betAmount": "100",
                    "payoutRate": 90,
                    "winAmount": "9000",
                    "isWin": true,
                    "betID": "b-7f3c9e"
                }
            ]
        }
    ],
    "total": 1
}
Modified at 2026-09-30 13:23:45
Previous
Demo Login
Next
Set Client Seed
Built with