API 文档
公开、免费、CORS 全开、无需认证,支持 If-None-Match ETag 协商缓存。数据每日 08:18 自动同步。
基础信息
- Base URL:
https://dsh-go.pages.dev - 规范文件:/openapi.json(可导入 Postman / Apifox)
- 数据新鲜度:/api/v1/meta
- 速率限制:每 IP 每 10 秒 20 次(Cloudflare WAF 免费规则)
端点一览
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /api/v1/plugins | 插件列表(过滤/搜索/排序/分页) |
| GET | /api/v1/plugins/:slug | 单个插件详情 + 相关推荐 |
| GET | /api/v1/categories | 分类注册表(含计数) |
| GET | /api/v1/stats | 聚合统计 + Top 榜单 |
| GET | /api/v1/search?q=关键词 | 快速搜索(q 必填) |
| GET | /api/v1/meta | 同步元信息(供监控) |
| GET | /api/v1/health | 健康检查 |
| POST | /api/v1/mcp | MCP 端点(JSON-RPC 2.0,AI Agent 查询) |
常用参数(/api/v1/plugins)
| 参数 | 说明 |
|---|---|
category | 分类 id,如 web-ui、mcp、skills |
verified | true 仅含已验证插件 |
search | 关键词(匹配名称/描述/标签) |
sort | stars | trend | updated | created | name |
order | asc | desc,默认 desc |
page | 页码,默认 1 |
per_page | 每页数量,默认 50,最大 200 |
created_after / updated_after | 按时间过滤(ISO 时间字符串) |
调用示例
curl "https://dsh-go.pages.dev/api/v1/plugins?category=web-ui&verified=true&sort=stars"
curl "https://dsh-go.pages.dev/api/v1/search?q=vision&limit=10"
curl -H "If-None-Match: a1b2c3d4e5f60718" https://dsh-go.pages.dev/api/v1/plugins
curl -X POST https://dsh-go.pages.dev/api/v1/mcp -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_plugins","arguments":{"q":"agent"}}}' 响应格式
列表端点返回 { meta, pagination, plugins };详情返回 { plugin, related, meta };错误统一为 { error: { code, message } }。
数据下载与订阅
- 原始全量数据:/catalog/plugins.json
- RSS 订阅:/feed.xml
MCP 接入(Claude Desktop)
在 Claude Desktop 配置文件中添加以下 MCP Server,即可让 Claude 直接查询 DSH 插件目录:
// ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"dsh-go": {
"url": "https://dsh-go.pages.dev/api/v1/mcp",
"transport": "streamable-http"
}
}
} 带 ETag 的增量轮询(节省流量)
客户端缓存 ETag,下次请求带 If-None-Match,数据未变时服务器返回 304 而不传输任何内容。
// 浏览器 / Node.js(把 API_BASE 换成实际的 Base URL)
let etag = null, cache = null;
async function getPlugins(params) {
const headers = {};
if (etag) headers['If-None-Match'] = etag;
const res = await fetch('https://dsh-go.pages.dev/api/v1/plugins?' + params, { headers });
if (res.status === 304) return cache;
etag = res.headers.get('ETag');
cache = await res.json();
return cache;
}