Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

YouTube Video Search

API 文件
https://api.sandbase.ai/v1/api/youtube/web/search-video

Search YouTube videos by keyword and get video ID, title, channel, views, length and publish time, with country, language and upload-date filters and continuation-token pagination.

價格
$0.001美元/次呼叫
方法
POST
回應
JSON
參數
1 個必填 · 4 個選填
每天 100 次免費呼叫每天前 100 次呼叫免費(按組織共用)· 於 UTC 00:00 重設。之後按次收費。

Playground

輸入
Search keyword.
Token to continue fetching search results. Default is None.
Country code, default is us.
Language code, default is en.
Order by, default is this_month, optional values are this_week, this_month, this_year, last_hour, today.
輸出範例
回應outputs · 4.2 KB · 94 行
[
  {
    "data": {
      "continuation_token": "EpsFEglBSSBhZ2VudHMajANFZ1FJQkJBQlNCU0NBUXRrY2xONWRHbEpaVFpLWjRJQkMxUk1PRlkwTVVWaE5tOU5nZ0VMUW0wNE5FSkJkRTltVVhlQ0FRdEZlbEZCWjI1cVZIRXlhNElCQ3pWd0xYTnhPSFl6VDFoM2dnRUxXblpFYTBwelMwVTRNR3VDQVF0TlRrNW1ZWFJmVVZBd1JZSUJDelpaYmt4Q01GaGlWRzVKZ2dFTGJqZEhiRFJNT1hCZmJtLUNBUXQyU2tWNU0yNVFNbDlET0lJQkMxRlVZMXBRU1Mxbk4ybHpnZ0VMU0ZGWWFUUnpibEF6TmttQ0FRczFYMDQ0TkhReGNsVlZNSUlCQzFGNE1HWkRjWEJyUW5WemdnRUxNRU0yZUZsMlVXaHFkMUdDQVF0eFdVNXpPREJHUzBsV1k0SUJDMnhsY3pKNFJuWlpOVlkwZ2dFTE1YcFhObFYxTWpGUk5EQ0NBUXRRZGtkeU4zUnRNRWhsYzRJQkMwZDNYMmh1UkRkdE1EQk5zZ0VHQ2dRSUZCQUOSAv0BL3NlYXJjaD9vcT1BSSBhZ2VudHMmZ3NfbD15b3V0dWJl…",
      "country": "US",
      "estimated_results": 1228716,
      "lang": "en",
      "number_of_videos": 20,
      "query": "AI agents",
      "timezone": "America/New_York",
      "videos": [
        {
          "author": "Jake One Page",
          "category": null,
          "channel_id": "UCyNtWXc9TcDYnDkFj-OTwyg",
          "description": "Claim your FREE $499 Masterclass: Build & Sell Apps, AI Agents & Websites with AI https://mikeyno-code.com/Skool-base44 ...",
          "is_live_content": null,
          "keywords": [],
          "number_of_views": 4532,
          "published_time": "12 hours ago",
          "thumbnails": [
            {
              "height": 202,
              "url": "https://i.ytimg.com/vi/drSytiIe6Jg/hq720.jpg?sqp=-oaymwEgCOgCEMoBSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLCJT2vUgFOF89IEpK7utza4oAO-Qw",
              "width": 360
            },
            {
              "height": 404,
              "url": "https://i.ytimg.com/vi/drSytiIe6Jg/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLBTmIo89x5xD5WVAEGsRtWEWbiE6g",
              "width": 720
            }
          ],
          "title": "The 6 Claude AI Agents to Get You Ahead of 99% of People",
          "type": "NORMAL",
          "video_id": "drSytiIe6Jg",
          "video_length": "40:37"
        },
        {
          "author": "Sandeep Swadia",
          "category": null,
          "channel_id": "UC4ZVkG3RQPzvZk7alIVjcCg",
          "description": "Join my free newsletter: https://sandeepswadia.beehiiv.com/ Take us on your morning run or commute, follow us on Spotify: ...",
          "is_live_content": null,
          "keywords": [],
          "number_of_views": 676977,
          "published_time": "2 weeks ago",
          "thumbnails": [
            {
              "height": 202,
              "url": "https://i.ytimg.com/vi/TL8V41Ea6oM/hq720.jpg?sqp=-oaymwEgCOgCEMoBSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLDnbcj85JpzOWNho3jln9Ny2swnTg",
              "width": 360
            },
            {
              "height": 404,
              "url": "https://i.ytimg.com/vi/TL8V41Ea6oM/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLDdsq1yD_GsWFVG_3O3vX7Xmnugvg",
              "width": 720
            }
          ],
          "title": "4 AI Agents To Automate 99% Of Your Life",
          "type": "NORMAL",
          "video_id": "TL8V41Ea6oM",
          "video_length": "20:47"
        },
        {
          "author": "Dan Martell",
          "category": null,
          "channel_id": "UCA-mWX9CvCTVFWRMb9bKc9w",
          "description": "Get Your FREE AI Company Operating System here: https://go.danmartell.com/3SXCfgk Are you building an AI software ...",
          "is_live_content": null,
          "keywords": [],
          "number_of_views": 332053,
          "published_time": "4 weeks ago",
          "thumbnails": [
            {
              "height": 202,
              "url": "https://i.ytimg.com/vi/Bm84BAtOfQw/hq720.jpg?sqp=-oaymwEgCOgCEMoBSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLAyqa09AO7JqxVrlhAvyH4UHYbfJQ",
              "width": 360
            },
            {
              "height": 404,
              "url": "https://i.ytimg.com/vi/Bm84BAtOfQw/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLB4GmM2ueLj9-ZKhotvmrdcXJbtzw",
              "width": 720
            }
          ],
          "title": "You’re Not Behind (Yet): How to Build Your First AI Agent (Full Guide)",
          "type": "NORMAL",
          "video_id": "Bm84BAtOfQw",
          "video_length": "22:25"
        },
        "… 17 more items in the full response"
      ]
    }
  }
]

