API Reference
Complete HTTP API documentation for BYW Lottery Draw Data API. Supports JSON, XML, JSONP formats.
GET
http://api.byw.bet:868/api
API Request
📌 Basic Info
- Endpoint:
http://api.byw.bet:868/api - Method:GET
- Formats:JSON / XML / JSONP
Request Example
HTTP GET
http://api.byw.bet:868/api?token=YOUR_TOKEN&t=4&limit=10&p=json
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
token | Yes | String | API Key from your dashboard |
t | Yes | String | Lottery type code See lottery list |
p | Yes | String | Format: json / xml / json2 / jsonp |
limit | No | Int | Number of rows, range 1-20, default 1 |
date | No | String | Date query, format: YYYYMMDD |
nexttime | No | Int | Set to 1 to include next draw time |
JSON Response
JSON Response
{
"Rows": 10,
"T": "4",
"Data": [
{
"Expect": "20260418053",
"Opencode": "9,0,0,1,1",
"Opentime": "2026-04-18 21:50:03"
}
]
}
XML Response
XML Response
<?xml version="1.0" encoding="utf-8"?>
<xml row="2">
<row expect="20260418053" opencode="9,0,0,1,1" opentime="2026-04-18 21:50:03"/>
</xml>
Error Codes
| Code | Meaning | Solution |
|---|---|---|
1001 | Token is empty | Add valid token |
1002 | Token not found or expired | Check token or renew |
1003 | Token permission denied | Purchase lottery access |
1004 | Invalid lottery code | Check lotteryid |
1005 | Too many requests | Reduce request frequency |
1006 | IP not authorized | Add IP to whitelist |
Code Examples
- PHP
- C#
- JavaScript
- cURL
require_once 'BywClient.php';
$client = new BywClient('YOUR_TOKEN');
$result = $client->getLatest('4', 10);
var client = new BywClient("YOUR_TOKEN");
var results = await client.GetLatestAsync("4", 10);
const client = new BywClient('YOUR_TOKEN');
const results = await client.latest('4', 10);
curl "http://api.byw.bet:868/api?token=YOUR_TOKEN&t=4&limit=10&p=json"
Rate Limits
⚠️ Important
- Max 3 IPs per lottery per day
- Latest query: min interval 1 second, recommended 5-10 seconds
- History query: min interval 10 seconds


