Video Search API

Search videos across YouTube and Google Videos with filtering, geographic targeting, and pagination support.

POST/v1/video/*

YouTube 搜索

POST/v1/video/youtube

按关键词搜索 YouTube 视频,支持国家、语言和分页/过滤。

参数

参数类型必填描述
qstring必填搜索关键词
countrystring可选国家代码过滤
languagestring可选语言过滤
spstring可选分页/过滤参数

Google 视频搜索

POST/v1/video/google-videos

在 Google 上搜索视频,支持地理定位、时间过滤、语言设置和安全搜索。

参数

参数类型必填描述
qstring必填搜索关键词
locationstring可选地理定位
languagestring可选语言过滤
pageinteger可选 (默认: 0)分页页码
safestring可选安全搜索设置

响应

Response
{
  "success": true,
  "message": "YouTube search completed successfully",
  "data": {
    "video_results": [
      {
        "title": "Transformers Explained - Machine Learning",
        "channel": "3Blue1Brown",
        "views": "5.2M views",
        "published": "1 year ago",
        "link": "https://youtube.com/watch?v=...",
        "thumbnail": "https://i.ytimg.com/vi/.../hqdefault.jpg"
      }
    ]
  }
}

示例

import requests

API_KEY = "your_api_key_here"
BASE_URL = "https://api.qinyanai.com"

# YouTube search
response = requests.post(
    f"{BASE_URL}/v1/video/youtube",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"q": "transformer architecture explained", "country": "US"}
)

# Google Videos search
response = requests.post(
    f"{BASE_URL}/v1/video/google-videos",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"q": "deep learning tutorial", "language": "en"}
)