lottery-draw-information-query
彩票開獎資訊查詢
按彩種、期號或日期查詢當期彩票開獎號碼、本期銷售額與各獎級中獎注數及獎金資訊,提供全面的開獎資料。
呼叫價格
5 匠幣/次
快速接入
保持統一返回結構,直接透過服務端發起請求即可接入。
https://openapi.toolkk.com/v1/lottery-draw-information-querycURL 示例
curl --request POST \
--url 'https://openapi.toolkk.com/v1/lottery-draw-information-query' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "type": "ssq",\n "drawNo": "2024068"\n}'Python 示例
import os
import requests
url = "https://openapi.toolkk.com/v1/lottery-draw-information-query"
payload = {
"type": "ssq",
"drawNo": "2024068"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())Go 示例
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/lottery-draw-information-query"
payload := []byte("{\n \"type\": \"ssq\",\n \"drawNo\": \"2024068\"\n}")
req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}Java 示例
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ToolkkExample {
public static void main(String[] args) throws Exception {
String payload = "{\n \"type\": \"ssq\",\n \"drawNo\": \"2024068\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/lottery-draw-information-query"))
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.header("Content-Type", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP 示例
<?php
$endpoint = 'https://openapi.toolkk.com/v1/lottery-draw-information-query';
$payload = "{\n \"type\": \"ssq\",\n \"drawNo\": \"2024068\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;響應示例
{
"code": "ssq",
"name": "双色球",
"no": "2024068",
"date": "2024-06-16",
"number": "01 02 03 04 05 06 07",
"saleAmount": "380000000",
"levels": []
}範例用於理解回傳結構,實際結果以介面回傳為準。
- 鑑權方式
- 請求頭傳入 X-API-Key
- 預設限流
- 30 次/分鐘
- 超時時間
- 15000 ms
服務端呼叫時,將 API Key 放在 X-API-Key 請求頭中。
建議按 response code 與業務欄位雙重判斷呼叫結果。
高頻呼叫場景請結合速率限制與重試策略使用。
請求欄位
從伺服器發起請求,並在 X-API-Key 標頭中傳入金鑰。
請求欄位
以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 必填 | 說明 | 示例值 |
|---|---|---|---|---|
| type | string | 未標註 | 未標註 | ssq |
| drawNo | string | 未標註 | 未標註 | 2024068 |
請求示例
{
"type": "ssq",
"drawNo": "2024068"
}- 鑑權方式
- 請求頭傳入 X-API-Key
- 預設限流
- 30 次/分鐘
- 超時時間
- 15000 ms
響應欄位
範例用於理解回傳結構,實際結果以介面回傳為準。
響應欄位
以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 必填 | 說明 | 示例值 |
|---|---|---|---|---|
| code | string | 未標註 | 未標註 | ssq |
| name | string | 未標註 | 未標註 | 双色球 |
| no | string | 未標註 | 未標註 | 2024068 |
| date | string | 未標註 | 未標註 | 2024-06-16 |
| number | string | 未標註 | 未標註 | 01 02 03 04 05 06 07 |
| saleAmount | string | 未標註 | 未標註 | 380000000 |
| levels | array | 未標註 | 未標註 | [] |
響應示例
{
"code": "ssq",
"name": "双色球",
"no": "2024068",
"date": "2024-06-16",
"number": "01 02 03 04 05 06 07",
"saleAmount": "380000000",
"levels": []
}$.code == 200介面簡介
介面功能、應用情境、使用限制與常見問題。
介面能力
彩票開獎資訊查詢 API 允許開發者根據指定的彩種程式碼、期號或開獎日期,獲取詳細的當期開獎資訊。返回資料不僅包含基礎的開獎號碼,還涵蓋了本期銷售總額、各獎級的中獎注數以及對應的單注獎金金額,滿足全面的開獎資料展示需求。
請求與返回
請求引數包括彩種標識(如 type 傳入 ssq 代表雙色球)和具體的期號(drawNo)。返回的 JSON 資料中,code 和 name 表示彩種資訊,no 和 date 為期號與開獎日期,number 欄位展示當期開獎號碼,saleAmount 為銷售額,levels 陣列則詳細列出各個獎級的中獎情況。
使用場景
適用於彩票資訊展示網站、便民服務類 App 或生活資訊平臺。可用於為使用者提供歷史開獎資料查詢、當期開獎詳情展示以及中獎金額核對等資訊服務。
使用說明與限制
本介面僅提供公開的彩票開獎資訊查詢,不提供任何形式的彩票預測、薦號或引導投注服務。由於網路或資料來源原因,開獎資料可能會有延遲或後續更正。所有的兌獎操作與規則解釋,請務必以國家彩票發行機構釋出的最新官方公告為準。