Get started with BYW Lottery API in 5 minutes
Create BYW account
Create API key
Choose language
Get draw data
Visit BYW registration page to create an account. Free trial is available after registration.
After logging in, go to Free Trial to select the lottery types you want to try. The system will automatically create a trial Token.
Token is the credential for calling the API. You can manage multiple Tokens in the dashboard.
Install-Package BywLottery.SDK dotnet add package BywLottery.SDK
using BywLottery.SDK;
var client = new BywClient("YOUR_TOKEN");
var result = await client.GetLatestAsync("4");
composer require byw/lottery-api-sdk
require_once 'vendor/autoload.php';
$client = new BywClient('YOUR_TOKEN');
$result = $client->getLatest('4');
npm install byw-lottery-api-sdk
const { BywClient } = require('byw-lottery-api-sdk');
const client = new BywClient('YOUR_TOKEN');
const result = await client.latest('4');
// Get latest result for Chongqing SSC (lotteryid=4)
var result = await client.GetLatestAsync("4");
Console.WriteLine($"Period: {result.Expect}");
Console.WriteLine($"Number: {result.Opencode}");
// Get the latest 10 draw results
var results = await client.GetLatestAsync("4", 10);