Draw API Client Integration Documentation

This page explains how to connect your game or application to the official draw data service. The service provides current round timing, next and previous issue numbers, historical draw results, and a live WebSocket feed that pushes updates automatically whenever a new issue opens. All information below uses the live server host saas-lottery.fa101.site. Live sample payloads on this page were fetched at 2026-08-15T16:43:30+08:00.

The base HTTP URL is https://saas-lottery.fa101.site. The live socket URL is wss://saas-lottery.fa101.site/ws/. Every HTTP draw request must include a valid API key. You may pass the key as a query parameter named key, as request header X-Api-Key, or as Authorization: Bearer YOUR_KEY. If the key is missing or invalid the API returns HTTP 401. If the key is expired, revoked, or not allowed for a game, the API returns HTTP 403. Keep the key on your backend whenever possible and do not hardcode it inside public mobile or browser clients.

Every game path follows the pattern /draw/{Family}/{GameCode}. Family and GameCode must match. The complete list of supported games is: WinGo family with codes WinGo_30S (30 seconds), WinGo_1M (1 minute), WinGo_3M (3 minutes), WinGo_5M (5 minutes); K3 family with codes K3_1M, K3_3M, K3_5M; D5 family with codes D5_1M, D5_3M, D5_5M; MotoRace family with codes MotoRace_1M, MotoRace_3M, MotoRace_5M; and TrxWinGo family with codes TrxWinGo_1M, TrxWinGo_3M, TrxWinGo_5M. Example paths are /draw/WinGo/WinGo_30S, /draw/K3/K3_1M, /draw/D5/D5_1M, /draw/MotoRace/MotoRace_1M, and /draw/TrxWinGo/TrxWinGo_1M.

All game codes with live current issue data fetched now:

Family WinGo, GameCode WinGo_30S, name WinGo 30 Sec, interval 30 seconds, HTTP URL https://saas-lottery.fa101.site/draw/WinGo/WinGo_30S?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=WinGo_30S. Live current issueNumber is 20260815100051048, startTime 1786783410000, endTime 1786783440000, previous issue 20260815100051047, next issue 20260815100051049, intervalMinute 0.5, state 1.

Family WinGo, GameCode WinGo_1M, name WinGo 1 Min, interval 1 minute, HTTP URL https://saas-lottery.fa101.site/draw/WinGo/WinGo_1M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=WinGo_1M. Live current issueNumber is 20260815100010524, startTime 1786783380000, endTime 1786783440000, previous issue 20260815100010523, next issue 20260815100010525, intervalMinute 1, state 1.

Family WinGo, GameCode WinGo_3M, name WinGo 3 Min, interval 3 minutes, HTTP URL https://saas-lottery.fa101.site/draw/WinGo/WinGo_3M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=WinGo_3M. Live current issueNumber is 20260815100020175, startTime 1786783320000, endTime 1786783500000, previous issue 20260815100020174, next issue 20260815100020176, intervalMinute 3, state 1.

Family WinGo, GameCode WinGo_5M, name WinGo 5 Min, interval 5 minutes, HTTP URL https://saas-lottery.fa101.site/draw/WinGo/WinGo_5M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=WinGo_5M. Live current issueNumber is 20260815100030105, startTime 1786783200000, endTime 1786783500000, previous issue 20260815100030104, next issue 20260815100030106, intervalMinute 5, state 1.

Family K3, GameCode K3_1M, name K3 1 Min, interval 1 minute, HTTP URL https://saas-lottery.fa101.site/draw/K3/K3_1M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=K3_1M. Live current issueNumber is 20260815101010524, startTime 1786783380000, endTime 1786783440000, previous issue 20260815101010523, next issue 20260815101010525, intervalMinute 1, state 1.

Family K3, GameCode K3_3M, name K3 3 Min, interval 3 minutes, HTTP URL https://saas-lottery.fa101.site/draw/K3/K3_3M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=K3_3M. Live current issueNumber is 20260815101020175, startTime 1786783320000, endTime 1786783500000, previous issue 20260815101020174, next issue 20260815101020176, intervalMinute 3, state 1.

