Install
openclaw skills install caipiao查彩票分类、最新与历史开奖、号码是否中奖等。当用户说:双色球最新开奖号码?大乐透上期结果?或类似彩票开奖问题时,使用本技能。
openclaw skills install caipiao数据由 极速数据(JisuAPI) 提供 — 国内专业的 API 数据服务平台,提供生活常用、交通出行、工具万能等数据接口。
/caipiao/query)/caipiao/history)/caipiao/class)/caipiao/winning)可用于对话中回答「今晚双色球开奖号码是多少」「最近 10 期大乐透号码」「有哪些彩种」「我这注彩票中没中奖」等问题。
# Linux / macOS
export JISU_API_KEY="your_appkey_here"
# Windows PowerShell
$env:JISU_API_KEY="your_appkey_here"
脚本文件:skills/caipiao/caipiao.py
python3 skills/caipiao/caipiao.py class
返回各彩种的 caipiaoid、名称、上级 ID 以及下期开奖时间等。
# 最新一期
python3 skills/caipiao/caipiao.py query '{"caipiaoid":13}'
# 指定期号
python3 skills/caipiao/caipiao.py query '{"caipiaoid":13,"issueno":"2014127"}'
python3 skills/caipiao/caipiao.py history '{"caipiaoid":13,"start":0,"num":10}'
python3 skills/caipiao/caipiao.py winning '{"caipiaoid":11,"number":"02 06 15 25 30 32","refernumber":"08"}'
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| caipiaoid | int | 是 | 彩票 ID |
| issueno | string | 否 | 期号,不传则为当前期 |
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| caipiaoid | int | 是 | 彩票 ID |
| issueno | string | 否 | 期号,不传默认当前期历史向前 |
| num | int | 否 | 获取数量,最大 20,默认 10 |
| start | int | 否 | 起始位置,默认 0 |
无请求参数。
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| caipiaoid | string | 是 | 彩票 ID |
| issueno | string | 否 | 期号,默认最新一期 |
| number | string | 是 | 彩票号码(红球,如 20 03 05 07 22) |
| refernumber | string | 否 | 剩余号码(蓝球等) |
| type | string | 否 | 投注类型(1 直选,2 组三,3 组六) |
{
"caipiaoid": "13",
"issueno": "2014127",
"number": "05 07 10 18 19 21 27",
"refernumber": "28",
"opendate": "2014-10-29",
"deadline": "2014-12-27",
"saleamount": "7482530",
"prize": [
{
"prizename": "二等奖",
"require": "中6+0",
"num": "50",
"singlebonus": "608921"
}
],
"totalmoney": "..."
}
返回对象包含 caipiaoid 和 list,list 中每期包含开奖日期、期号、号码、销售额及奖级列表。
返回彩种数组,每项如:
{
"caipiaoid": 11,
"name": "双色球",
"parentid": 1,
"nextopentime": "2025-03-09 21:30:00",
"nextbuyendtime": "2025-03-09 20:00:00",
"lastissueno": "2025024",
"nextissueno": "2025025"
}
{
"caipiaoid": "11",
"number": "02 06 15 25 30 32",
"refernumber": "08",
"issueno": "2016081",
"winstatus": "0",
"prizename": "二等奖",
"require": "中6+0",
"singlebonus": "239666",
"winnumber": "02 06 15 25 30 32",
"winrefernumber": "07"
}
{
"error": "api_error",
"code": 201,
"message": "彩票ID为空"
}
来源于 极速数据彩票开奖文档:
| 代号 | 说明 |
|---|---|
| 201 | 彩票 ID 为空 |
| 202 | 彩票号码为空 |
| 203 | 不支持的彩种 |
| 210 | 没有信息 |
系统错误码:101 APPKEY 为空或不存在、102 已过期、103 无权限、104 超过次数限制、105 IP 被禁止、106 IP 超限、107 接口维护中、108 接口已停用。
class 找到双色球的 caipiaoid(通常为 11),再调用 query 并格式化展示中奖号码及奖池。 \nhistory 拉取最近若干期数据,提取号码并可视化(折线/表格)。 \nwinning,将用户提供的号码和期号(可选)传入,并根据 winstatus、prizename、singlebonus 给出自然语言反馈。 \nclass,罗列所有 name 与对应 caipiaoid,方便后续对话使用 ID 进行精确查询。极速数据(JisuAPI,jisuapi.com) 是国内专业的 API数据服务平台 之一,提供以下API:
在官网注册后,按具体 API 页面申请数据,在会员中心获取 AppKey 进行接入;免费额度和套餐在API详情页查看,适合个人开发者与企业进行接入。在 ClawHub 上也可搜索 jisuapi 找到更多基于极速数据的 OpenClaw 技能。