範例

選擇一個範例,將其輸入與結果載入 playground。

API README

YouTube Video Search API

This API searches YouTube videos by keyword. It returns a list of matching videos with ID, title, channel, view count, length and publish time. You only need search_query; country, language and time filters are optional.

Use cases

  • Track new videos that mention a brand or topic, such as OpenAI, by searching with order_by set to today or last_hour.
  • Compare view counts across videos on one topic to see which formats and titles get attention.
  • Collect channel_id values from search results to find creators who cover a subject, for sponsorship research.
  • Build a list of video IDs for a keyword, then pull details or comments for each one.

Request

curl -X POST "https://api.sandbase.ai/v1/api/youtube/web/search-video" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"search_query": "OpenAI"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
search_querystringYesSearch keyword.
continuation_tokenstringNoToken to continue fetching search results. Default is None.
country_codestringNoCountry code, default is us.
language_codestringNoLanguage code, default is en.
order_bystringNoOrder by, default is this_month, optional values are this_week, this_month, this_year, last_hour, today.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "continuation_token": "EpUFEgZP…",
  "country": "US",
  "estimated_results": 3200682,
  "lang": "en",
  "number_of_videos": 20,
  "query": "OpenAI",
  "timezone": "America/New_York",
  "videos": [
    {
      "author": "Theo - t3․gg",
      "category": null,
      "channel_id": "UCbRP3c757lWg9M-U7TyEkXA",
      "description": "Just a month after their reduction, OpenAI is doubling the limits of their plans…",
      "is_live_content": null,
      "keywords": [],
      "number_of_views": 19914,
      "published_time": "2 hours ago",
      "thumbnails": [
        {
          "height": 202,
          "url": "https://i.ytimg.com/vi/Hq2c7pww1Ds/hq720_custom_3.jpg?sqp=CPyhptcG-oaymwEcCOgCEM…",
          "width": 360
        }
      ],
      "title": "OpenAI is getting desperate",
      "type": "NORMAL",
      "video_id": "Hq2c7pww1Ds"
    }
  ]
}

Response fields

FieldMeaning
videos[].video_idThe YouTube video ID. Use it to build a watch link or to call other video APIs.
videos[].titleThe video title as shown in search results.
videos[].author / videos[].channel_idThe channel name and the channel ID that published the video.
videos[].number_of_viewsThe view count of the video as a number.
videos[].published_timeRelative publish time as text, such as 2 hours ago or 3 days ago. It is not a timestamp.
videos[].video_lengthThe video length as text, such as 15:50.
videos[].descriptionA short description snippet of the video. It can be an empty string.
videos[].thumbnails[].urlThumbnail image URL. Each entry also has width and height.
estimated_resultsThe estimated total number of results for the query.
continuation_tokenToken that you pass back in the next request to get the next page of results.

Notes

  • Set order_by to one of last_hour, today, this_week, this_month (default) or this_year.
  • To get the next page, send the same request with the continuation_token value from the last response.
  • category, is_live_content and keywords came back as null or empty in this response, so do not rely on them.
  • Pass a channel_id from the results to YouTube Channel Information to get details about the channel.

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相關 APIs

所有 APIs
API價格回應
YouTube每次呼叫 $0.001JSON
YouTube每次呼叫 $0.001JSON
YouTube每次呼叫 $0.001JSON
YouTube每次呼叫 $0.001JSON
YouTube每次呼叫 $0.001JSON
YouTube每次呼叫 $0.001JSON

指南:Best YouTube API in 2026: Pricing Compared

問題

常見問題

我要如何使用 YouTube Video Search API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/youtube/web/search-video。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

YouTube Video Search API 的費用是多少?

每次 $0.001。每個組織每個 UTC 日可免費呼叫 100 次,並可在包含此 API 在內的所有符合資格之 SandBase APIs 間共用;超過後,每次呼叫都會從您的 SandBase 餘額中以此價格計費。沒有訂閱方案。

YouTube Video Search API 接受哪些參數?

必要:search_query (string)。 選填:continuation_token (string), country_code (string), language_code (string) 和 order_by (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

YouTube Video Search API 會回傳什麼?

在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。

我需要 YouTube 開發者帳號或 API 金鑰嗎?

不需要。YouTube Video Search 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 YouTube API 存取權。