Family K3, GameCode K3_5M, name K3 5 Min, interval 5 minutes, HTTP URL https://saas-lottery.fa101.site/draw/K3/K3_5M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=K3_5M. Live current issueNumber is 20260815101030105, startTime 1786783200000, endTime 1786783500000, previous issue 20260815101030104, next issue 20260815101030106, intervalMinute 5, state 1.

Family D5, GameCode D5_1M, name 5D 1 Min, interval 1 minute, HTTP URL https://saas-lottery.fa101.site/draw/D5/D5_1M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=D5_1M. Live current issueNumber is 20260815102010524, startTime 1786783380000, endTime 1786783440000, previous issue 20260815102010523, next issue 20260815102010525, intervalMinute 1, state 1.

Family D5, GameCode D5_3M, name 5D 3 Min, interval 3 minutes, HTTP URL https://saas-lottery.fa101.site/draw/D5/D5_3M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=D5_3M. Live current issueNumber is 20260815102020175, startTime 1786783320000, endTime 1786783500000, previous issue 20260815102020174, next issue 20260815102020176, intervalMinute 3, state 1.

Family D5, GameCode D5_5M, name 5D 5 Min, interval 5 minutes, HTTP URL https://saas-lottery.fa101.site/draw/D5/D5_5M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=D5_5M. Live current issueNumber is 20260815102030105, startTime 1786783200000, endTime 1786783500000, previous issue 20260815102030104, next issue 20260815102030106, intervalMinute 5, state 1.

Family MotoRace, GameCode MotoRace_1M, name MotoRace 1 Min, interval 1 minute, HTTP URL https://saas-lottery.fa101.site/draw/MotoRace/MotoRace_1M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=MotoRace_1M. Live current issueNumber is 20260815105010524, startTime 1786783380000, endTime 1786783440000, previous issue 20260815105010523, next issue 20260815105010525, intervalMinute 1, state 1.

Family MotoRace, GameCode MotoRace_3M, name MotoRace 3 Min, interval 3 minutes, HTTP URL https://saas-lottery.fa101.site/draw/MotoRace/MotoRace_3M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=MotoRace_3M. Live issue data could not be loaded for this code at fetch time.

Family MotoRace, GameCode MotoRace_5M, name MotoRace 5 Min, interval 5 minutes, HTTP URL https://saas-lottery.fa101.site/draw/MotoRace/MotoRace_5M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=MotoRace_5M. Live issue data could not be loaded for this code at fetch time.

Family TrxWinGo, GameCode TrxWinGo_1M, name TrxWinGo 1 Min, interval 1 minute, HTTP URL https://saas-lottery.fa101.site/draw/TrxWinGo/TrxWinGo_1M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=TrxWinGo_1M. Live current issueNumber is 20260815103010524, startTime 1786783380000, endTime 1786783440000, previous issue 20260815103010523, next issue 20260815103010525, intervalMinute 1, state 1.

Family TrxWinGo, GameCode TrxWinGo_3M, name TrxWinGo 3 Min, interval 3 minutes, HTTP URL https://saas-lottery.fa101.site/draw/TrxWinGo/TrxWinGo_3M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=TrxWinGo_3M. Live current issueNumber is 20260815103020175, startTime 1786783320000, endTime 1786783500000, previous issue 20260815103020174, next issue 20260815103020176, intervalMinute 3, state 1.

Family TrxWinGo, GameCode TrxWinGo_5M, name TrxWinGo 5 Min, interval 5 minutes, HTTP URL https://saas-lottery.fa101.site/draw/TrxWinGo/TrxWinGo_5M?key=YOUR_KEY, socket URL wss://saas-lottery.fa101.site/ws/?game=TrxWinGo_5M. Live current issueNumber is 20260815103030105, startTime 1786783200000, endTime 1786783500000, previous issue 20260815103030104, next issue 20260815103030106, intervalMinute 5, state 1.

