querystring必填
The video search query.
https://api.sandbase.ai/v1/api/google/videosSearch Google for video results (YouTube and others) with title, link, thumbnail, and source.
您的输出将显示在这里
完成输入,然后点击运行。
Returns Google video search results for a text query. Each result has a title, link, position, snippet, and thumbnail image. The only required input is query.
timeframe to 7d or 1y.curl -X POST "https://api.sandbase.ai/v1/api/google/videos" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"gl": "us", "hl": "en", "query": "lofi hip hop"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The video search query. |
autocorrect | boolean | No | Toggle Google spelling autocorrect (default true). Set false to search the exact query without correction. |
gl | string | No | Two-letter country code for result localization (e.g. us, gb, de). |
hl | string | No | Two-letter interface and results language code (e.g. en, es, de). |
location | string | No | Fine-grained location for result localization, given as a canonical Google location string (e.g. 'New York, United States', 'London, United Kingdom'). More specific than the country-level gl. |
requireFields | array | No | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example source, and it is served only by a source that returns every one of |
timeframe | string | No | Restrict results to a recent time window: 1h, 1d, 7d, 1y, or all. Default all (no time restriction). |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"query": "lofi hip hop",
"results": [
{
"image": "",
"link": "https://www.youtube.com/watch?v=rFZHOHl-L8A",
"position": 1,
"snippet": "Spooky season is officially upon us 2026 Halloween playlist available now: https…",
"title": "lofi hip hop radio beats to relax/study to"
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.query | The search query that Google ran. It can differ from your input if autocorrect changed it. |
data.results[].position | Rank of the video in the result list, starting at 1. |
data.results[].title | Title of the video result. |
data.results[].link | URL of the video page, such as a YouTube watch link. |
data.results[].snippet | Text shown under the result. It can include the description start, the site name, the channel name, and a date. |
data.results[].image | Thumbnail of the video. It is either an empty string or an inline base64 data:image/jpeg value. |
found | true when the search returned results. |
source field is not in this response. Pass requireFields: ["source"] if you need it. This can change the price.snippet, after the description text.gl, hl, and location to localize results. Use location for city-level targeting.Billed at the actual cost of each call, about $0.00085 for the request above. Failed calls are not charged.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/google/videos" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gl": "us",
"hl": "en",
"query": "lofi hip hop"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
querystring必填The video search query.
glstringTwo-letter country code for result localization (e.g. us, gb, de).
默认值:"us"
hlstringTwo-letter interface and results language code (e.g. en, es, de).
默认值:"en"
locationstringFine-grained location for result localization, given as a canonical Google location string (e.g. 'New York, United States', 'London, United Kingdom'). More specific than the country-level gl.
timeframestringRestrict results to a recent time window: 1h, 1d, 7d, 1y, or all. Default all (no time restriction).
可选值:1h, 1d, 7d, 1y, all
autocorrectbooleanToggle Google spelling autocorrect (default true). Set false to search the exact query without correction.
requireFieldsarrayOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `source`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a record that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
这是该 API 保存的示例响应;查看时不会发起实时请求。
尚未发布已保存的响应。请在 Playground 中运行 API 以查看其响应。
探索更多
| API | 价格 | 响应 |
|---|---|---|
Google Videos此 API Google | 每次调用从 $0.00085 起 | JSON |
Google | $0.01 每次调用 | JSON |
Google | $0.015 每次调用 | JSON |
Google | 每次调用从 $0.002 起 | JSON |
Google | 每次调用从 $0.0015 起 | JSON |
Google | $0.01 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/google/videos 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
起价每次调用 $0.00085,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:query (string)。 可选:gl (string), hl (string), location (string), timeframe(1h, 1d, 7d, 1y, all 之一), autocorrect (boolean) 和 requireFields (array)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Google Videos 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Google API 访问权限。