
asean-lottery-check-draw-result
Under maintenance
Pricing
$3.00/month + usage

asean-lottery-check-draw-result
Under maintenance
Returns the latest draw results for a specific lottery provider.
0.0 (0)
Pricing
$3.00/month + usage
0
Total users
1
Monthly users
1
Last modified
11 days ago
ASEAN Lottery Check Draw Result Actor
This Apify actor retrieves the latest draw result for a specific ASEAN lottery company. It supports 12 different game providers across 5 ASEAN countries with provider-specific result formatting.
🎯 What it does
The actor connects to a MySQL database and fetches the most recent draw results for a specified lottery provider, including:
- Latest draw date
- Prize winners (first, second, third)
- Special prize numbers
- Consolation prize numbers
Results are formatted according to each provider's specific structure.
🌏 Supported Providers
Malaysia (6 providers)
- MAG - Magnum 4D
- DMC - Da Ma Cai 4D
- TOT - Sports Toto 4D
- CSP - Cashsweep 4D
- STC - Sandakan 4D
- S88 - Sabah 88 4D
Singapore (1 provider)
- SGP - Singapore Pools 4D
Cambodia (3 providers)
- GDL - GD Lotto 4D
- LHH - Lucky Hari Hari 4D
- PDN - Perdana 4D
Vietnam (1 provider)
- VIE - Vietnam Lottery 4D
Philippines (1 provider)
- PHL - PCSO 4D Lotto
📥 Input
The actor requires a Provider ID (PID) as input:
{"pid": "MAG"}
Input Parameters
- pid (string, required): Provider ID from the supported list above
📤 Output
The output format varies by provider:
Malaysia, Singapore & Cambodia Providers
{"success": true,"data": {"name": "Magnum","draw_date": "20250529","result": {"first_prize": "1234","second_prize": "5678","third_prize": "9012","special": ["3456", "7890", "1234", "5678", "9012", "3456", "7890", "1234", "5678", "9012"],"consolation": ["2345", "6789", "0123", "4567", "8901", "2345", "6789", "0123", "4567", "8901"]}}}
Vietnam Provider
{"success": true,"data": {"name": "Vietnam Lottery VN4D","draw_date": "20250529","result": {"first_prize": "1234","second_prize": "5678","third_prize": "9012","special": "3456","consolation": "7890"}}}
Philippines Provider
{"success": true,"data": {"name": "PSCO 4D Lotto","draw_date": "20250529","result": {"first_prize": "1234"}}}
⚙️ Configuration
Required Environment Variables
MYSQLHOST=your_database_hostMYSQLUSER=your_database_userMYSQLPASSWORD=your_database_passwordMYSQLDATABASE=your_database_nameMYSQLPORT=3306
Alternative Environment Variables (Fallback)
DB_HOST=your_database_hostDB_USER=your_database_userDB_PASSWORD=your_database_passwordDB_NAME=your_database_nameDB_PORT=3306
📊 Database Requirements
lottery_companies
company_id
(INT, PRIMARY KEY)pid
(VARCHAR) - Provider IDname
(VARCHAR) - Company name
draw_results
company_id
(INT) - Foreign key to lottery_companiesdraw_date
(DATE) - Date of the drawfirst_prize
(VARCHAR) - First prize numbersecond_prize
(VARCHAR) - Second prize numberthird_prize
(VARCHAR) - Third prize numberspecial_numbers
(TEXT) - Special prize numbers (comma/pipe separated)consolation_numbers
(TEXT) - Consolation prize numbers (comma/pipe separated)
🚀 Usage Examples
Run via Apify Console
- Go to the actor page
- Click "Start"
- Enter input:
{"pid": "MAG"}
- View results in the Dataset
Run via API
curl -X POST https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs \-H "Authorization: Bearer YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"pid": "MAG"}'
Run via Apify Client (Node.js)
const { ApifyApi } = require('apify-client');const client = new ApifyApi({token: 'YOUR_API_TOKEN'});const input = { pid: 'MAG' };const run = await client.actor('YOUR_ACTOR_ID').call(input);const dataset = await client.dataset(run.defaultDatasetId).listItems();console.log(dataset.items[0]);
Multiple Providers Example
const providers = ['MAG', 'SGP', 'VIE', 'PHL'];for (const pid of providers) {const run = await client.actor('YOUR_ACTOR_ID').call({ pid });const result = await client.dataset(run.defaultDatasetId).listItems();console.log(`${pid} latest result:`, result.items[0]);}
🎲 Result Format Details
Prize Structure Differences
Malaysia/Singapore/Cambodia:
- 10 special numbers (array)
- 10 consolation numbers (array)
- Full prize hierarchy
Vietnam:
- 1 special number (string)
- 1 consolation number (string)
- Simplified structure
Philippines:
- Only first prize
- No special or consolation prizes
Number Format
- All numbers are 4-digit strings
- Leading zeros preserved (e.g., "0123")
- Numbers stored as strings to maintain format
🔍 Troubleshooting
Common Issues
Invalid PID Error
{"success": false,"message": "No lottery company found with pid XYZ"}
- Check if PID is in the supported list
- Verify PID spelling and case sensitivity
No Results Found
{"success": true,"message": "No draw results found for this lottery company","data": {"name": "Company Name","result": {}}}
- Check if draw_results table has data
- Verify company_id relationships
- Check date ranges in database
Database Connection Issues
- Verify database credentials
- Check network connectivity
- Ensure database accepts external connections
📅 Draw Frequencies
Different providers have different draw schedules:
- Malaysia/Singapore: 3 times per week
- Cambodia: Daily draws
- Vietnam: Daily draws
- Philippines: 3 times per week
The actor always returns the most recent available result.
🔒 Security Considerations
- Use read-only database user
- Secure database credentials
- Enable SSL/TLS connections
- Monitor for unusual access patterns
📈 Performance Tips
- Results are typically cached for a few hours
- Consider implementing caching layer for high-frequency access
- Monitor database query performance
- Use connection pooling for production
📞 Support
Common issues and solutions:
- Wrong PID: Use exact PID from supported list
- No recent results: Check database for recent draws
- Format issues: Verify database schema matches requirements
📄 License
This actor is provided for lottery data retrieval purposes.