Current issue HTTP API. Call GET https://saas-lottery.fa101.site/draw/WinGo/WinGo_30S?key=YOUR_KEY to receive the active round for that game. Optional query live=1 skips cache and asks for a fresh upstream read. The response is raw JSON with fields gameCode, intervalMinute, state, previous, current, and next. Each of previous, current, and next contains issueNumber, startTime, and endTime. Timestamps are milliseconds and work directly with JavaScript Date.now(). Remaining time for countdown is current.endTime - Date.now(). A practical betting rule is to treat betting as open while remaining time is greater than a few seconds, for example remainingMs > 3000.

Live fetched sample for WinGo_30S current issue:

{
    "gameCode": "WinGo_30S",
    "intervalMinute": 0.5,
    "state": 1,
    "previous": {
        "issueNumber": "20260815100051047",
        "startTime": 1786783380000,
        "endTime": 1786783410000
    },
    "current": {
        "issueNumber": "20260815100051048",
        "startTime": 1786783410000,
        "endTime": 1786783440000
    },
    "next": {
        "issueNumber": "20260815100051049",
        "startTime": 1786783440000,
        "endTime": 1786783470000
    }
}

History HTTP API. Call GET https://saas-lottery.fa101.site/draw/{Family}/{GameCode}/GetHistoryIssuePage?key=YOUR_KEY&pageNo=1 to receive recent settled results. The response contains data.list. Each list item commonly includes issueNumber, number, color, premium, and sum. WinGo and TrxWinGo use number values from 0 to 9 with color values such as green, red, violet, or combinations like red,violet. K3 results commonly expose premium as three digits and a sum of those dice values. D5 results commonly expose a five-digit premium and a digit sum. MotoRace results commonly expose premium as a comma-separated finishing order of ten positions. TrxWinGo history may also include blockchain related fields such as blockId, blockNumber, and blockTimestamp.

Live fetched recent history samples:

History sample for WinGo_30S:

[
    {
        "issueNumber": "20260815100051047",
        "number": "1",
        "color": "green",
        "premium": "1",
        "sum": 0
    },
    {
        "issueNumber": "20260815100051046",
        "number": "6",
        "color": "red",
        "premium": "6",
        "sum": 0
    },
    {
        "issueNumber": "20260815100051045",
        "number": "7",
        "color": "green",
        "premium": "7",
        "sum": 0
    },
    {
        "issueNumber": "20260815100051044",
        "number": "7",
        "color": "green",
        "premium": "7",
        "sum": 0
    },
    {
        "issueNumber": "20260815100051043",
        "number": "5",
        "color": "green,violet",
        "premium": "5",
        "sum": 0
    }
]

History sample for K3_1M:

[
    {
        "issueNumber": "20260815101010523",
        "number": "",
        "color": "",
        "premium": "325",
        "sum": 10
    },
    {
        "issueNumber": "20260815101010522",
        "number": "",
        "color": "",
        "premium": "513",
        "sum": 9
    },
    {
        "issueNumber": "20260815101010521",
        "number": "",
        "color": "",
        "premium": "266",
        "sum": 14
    },
    {
        "issueNumber": "20260815101010520",
        "number": "",
        "color": "",
        "premium": "114",
        "sum": 6
    },
    {
        "issueNumber": "20260815101010519",
        "number": "",
        "color": "",
        "premium": "364",
        "sum": 13
    }
]

History sample for D5_1M:

[
    {
        "issueNumber": "20260815102010523",
        "number": "",
        "color": "",
        "premium": "91812",
        "sum": 21
    },
    {
        "issueNumber": "20260815102010522",
        "number": "",
        "color": "",
        "premium": "29865",
        "sum": 30
    },
    {
        "issueNumber": "20260815102010521",
        "number": "",
        "color": "",
        "premium": "37487",
        "sum": 29
    },
    {
        "issueNumber": "20260815102010520",
        "number": "",
        "color": "",
        "premium": "41262",
        "sum": 15
    },
    {
        "issueNumber": "20260815102010519",
        "number": "",
        "color": "",
        "premium": "68002",
        "sum": 16
    }
]

History sample for MotoRace_1M:

