API 调用示例

获取开奖结果 - GET

获取所有彩种的最新开奖结果数据。
GET /api/index.php?action=lottery_results
{
    "errorCode": 0,
    "result": {
        "businessCode": true,
        "data": {
            "1": {
                "preDrawIssue": "2026212",
                "preDrawTime": "2026-08-10 21:15:00",
                "preDrawCode": "5,6,1",
                "playtype": "10"
            },
            ...
        }
    }
}

获取彩种列表 - GET

获取所有彩种配置信息。
GET /api/index.php?action=lottery_list
{
    "errorCode": 0,
    "result": {
        "businessCode": true,
        "data": {
            "1": { "title": "福彩3D", "playtype": "10", "status": "active" },
            ...
        }
    }
}

获取生肖数据 - GET

获取生肖排列数据(用于六合彩)。
GET /api/index.php?action=zodiac
{
    "errorCode": 0,
    "result": {
        "businessCode": true,
        "data": ["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
    }
}

调用示例 - jQuery

使用 jQuery 调用接口获取开奖数据。
$.ajax({
    url: '/api/index.php?action=lottery_results',
    type: 'GET',
    dataType: 'json',
    success: function(data) {
        if (data.errorCode === 0 && data.result.businessCode) {
            var results = data.result.data;
            console.log('开奖数据:', results);
            // 处理数据...
        }
    }
});

调用示例 - JavaScript Fetch

使用原生 Fetch API 调用接口。
fetch('/api/index.php?action=lottery_results')
    .then(response => response.json())
    .then(data => {
        if (data.errorCode === 0 && data.result.businessCode) {
            console.log('开奖数据:', data.result.data);
        }
    })
    .catch(error => console.error('Error:', error));

免责声明:本站所有内容仅供参考,不进行任何现金交易行为。

沉迷赌博,害人害己害国家,请远离赌博!

本站不承担由于内容的合法性所引起的一切争议和法律责任。

(汇旺) 版权所有 All Rights Reserved.