Youtube 接口

Youtube 接口

DATA BLUEPRINT 1,520 2023-07-01

接口说明

  • 请求需带上参数token,每个用户有唯一的token。
  • 所有接口均返回json格式,其中参数message表示是否请求成功.
  • 当返回message!="请求成功"时,可以参考返回的message字段,排查错误原因
  • 一般来说,接口只要返回cost=true,就表示请求有效,会进行收费,比如用户不存在,此时请不要再重试了,这种情况一般是请求资源已经失效(404)。
  • youtube接口请求延时较长,建议timeout设置为30秒,否则可能会出现请求超时但实际请求成功导致账号扣费的场景。

测试token

token: 请联系管理员开通 q:1098441010 vx:pchell11

余额查询

  • 请求示例
    http://43.134.116.51:10002/youtube/get_user_balance/?token=
    
  • 参数说明
    参数名 说明
    token 鉴权参数
  • 响应:
    {
        "cost": false,
        "data": {
            "count": 9999.0
        },
        "message": "请求成功"
    }
    

用户信息

  • 请求示例
    http://43.134.116.51:10002/youtube/user_info/?token=&user_name=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    user_name 用户名,示例:https://www.youtube.com/@cnliziqi 取用户名,cnliziqi,注意不要带@
  • 响应:
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    

用户视频列表

  • 请求示例
    http://43.134.116.51:10002/youtube/user_video/?token=&user_name=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    user_name 用户名,示例:https://www.youtube.com/@cnliziqi 取用户名,cnliziqi,注意不要带@
    cursor 翻页参数从上一页获取,取在每页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据发布时间排序

用户Short列表

  • 请求示例
    http://43.134.116.51:10002/youtube/user_shorts/?token=&user_name=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    user_name 用户名,示例:https://www.youtube.com/@cnliziqi 取用户名,cnliziqi,注意不要带@
    cursor 翻页参数从上一页获取,取在每页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据发布时间排序

频道信息

  • 请求示例
    http://43.134.116.51:10002/youtube/channel_info/?token=&channel_id=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    channel_id 频道id,示例:https://www.youtube.com/channel/UCVB5RmRmS7XVGpaEAfqUv5g 取频道id,UCVB5RmRmS7XVGpaEAfqUv5g
  • 响应:
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    

频道视频列表

  • 请求示例
    http://43.134.116.51:10002/youtube/channel_video/?token=&channel_id=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    channel_id 频道id,示例:https://www.youtube.com/channel/UCVB5RmRmS7XVGpaEAfqUv5g 取频道id,UCVB5RmRmS7XVGpaEAfqUv5g
    cursor 翻页参数从上一页获取,取在每页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据发布时间排序

搜索(全部)

  • 请求示例
    http://43.134.116.51:10002/youtube/search_all/?token=&keyword=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    Keyword 搜索关键词
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据发布时间排序

搜索(视频)

  • 请求示例
    http://43.134.116.51:10002/youtube/search_video/?token=&keyword=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    Keyword 搜索关键词
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据系统默认排序

搜索(Shorts)

  • 请求示例
    http://43.134.116.51:10002/youtube/search_shorts/?token=&keyword=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    Keyword 搜索关键词
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据系统默认排序

话题(全部)

  • 请求示例
    http://43.134.116.51:10002/youtube/tag_all/?token=&tag_name=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    tag_name 话题名称,注意不需要带 #
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据系统默认排序

话题(Shorts)

  • 请求示例
    http://43.134.116.51:10002/youtube/tag_shorts/?token=&tag_name=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    tag_name 话题名称,注意不需要带 #
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    根据系统默认排序

视频详情

  • 请求示例
    http://43.134.116.51:10002/youtube/video_detail/?token=&video_id=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    video_id 视频id,示例:https://www.youtube.com/watch?v=JJL3ZKrHeKM 取video_id,JJL3ZKrHeKM
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    

Shorts详情

  • 请求示例
    http://43.134.116.51:10002/youtube/shorts_detail/?token=&shorts_id=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    shorts_id Shorts id,示例:https://www.youtube.com/shorts/4pvXgOUHja4 取shorts_id,4pvXgOUHja4
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    

视频评论

  • 请求示例
    http://43.134.116.51:10002/youtube/video_comment/?token=&video_id=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    video_id 视频id,示例:https://www.youtube.com/watch?v=JJL3ZKrHeKM 取video_id,JJL3ZKrHeKM
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    按照热度排序

视频二级评论

  • 请求示例
    http://43.134.116.51:10002/youtube/video_reply/?token=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    cursor 一级评论中的continuationCommand,当需要翻页时这个参数取上一页二级评论最末记录中的continuationCommand
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    按照系统默认时间排序

Shorts评论

  • 请求示例
    http://43.134.116.51:10002/youtube/shorts_comment/?token=&shorts_id=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    shorts_id Shorts id,示例:https://www.youtube.com/shorts/4pvXgOUHja4 取shorts_id,4pvXgOUHja4
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    按照热度排序

Shorts二级评论

  • 请求示例
    http://43.134.116.51:10002/youtube/shorts_reply/?token=&cursor=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    cursor 一级评论中的continuationCommand,当需要翻页时这个参数取上一页二级评论最末记录中的continuationCommand
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
  • 说明

    按照系统默认时间排序

下载

  • 请求示例
    http://43.134.116.51:10002/youtube/video_download/?token=&video_id=
    
  • 参数说明
    参数 说明
    token 鉴权参数
    video_id 视频id,示例:https://www.youtube.com/watch?v=JJL3ZKrHeKM 取video_id,JJL3ZKrHeKM
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    

视频推荐列表

http://43.134.116.51:10002/youtube/video_recommend_list/?token=&video_id=&cursor
  • 参数说明
    参数 说明
    token 鉴权参数
    video_id 视频id,示例:https://www.youtube.com/watch?v=JJL3ZKrHeKM 取video_id,JJL3ZKrHeKM
    cursor 翻页参数从上一页获取,取在上一页最末记录中的continuationCommand里面的token,默认为空返回第一页数据
  • 响应
    {
         "cost": true,
         "data": {
              ... # youtube数据
         },
         "message": "请求成功"
    }
    
    • 注意事项

    使用get方式请求接口时,由于cursor过长,导致url超过5120字符会出现 Request Line is too large,可以改用post请求方式,单独把cursor放入body中既可