API 文档
基于 OpenAPI 规范。覆盖 AI 大模型、文生图、社媒数据等能力; 未接入上游的接口统一返回 data: null,详见 /api/v1/catalog。
计费说明
四大社交平台按返回条数计费(不低于 ¥0.08/条); GPT Image 2 文生图 ¥0.50/张。 余额不足返回 HTTP 402。注册后在钱包生成 API Key 并充值。
| 平台 | slug | 单价 | 计费单位 |
|---|---|---|---|
| 小红书 | xiaohongshu | ¥0.08 | / 条 |
| 抖音 | douyin | ¥0.08 | / 条 |
| 视频号 | channels | ¥0.08 | / 条 |
| 快手 | kuaishou | ¥0.08 | / 条 |
| GPT Image 2 文生图 | gpt-image-2 | ¥0.50 | / 张 |
AI / Agent 接入
将 DataNexus 社媒数据 API 与 GPT Image 2 文生图注册为 Cursor Skill、OpenAI Function 或 MCP Tool。
Cursor Agent Skill(SKILL.md)
---
name: datanexus-social-api
description: 调用 DataNexus 小红书/抖音/视频号/快手数据采集 API,以及 GPT Image 2 文生图。用户询问社媒数据或 AI 生图时使用。
---
# DataNexus API
## 认证
请求头携带:`X-API-Key: dn_live_YOUR_KEY`
Base URL: `https://dataneuxs.icu`
## 计费
- 社媒数据:四大平台 **¥0.08/条**
- 文生图:**¥0.5/张**(gpt-image-2)
- 402 = 余额不足
## 文生图
`POST /api/v1/images/generations`
```json
{
"prompt": "一只在沙滩上的橘猫,写实摄影",
"size": "1024x1024",
"quality": "auto",
"response_format": "url"
}
```
支持尺寸:1024x1024、1536x1024、1024x1536、2048x2048、auto 等(见官方约束)。
```bash
curl -X POST -H "X-API-Key: dn_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"夕阳下的城市天际线","size":"1024x1024"}' \
"https://dataneuxs.icu/api/v1/images/generations"
```
## 社媒平台 slug
| 平台 | slug |
|------|------|
| 小红书 | xiaohongshu |
| 抖音 | douyin |
| 视频号 | channels |
| 快手 | kuaishou |
## 接口
### 作者列表
`GET /api/v1/platforms/{platform}/authors?keyword=关键词&page=1&page_size=20`
### 作者详情
`GET /api/v1/platforms/{platform}/authors/{account_id}`
### 作品列表
`GET /api/v1/platforms/{platform}/works?keyword=关键词&author_id=作者ID&page=1&page_size=20`
### 作品详情
`GET /api/v1/platforms/{platform}/works/{work_id}`
## 示例
```bash
curl -H "X-API-Key: dn_live_YOUR_KEY" \
"https://dataneuxs.icu/api/v1/platforms/xiaohongshu/authors/506931231"
```
## 响应格式
`{ "success": true, "data": { ... } }` 失败时 `{ "success": false, "error": "..." }`
OpenAI Function Calling 定义
[
{
"type": "function",
"function": {
"name": "datanexus_xiaohongshu_authors",
"description": "[小红书] 作者/博主列表(按 keyword 搜索)。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_xiaohongshu_detail",
"description": "[小红书] 作者/博主详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_xiaohongshu_works",
"description": "[小红书] 作品/笔记列表。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_xiaohongshu_detail",
"description": "[小红书] 作品/笔记详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_douyin_authors",
"description": "[抖音] 作者/博主列表(按 keyword 搜索)。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_douyin_detail",
"description": "[抖音] 作者/博主详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_douyin_works",
"description": "[抖音] 作品/笔记列表。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_douyin_detail",
"description": "[抖音] 作品/笔记详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_channels_authors",
"description": "[视频号] 作者/博主列表(按 keyword 搜索)。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_channels_detail",
"description": "[视频号] 作者/博主详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_channels_works",
"description": "[视频号] 作品/笔记列表。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_channels_detail",
"description": "[视频号] 作品/笔记详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_kuaishou_authors",
"description": "[快手] 作者/博主列表(按 keyword 搜索)。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_kuaishou_detail",
"description": "[快手] 作者/博主详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_kuaishou_works",
"description": "[快手] 作品/笔记列表。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_kuaishou_detail",
"description": "[快手] 作品/笔记详情。单价 ¥0.08/条。",
"parameters": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"xiaohongshu",
"douyin",
"channels",
"kuaishou"
],
"description": "平台标识"
},
"id": {
"type": "string",
"description": "作者ID或作品ID(详情接口必填)"
},
"keyword": {
"type": "string",
"description": "搜索关键词(列表接口)"
},
"page": {
"type": "integer",
"description": "页码,默认1"
},
"page_size": {
"type": "integer",
"description": "每页条数,默认20,最大100"
},
"author_id": {
"type": "string",
"description": "按作者筛选作品(仅作品列表)"
}
},
"required": [
"platform",
"id"
]
}
}
},
{
"type": "function",
"function": {
"name": "datanexus_generate_image",
"description": "GPT Image 2 文生图。单价 ¥0.5/张。",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "图像描述提示词"
},
"size": {
"type": "string",
"description": "尺寸,如 1024x1024、auto"
},
"quality": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"auto"
],
"description": "质量档位"
},
"response_format": {
"type": "string",
"enum": [
"url",
"b64_json"
],
"description": "返回格式"
}
},
"required": [
"prompt"
]
}
}
}
]Python 客户端示例
import requests
API_KEY = "dn_live_你的密钥"
BASE = "https://dataneuxs.icu"
def datanexus_get(path: str, params: dict | None = None) -> dict:
r = requests.get(
f"{BASE}{path}",
headers={"X-API-Key": API_KEY},
params=params or {},
timeout=30,
)
body = r.json()
if not body.get("success"):
raise RuntimeError(body.get("error", r.text))
return body["data"]
# 小红书作者详情
author = datanexus_get("/api/v1/platforms/xiaohongshu/authors/506931231")
print(author["nickname"], author["follower_count"])
# 抖音作品列表
works = datanexus_get("/api/v1/platforms/douyin/works", {"keyword": "美食", "page_size": 10})
print(len(works["items"]), "条, 单价 ¥0.08/条")
# GPT Image 2 文生图
img = requests.post(
f"{BASE}/api/v1/images/generations",
headers={"X-API-Key": API_KEY},
json={"prompt": "水墨画风格的山水", "size": "1024x1024"},
timeout=120,
).json()
print(img["data"]["data"][0]["url"], "¥0.5/张")
MCP / 自定义 Agent Tool 注册提示
# MCP / Agent 接入提示
将以下能力注册为 Agent Tool:
1. **datanexus_list_authors** — GET /api/v1/platforms/{platform}/authors
2. **datanexus_get_author** — GET /api/v1/platforms/{platform}/authors/{id}
3. **datanexus_list_works** — GET /api/v1/platforms/{platform}/works
4. **datanexus_get_work** — GET /api/v1/platforms/{platform}/works/{id}
5. **datanexus_generate_image** — POST /api/v1/images/generations(¥0.5/张)
统一请求头: X-API-Key
注册前让用户在 https://dataneuxs.icu/wallet 创建密钥并充值。文生图接口(需 API Key)
POST
/api/v1/images/generationsGPT Image 2 文生图/图生图(¥0.5/张)已支持接口(需 API Key)
GET
/api/v1/platforms/xiaohongshu/authors小红书作者/博主列表(按 keyword 搜索)GET
/api/v1/platforms/xiaohongshu/authors/{id}小红书作者/博主详情GET
/api/v1/platforms/xiaohongshu/works小红书作品/笔记列表GET
/api/v1/platforms/xiaohongshu/works/{id}小红书作品/笔记详情GET
/api/v1/platforms/douyin/authors抖音作者/博主列表(按 keyword 搜索)GET
/api/v1/platforms/douyin/authors/{id}抖音作者/博主详情GET
/api/v1/platforms/douyin/works抖音作品/笔记列表GET
/api/v1/platforms/douyin/works/{id}抖音作品/笔记详情GET
/api/v1/platforms/channels/authors视频号作者/博主列表(按 keyword 搜索)GET
/api/v1/platforms/channels/authors/{id}视频号作者/博主详情GET
/api/v1/platforms/channels/works视频号作品/笔记列表GET
/api/v1/platforms/channels/works/{id}视频号作品/笔记详情GET
/api/v1/platforms/kuaishou/authors快手作者/博主列表(按 keyword 搜索)GET
/api/v1/platforms/kuaishou/authors/{id}快手作者/博主详情GET
/api/v1/platforms/kuaishou/works快手作品/笔记列表GET
/api/v1/platforms/kuaishou/works/{id}快手作品/笔记详情接口概览
GET
/api/v1/platforms支持的平台列表(小红书/抖音/视频号/快手)GET
/api/v1/platforms/{platform}平台详情GET
/api/v1/platforms/xiaohongshu/authors小红书作者列表GET
/api/v1/platforms/xiaohongshu/authors/{id}小红书作者详情GET
/api/v1/platforms/xiaohongshu/works小红书作品列表GET
/api/v1/platforms/xiaohongshu/works/{id}小红书作品详情GET
/api/v1/platforms/douyin/authors抖音作者列表GET
/api/v1/platforms/douyin/authors/{id}抖音作者详情GET
/api/v1/platforms/douyin/works抖音作品列表GET
/api/v1/platforms/douyin/works/{id}抖音作品详情GET
/api/v1/platforms/channels/authors视频号作者列表GET
/api/v1/platforms/channels/authors/{id}视频号作者详情GET
/api/v1/platforms/channels/works视频号作品列表GET
/api/v1/platforms/channels/works/{id}视频号作品详情GET
/api/v1/platforms/kuaishou/authors快手作者列表GET
/api/v1/platforms/kuaishou/authors/{id}快手作者详情GET
/api/v1/platforms/kuaishou/works快手作品列表GET
/api/v1/platforms/kuaishou/works/{id}快手作品详情GET
/api/v1/catalog全量 API 目录(含已上线/预留接口)GET
/api/v1/stats/daily-calls当日 API 总调用量(公开)POST
/api/v1/ai/chat/completionsChat Completions(预留,返回 null)POST
/api/v1/images/generationsGPT Image 2 文生图(¥0.5/张,需 API Key)GET
/api/v1/billing/pricing/{platform}查询平台单价(公开)GET
/api/v1/products获取数据产品列表GET
/api/v1/products/{slug}获取产品详情GET
/api/v1/pricing获取定价方案POST
/api/v1/contact提交商务咨询GET
/health健康检查快速开始
注册后在「钱包」页生成 API Key。作者/作品按条计费(¥0.08/条),文生图 ¥0.50/张(402 表示余额不足)。
# 获取支持的平台(公开,无需 Key)
curl /api/v1/platforms
# 小红书 — 作者列表(需 API Key,¥0.08/条)
curl -H "X-API-Key: dn_live_你的密钥" \
"/api/v1/platforms/xiaohongshu/authors?page=1&page_size=20"
# 抖音 — 作品详情
curl -H "X-API-Key: dn_live_你的密钥" \
/api/v1/platforms/douyin/works/{work_id}
# 查询单价
curl /api/v1/billing/pricing/xiaohongshu
# GPT Image 2 文生图(¥0.50/张)
curl -X POST -H "X-API-Key: dn_live_你的密钥" \
-H "Content-Type: application/json" \
-d '{"prompt":"赛博朋克风格的城市夜景","size":"1024x1024"}' \
/api/v1/images/generations