此技能用于调用雪球数据接口,获取股票组合、用户信息、行情数据等投资相关数据。
http://localhost:8080/wxpublic_fetchhttps://wxpub.xiongweixp.techapp_id 和 secure_key(在「Skill 技能」页面创建)所有接口都必须包含以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| --- | --- | --- |
app_id | string | 申请的 AppID |
secure_key | string | 对应的 SecureKey |
如果用户未设置 AppID 及 SecureKey:
> 请先前往 https://wxpub.xiongweixp.tech 注册账号,在「Skill 技能」页面获取 app_id 和 secure_key。
用途:根据关键词搜索雪球用户
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"keyword": "天地侠影",
"count": 10,
"page": 1
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
keyword | string | 必填 | 搜索关键词 |
count | int | 10 | 每页条数 |
page | int | 1 | 页码 |
返回字段:用户ID、昵称、粉丝数、简介等
用途:根据关键词搜索投资组合
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"keyword": "实盘",
"count": 10,
"page": 1
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
keyword | string | 必填 | 搜索关键词,如「实盘」「量化」 |
count | int | 10 | 每页条数 |
page | int | 1 | 页码 |
返回字段:组合ID、代码、名称、总收益、年化收益、净值等
用途:根据关键词搜索雪球帖子
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"keyword": "散户老牛",
"count": 10,
"page": 1
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
keyword | string | 必填 | 搜索关键词 |
count | int | 10 | 每页条数 |
page | int | 1 | 页码 |
返回字段:帖子ID、标题、摘要(HTML格式)、发布时间、作者信息、浏览数等
注意:
description 为 HTML 格式(含
等标签),展示前需自行处理target 拼完整 URL:https://xueqiu.com{target}用途:搜索组合并按总收益降序排列,支持收益过滤
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"keyword": "实盘",
"count": 30,
"minTotalGain": 50,
"minAnnualRate": 10,
"topN": 10
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
keyword | string | 必填 | 搜索关键词 |
count | int | 30 | 拉取条数用于排序 |
page | int | 1 | 页码 |
minTotalGain | double | -1 | 最低总收益过滤(%) |
minAnnualRate | double | -1 | 最低年化收益过滤(%) |
topN | int | 10 | 返回前N名 |
用途:获取组合的实时净值和收益数据
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"symbol": "ZH349701"
}
参数说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| --- | --- | --- |
symbol | string | 组合代码,如 ZH349701、SP1008279 |
用途:获取组合的历史净值数据(日频)
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"cubeId": 349603,
"count": 30
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
cubeId | int | 必填 | 组合数字ID(从搜索结果的id字段获取) |
count | int | 30 | 返回天数(最大约365) |
用途:获取组合的详细信息,包括持仓、调仓记录等
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"symbol": "ZH012463"
}
参数说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| --- | --- | --- |
symbol | string | 组合代码 |
返回字段:组合名称、描述、总收益、年化收益、最新持仓、主人信息等
注意:
SP前缀的老组合只返回基础元数据,total_gain/net_value/last_rebalancing 等字段为 null,这是正常行为null 的情况,建议调用时做好空值处理用途:获取某用户创建的所有组合列表
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"userId": 8601813520
}
参数说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| --- | --- | --- |
userId | long | 用户数字ID |
用途:获取用户的原创帖子列表
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"userId": 8601813520,
"page": 1
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
userId | long | 必填 | 用户数字ID |
page | int | 1 | 页码 |
用途:获取组合的历史调仓记录
请求示例:
{
"app_id": "your_app_id",
"secure_key": "your_secure_key",
"cubeId": 12363,
"page": 1,
"count": 10
}
参数说明:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| --- | --- | --- | --- |
cubeId | int | 必填 | 组合数字ID |
page | int | 1 | 页码 |
count | int | 10 | 每页条数 |
返回字段:调仓时间、现金比例、股票变动明细(股票名称、代码、权重变化、价格等)
注意:每条调仓记录只包含当次变动的股票
所有错误返回格式:{"error": "..."}
| 状态码 | 含义 | 处理建议 |
|---|---|---|
| --- | --- | --- |
| 400 | 参数错误 | 检查必填参数是否完整 |
| 401 | 凭证无效 | 检查app_id和secure_key |
| 402 | 余额不足 | 前往 https://wxpub.xiongweixp.tech 充值后重试 |
| 404 | 方法不存在 | 检查接口路径 |
| 429 | 请求过多 | 稍后重试 |
| 500 | 服务器错误 | 联系管理员 |
| 502 | 上游雪球调用失败 | 稍后重试,自动退款 |
| 503 | 排队超时 | 稍后重试 |
当用户提出以下需求时,应调用此技能:
searchUser 或 searchCubesearchStatus 按关键词查找帖子searchCubeRanked 筛选高收益组合getCubeQuote 查看组合当前净值getCubeNavHistory 获取净值曲线getCubeInfo 获取完整信息getUserCubes 查看某用户的所有组合getUserTimeline 获取用户帖子getCubeRebalancing 追踪调仓历史# 搜索帖子
curl -X POST https://wxpub.xiongweixp.tech/xueqiu/searchStatus \
-H "Content-Type: application/json" \
-d '{"app_id":"ak_xxx","secure_key":"yyy","keyword":"散户老牛","count":10,"page":1}'
# 搜索组合
curl -X POST https://wxpub.xiongweixp.tech/xueqiu/searchCube \
-H "Content-Type: application/json" \
-d '{"app_id":"ak_xxx","secure_key":"yyy","keyword":"实盘","count":10,"page":1}'
# 组合排行 Top 5
curl -X POST https://wxpub.xiongweixp.tech/xueqiu/searchCubeRanked \
-H "Content-Type: application/json" \
-d '{"app_id":"ak_xxx","secure_key":"yyy","keyword":"实盘","count":30,"topN":5}'
# 组合详情
curl -X POST https://wxpub.xiongweixp.tech/xueqiu/getCubeInfo \
-H "Content-Type: application/json" \
-d '{"app_id":"ak_xxx","secure_key":"yyy","symbol":"ZH012463"}'
# 调仓历史
curl -X POST https://wxpub.xiongweixp.tech/xueqiu/getCubeRebalancing \
-H "Content-Type: application/json" \
-d '{"app_id":"ak_xxx","secure_key":"yyy","cubeId":12363,"page":1,"count":5}'
共 2 个版本