Youtube Video Search
Youtube Video Search is used to retrieve YouTube video search results by keyword.
- Search YouTube videos by keyword
- Support region-based results
- Support pagination through
continuation - Return video list data and the next continuation token
Use XCrawl to Fetch Youtube Video Search Results
Usage
curl -s -X POST 'https://run.xcrawl.com/v1/data' \
-H 'Authorization: Bearer $XCRAWL_API_KEY'\
-H 'Content-Type: application/json' \
-d '{
"engine": "youtube_video_search",
"keyword": "coffee",
"location": "US",
"continuation": "xxxx"
}'Request parameter notes:
enginemust beyoutube_video_searchkeywordspecifies the search termlocationspecifies the target regioncontinuationis used to fetch the next page of results
Response Example
{
"result": [
{
"video_list": [
{
"video_id": "DzLgJg4uAng",
"push_time": "6 months ago",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi/DzLgJg4uAng/hq720.jpg",
"width": 360,
"height": 202
}
],
"video_user": "Karl Conrad",
"video_title": "14\" MacBook Pro M4 Pro UNBOXING (Space Black)",
"video_length": "0:19",
"video_view_count": "1,502,716 views",
"video_user_sort_url": "/@KarlConrad"
}
],
"continuation": "EqADEgdt....."
}
]
}Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
location | string | Specifies the target region. |
keyword | string | Specifies the search keyword. |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
continuation | string | Continuation token for the next page of results. |
Parameter Notes
locationdefaults toUSlocationsupports multiple region values such asUS,HK,CA,AD, andAEkeyworddefaults tocoffeecontinuationdefaults to an empty string
Response Fields
Response data is returned under result[].
| Field | Type | Description |
|---|---|---|
video_list | array | List of video results. |
continuation | string | Continuation token for the next page of results. |
Video Fields
Each item in video_list[] includes:
| Field | Type | Description |
|---|---|---|
video_id | string | YouTube video ID. |
push_time | string | Relative publish time. |
thumbnail | array | Thumbnail list. |
video_user | string | Channel name. |
video_title | string | Video title. |
video_length | string | Video duration. |
video_view_count | string | Total video views. |
video_user_sort_url | string | Channel short URL path. |
Thumbnail Fields
Each item in thumbnail[] includes:
| Field | Type | Description |
|---|---|---|
url | string | Thumbnail URL. |
width | number | Thumbnail width in pixels. |
height | number | Thumbnail height in pixels. |
