lottery-winning-numbers-query
Lottery Winning Numbers Query
Query single-draw lottery results by lottery type and optional draw number. If no draw number is provided, it defaults to returning the latest winning numbers and draw time.
Usage Cost
5 coins/call
Quick Start
Use a unified response envelope and call directly from your backend.
https://openapi.toolkk.com/v1/lottery-winning-numbers-querycURL Example
curl --request POST \
--url 'https://openapi.toolkk.com/v1/lottery-winning-numbers-query' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "type": "ssq",\n "expect": "2026082"\n}'Python Example
import os
import requests
url = "https://openapi.toolkk.com/v1/lottery-winning-numbers-query"
payload = {
"type": "ssq",
"expect": "2026082"
}
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 Example
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/lottery-winning-numbers-query"
payload := []byte("{\n \"type\": \"ssq\",\n \"expect\": \"2026082\"\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 Example
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 \"expect\": \"2026082\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/lottery-winning-numbers-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 Example
<?php
$endpoint = 'https://openapi.toolkk.com/v1/lottery-winning-numbers-query';
$payload = "{\n \"type\": \"ssq\",\n \"expect\": \"2026082\"\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;Response Example
{
"expect": "2026082",
"openCode": "05,07,10,14,21,28+04",
"name": "双色球",
"type": "ssq",
"time": "2026-07-19 21:15:00"
}Examples illustrate the response structure. Actual results depend on the API response.
- Authentication
- Send X-API-Key in request headers
- Rate limit
- 30 req/min
- Timeout
- 15000 ms
Send your API Key in the X-API-Key header from your backend.
Check both HTTP status and business fields before treating a call as successful.
Use retries and backoff together with rate limits in high-frequency scenarios.
Request Fields
Send requests from your server with the key in the X-API-Key header.
Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| type | string | Unspecified | Unspecified | ssq |
| expect | string | Unspecified | Unspecified | 2026082 |
Request Example
{
"type": "ssq",
"expect": "2026082"
}- Authentication
- Send X-API-Key in request headers
- Rate limit
- 30 req/min
- Timeout
- 15000 ms
Response Fields
Examples illustrate the response structure. Actual results depend on the API response.
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| expect | string | Unspecified | Unspecified | 2026082 |
| openCode | string | Unspecified | Unspecified | 05,07,10,14,21,28+04 |
| name | string | Unspecified | Unspecified | 双色球 |
| type | string | Unspecified | Unspecified | ssq |
| time | string | Unspecified | Unspecified | 2026-07-19 21:15:00 |
Response Example
{
"expect": "2026082",
"openCode": "05,07,10,14,21,28+04",
"name": "双色球",
"type": "ssq",
"time": "2026-07-19 21:15:00"
}$.code == 200API overview
Capabilities, use cases, limitations, and frequently asked questions.
API Capabilities
The Lottery Winning Numbers Query API provides a lightweight service for retrieving lottery draw results. Developers can quickly query the winning numbers for a specific draw by providing the lottery code and draw number. If no draw number parameter is provided in the request, the API will automatically return the latest winning numbers and draw time for that lottery type, making it convenient to get real-time draw updates.
Request and Response
When requesting, you need to provide the lottery type (type, e.g., ssq) and an optional draw number (expect). In the response, expect is the actual queried draw number, openCode contains the formatted winning numbers (e.g., red and blue balls separated by special symbols), name and type are the lottery name and code, and time is the specific draw time for that period.
Use Cases
Suitable for utility mini-programs, news sidebar widgets, or personal convenience query tools that need to quickly display the latest winning numbers. Primarily used to help users quickly verify if their ticket numbers match the winning numbers.
Usage Instructions and Limitations
This API is solely for objectively displaying publicly released lottery winning numbers and absolutely does not provide any prediction, number selection analysis, or betting guidance functions. Query results are for information verification reference only. In case of data delays or inconsistencies, please refer to the information officially published by the China Welfare Lottery or Sports Lottery as the final basis.