PanHub API 文档
网盘搜索服务 API 接口文档

API 概述

PanHub API 提供了强大的网盘搜索功能,支持多个搜索源和插件。通过简单的 HTTP 请求即可获取网盘资源信息。

主要接口:

  • /api/search - 网盘搜索接口,支持 GET 和 POST 请求
  • /api/health - 健康检查接口,返回可用的插件和频道列表
GET/api/search
POST/api/search
GET/api/health

请求参数

参数名类型必填默认值说明
kwstring-搜索关键词
channelsstring[] | string-Telegram 频道列表,支持逗号分隔的字符串或数组
pluginsstring[] | string-插件列表,支持逗号分隔的字符串或数组
cloud_typesstring[] | string-云盘类型过滤,如:aliyun,baidu,onedrive
concnumber10并发数量限制
refreshbooleanfalse是否强制刷新缓存
resstringmerged_by_type响应格式:merged_by_type | results | all
srcstringall搜索源:all | tg | plugin
extobject{}扩展参数,JSON 格式

参数详细说明

channels - Telegram 频道

指定要搜索的 Telegram 频道,支持以下格式:

示例
channels=alipanshare,tgxiazaiyuan
channels=["alipanshare", "tgxiazaiyuan"]

可用的 Telegram 频道列表:(也可以输入其他频道)

tgsearchers3yunpanxunleitianyifcBaiduCloudDisktxtyzypeccxinpdgotopanxingqiump4yunpanqkPanjClubkkxlzybaicaoZYMCPH01share_aliyunbdwpzhpdysxb48jdjdn1111yggpanMCPH086zaihuayunQ66ShareNewAliPanypquarkOscar_4Kmoviesucwpzyalyp_TValyp_4K_MoviesshareAliyunalyp_1dianyingshareQuark_MoviesXiangxiuNBBNewQuarkydypzyfxkuakeyunucquarkxx123panyingshifenxiang123zyfb123tyypzhpdtianyirigengcloudtianyihdhhd21Lsp115oneonefivewpfxMaidanglaocomqixingzhenrentaoxgzytgsearchers115Channel_Shares_115tyysypzypdvip115hotwp123zyyunpan139yunpan189yunpanucyydf_hzlalyp_Animationalyp_JLPleoziyuanAliyunDrive_Share_ChannelaliyunysAliyun_4K_MoviesyunpanpanQuark_Share_ChannelquarksharebaiduyuniAliyunquanziyuanshe

plugins - 搜索插件

可用的搜索插件包括:

labipantajikepanqupansouthepiratebayduoduoxuexizhinanpansearchnyaahunhepan

res - 响应格式

  • merged_by_type - 按类型合并的链接(默认)
  • results - 原始搜索结果
  • all - 包含所有格式的完整响应

src - 搜索源

  • all - 搜索所有源(默认)
  • tg - 仅搜索 Telegram 频道
  • plugin - 仅搜索插件

注意:当 src=tg 时,plugins 参数会被忽略;当 src=plugin 时,channels 参数会被忽略。

请求示例

Health 接口

cURL
curl -X GET "https://your-domain.com/api/health"
JavaScript (fetch)
const response = await fetch('/api/health');
const data = await response.json();
console.log('可用插件:', data.plugins);
console.log('可用频道:', data.channels);
响应示例
{
  "status": "ok",
  "plugins_enabled": true,
  "plugin_count": 10,
  "plugins": ["labi", "panta", "jikepan", "qupansou", "thepiratebay", "duoduo", "xuexizhinan", "pansearch", "nyaa", "hunhepan"],
  "channels": ["tgsearchers3", "yunpanxunlei", "tianyifc", "BaiduCloudDisk", ...]
}

Search GET 请求

cURL
curl -X GET "https://your-domain.com/api/search?kw=电影&channels=alipanshare,tgxiazaiyuan&plugins=hunhepan&res=merged_by_type"
JavaScript (fetch)
const response = await fetch('/api/search?kw=电影&channels=alipanshare,tgxiazaiyuan&plugins=hunhepan&res=merged_by_type');
const data = await response.json();

Search POST 请求

cURL
curl -X POST "https://your-domain.com/api/search" \
  -H "Content-Type: application/json" \
  -d '{
    "kw": "电影",
    "channels": ["alipanshare", "tgxiazaiyuan"],
    "plugins": ["hunhepan"],
    "res": "merged_by_type",
    "refresh": false,
    "ext": {"custom_param": "value"}
  }'
JavaScript (fetch)
const response = await fetch('/api/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    kw: '电影',
    channels: ['alipanshare', 'tgxiazaiyuan'],
    plugins: ['hunhepan'],
    res: 'merged_by_type',
    refresh: false,
    ext: { custom_param: 'value' }
  })
});
const data = await response.json();

响应格式

所有 API 响应都遵循统一的格式:

响应结构
{
  "code": 0,
  "message": "success",
  "data": {
    // 具体数据内容
  }
}

响应类型

merged_by_type 格式 (默认)

{
  "code": 0,
  "message": "success",
  "data": {
    "total": 150,
    "merged_by_type": {
      "aliyun": [
        {
          "url": "https://www.aliyundrive.com/s/xxx",
          "password": "1234",
          "note": "电影资源",
          "datetime": "2024-01-01T12:00:00Z",
          "source": "tg:alipanshare",
          "images": ["https://example.com/image.jpg"]
        }
      ],
      "baidu": [
        {
          "url": "https://pan.baidu.com/s/xxx",
          "password": "5678",
          "note": "电视剧资源",
          "datetime": "2024-01-01T13:00:00Z",
          "source": "plugin:hunhepan"
        }
      ]
    }
  }
}

results 格式

{
  "code": 0,
  "message": "success",
  "data": {
    "total": 150,
    "results": [
      {
        "message_id": "12345",
        "unique_id": "unique_123",
        "channel": "alipanshare",
        "datetime": "2024-01-01T12:00:00Z",
        "title": "电影资源分享",
        "content": "分享一些电影资源...",
        "links": [
          {
            "type": "aliyun",
            "url": "https://www.aliyundrive.com/s/xxx",
            "password": "1234"
          }
        ],
        "tags": ["电影", "高清"],
        "images": ["https://example.com/image.jpg"]
      }
    ]
  }
}

错误码

错误码说明解决方案
400请求参数错误检查必填参数 kw 是否提供,参数格式是否正确
400ext 参数 JSON 格式错误确保 ext 参数是有效的 JSON 格式
500服务器内部错误请联系管理员或稍后重试

在线测试

快速测试

响应结果

点击上方按钮开始测试