[
    {
        "issueNumber": "20260815105010523",
        "premium": "3,5,4,1,7,8,6,2,9,10"
    },
    {
        "issueNumber": "20260815105010522",
        "premium": "10,1,5,3,8,2,4,9,7,6"
    },
    {
        "issueNumber": "20260815105010521",
        "premium": "8,5,10,1,4,2,9,6,7,3"
    },
    {
        "issueNumber": "20260815105010520",
        "premium": "7,1,5,4,9,10,3,2,6,8"
    },
    {
        "issueNumber": "20260815105010519",
        "premium": "10,6,1,9,8,3,5,4,7,2"
    }
]

History sample for TrxWinGo_1M:

[
    {
        "issueNumber": "20260815103010523",
        "number": "6",
        "color": "red",
        "premium": "6",
        "sum": 6,
        "blockId": "000000000516a77f47b66fedbc1d5f38b0fac89ec61f679e12593d12005c9be6",
        "blockNumber": 85370751,
        "blockTimestamp": 1786783374000
    },
    {
        "issueNumber": "20260815103010522",
        "number": "8",
        "color": "red",
        "premium": "8",
        "sum": 8,
        "blockId": "000000000516a76bdaf6dc5f91ab665d28e1c875221ef4bded78e727296b78e8",
        "blockNumber": 85370731,
        "blockTimestamp": 1786783314000
    },
    {
        "issueNumber": "20260815103010521",
        "number": "0",
        "color": "red,violet",
        "premium": "0",
        "sum": 0,
        "blockId": "000000000516a757e09c692e4bafec2ccb42d407f9088e77ff7fe53f236f580a",
        "blockNumber": 85370711,
        "blockTimestamp": 1786783254000
    },
    {
        "issueNumber": "20260815103010520",
        "number": "2",
        "color": "red",
        "premium": "2",
        "sum": 2,
        "blockId": "000000000516a743c14a23c02f3f231b9cade81b6c4b390c0714ee0e72bd6512",
        "blockNumber": 85370691,
        "blockTimestamp": 1786783194000
    },
    {
        "issueNumber": "20260815103010519",
        "number": "5",
        "color": "green,violet",
        "premium": "5",
        "sum": 5,
        "blockId": "000000000516a72fc7cf34deeb877967fdbca2d011dfec72b8136004686725dd",
        "blockNumber": 85370671,
        "blockTimestamp": 1786783134000
    }
]

Live WebSocket auto update. For real-time game screens do not poll HTTP every few hundred milliseconds. Connect once to the socket and listen for pushes. Use wss://saas-lottery.fa101.site/ws/?game=WinGo_30S to subscribe to one game, or wss://saas-lottery.fa101.site/ws/ to receive all games. After connect the server sends a hello message with the active filter and game list. It then sends issue snapshots for the subscribed games. Whenever a new issue opens, the server pushes a fresh issue message without needing another HTTP call. History messages are also pushed so result lists can refresh automatically. On disconnect, reconnect after one to three seconds.

Example hello message shape: {"type":"hello","games":["WinGo_30S","WinGo_1M", "..."],"filter":"WinGo_30S","t":1785878640000}. Example issue message shape: {"type":"issue","game":"WinGo_30S","data":{...same structure as HTTP current issue...},"t":1785878640123,"snapshot":true}. When snapshot is true the message is the initial sync after connect. Later live issue messages indicate a newly opened round. Example history message shape: {"type":"history","game":"WinGo_30S","data":{"data":{"list":[...]}},"t":1785878640123}.

Recommended integration flow in paragraphs. When your game opens, first call the HTTP current-issue endpoint for the selected GameCode and render the current issueNumber with a countdown based on endTime. Then call the history endpoint once to fill the recent results table. Immediately after that, open the WebSocket with the same GameCode filter. On every issue socket message, replace the active round data and restart countdown from the new endTime. On every history socket message, refresh the results list. If the socket drops, keep showing the last known round from memory, reconnect the socket, and optionally call HTTP once as fallback. This pattern gives fast first paint from HTTP and continuous automatic updates from the socket.

JavaScript example using live host values.

const BASE = 'https://saas-lottery.fa101.site';
const KEY = 'YOUR_KEY';
const GAME = 'WinGo_30S';

async function loadIssue() {
  const res = await fetch(BASE + '/draw/WinGo/' + GAME + '?key=' + encodeURIComponent(KEY));
  if (!res.ok) throw new Error('HTTP ' + res.status);
  return res.json();
}

async function loadHistory(pageNo = 1) {
  const res = await fetch(BASE + '/draw/WinGo/' + GAME + '/GetHistoryIssuePage?key=' + encodeURIComponent(KEY) + '&pageNo=' + pageNo);
  if (!res.ok) throw new Error('HTTP ' + res.status);
  return res.json();
}

function connectLive(onIssue, onHistory) {
  const ws = new WebSocket('wss://saas-lottery.fa101.site/ws/?game=' + encodeURIComponent(GAME));
  ws.onmessage = (e) => {
    const msg = JSON.parse(e.data);
    if (msg.type === 'issue') onIssue(msg.data, msg);
    if (msg.type === 'history') onHistory(msg.data, msg);
  };
  ws.onclose = () => setTimeout(() => connectLive(onIssue, onHistory), 2000);
  return ws;
}

const issue = await loadIssue();
const remain = issue.current.endTime - Date.now();
console.log(issue.current.issueNumber, remain);

connectLive(
  (data) => console.log('live issue', data.current.issueNumber, data.current.endTime),
  (data) => console.log('live history count', (data.data && data.data.list || []).length)
);

PHP example.

$url = 'https://saas-lottery.fa101.site/draw/WinGo/WinGo_30S?key=' . urlencode('YOUR_KEY');
$ch = curl_init($url);
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 5,
  CURLOPT_HTTPHEADER => ['X-Api-Key: YOUR_KEY'],
]);
$json = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$data = json_decode($json, true);
if ($code === 200 && !empty($data['current']['issueNumber'])) {
  echo $data['current']['issueNumber'] . ' ends at ' . $data['current']['endTime'];
}

Node.js socket example.

const WebSocket = require('ws');
const ws = new WebSocket('wss://saas-lottery.fa101.site/ws/?game=WinGo_30S');
ws.on('message', (buf) => {
  const msg = JSON.parse(buf.toString());
  if (msg.type === 'issue') {
    console.log(msg.game, msg.data.current.issueNumber, msg.data.current.endTime);
  }
});

Error handling. HTTP 200 means success and returns draw JSON. HTTP 401 means the API key is missing or invalid. HTTP 403 means the key is disabled, expired, or not allowed for that game. HTTP 400 means family and game do not match or the game code is unknown. HTTP 502 means the upstream draw source was temporarily unavailable. Error body example: {"code":401,"msg":"API key required. Pass ?key=YOUR_KEY or header X-Api-Key","msgCode":401,"data":null}. The HTTP API allows browser CORS with Access-Control-Allow-Origin star for GET and OPTIONS.

Practical rules for production games. Use WebSocket as the primary live channel and HTTP only for first load or reconnect recovery. Always filter socket traffic with ?game=GameCode unless you intentionally need all games. Do not flood HTTP with high-frequency polling. Treat endTime as the source of truth for countdown and close betting a few seconds before endTime if your game needs a lock period. When issueNumber changes, clear old bets for the previous round and bind new bets to the new issueNumber. Store your API key privately and rotate it if it leaks.

Complete endpoint cheat sheet for this host: current issue https://saas-lottery.fa101.site/draw/{Family}/{GameCode}?key=YOUR_KEY, history https://saas-lottery.fa101.site/draw/{Family}/{GameCode}/GetHistoryIssuePage?key=YOUR_KEY&pageNo=1, live socket one game wss://saas-lottery.fa101.site/ws/?game={GameCode}, live socket all games wss://saas-lottery.fa101.site/ws/. All sixteen GameCodes are WinGo_30S, WinGo_1M, WinGo_3M, WinGo_5M, K3_1M, K3_3M, K3_5M, D5_1M, D5_3M, D5_5M, MotoRace_1M, MotoRace_3M, MotoRace_5M, TrxWinGo_1M, TrxWinGo_3M, and TrxWinGo_5M.