Appearance
Search
GET /v1/youtube/search
Searches YouTube by keyword query and returns matching videos, channels, playlists, shorts, shelves, and live streams. Each video result includes title, URL, thumbnail, view count (views), publish date, duration, channel info, and badges. Supports filtering by upload date, sorting by relevance or popularity, and paginating with continuationToken.
Authentication
All requests require the x-api-key header. Get your key at scrapecreators.com.
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
query | string | yes | Search query | |
uploadDate | enum(today, this_week, this_month, this_year) | no | Upload date | |
sortBy | enum(relevance, popular) | no | Sort by | relevance |
type | enum(videos, shorts, channels, playlists) | no | Type of content to search for | videos |
duration | enum(under_3_min, between_3_and_20_min, over_20_min) | no | Duration of the video. Only applies to videos (not shorts). | under_3_min |
region | string | no | 2 letter country code of the country to put the proxy in. | US |
continuationToken | string | no | Continuation token to get more videos. Get 'continuationToken' from previous response. | 4qmFsgKrCBIYVUNkRkpXVWE0M3NtUm00SXBIQnB |
includeExtras | string | no | This will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. This will slow down the response slightly. | false |
Example Request
curl
bash
curl 'https://api.scrapecreators.com/v1/youtube/search?query=<query>' \
-H 'x-api-key: $SCRAPECREATORS_API_KEY'Node / TypeScript
js
const params = new URLSearchParams({ query: '...' });
const res = await fetch(`https://api.scrapecreators.com/v1/youtube/search?${params}`, {
headers: { 'x-api-key': process.env.SCRAPECREATORS_API_KEY }
});
const data = await res.json();
console.log(data);Python
python
import os, requests
r = requests.get(
'https://api.scrapecreators.com/v1/youtube/search',
headers={'x-api-key': os.environ['SCRAPECREATORS_API_KEY']},
params={'query': '...'},
)
r.raise_for_status()
print(r.json())CLI
bash
scrapecreators youtube search --helpExample Response
json
{
"videos": [
{
"type": "video",
"id": "BzSzwqb-OEE",
"url": "https://www.youtube.com/watch?v=BzSzwqb-OEE",
"title": "NF - RUNNING (Audio)",
"thumbnail": "https://i.ytimg.com/vi/BzSzwqb-OEE/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLCasEKav1CLqeSSE2IYDqjGiIMBGw",
"channel": {
"id": "UCoRR6OLuIZ2-5VxtnQIaN2w",
"title": "NFrealmusic",
"handle": "channel/UCoRR6OLuIZ2-5VxtnQIaN2w",
"thumbnail": "https://yt3.ggpht.com/J1_Si0TYNZ-991v09y8RpCh4_Z_ALwKmPgMYnJqjNhoglVtipf3oEN8LpzG1kS0qsv8Jptpmmg=s88-c-k-c0x00ffffff-no-rj"
},
"viewCountText": "14,860,541 views",
"viewCountInt": 14860541,
"publishedTimeText": "2 years ago",
"publishedTime": "2023-05-28T17:08:46.499Z",
"lengthText": "4:14",
"lengthSeconds": 254,
"badges": []
}
],
"channels": [],
"playlists": [],
"shorts": [
{
"type": "short",
"id": "uMNvF-lSCHg",
"url": "https://www.youtube.com/watch?v=uMNvF-lSCHg",
"title": "LONG RUN ROUTINE #run #runvlog #runner #shorts #morning",
"thumbnail": "https://i.ytimg.com/vi/uMNvF-lSCHg/hq720.jpg?sqp=-oaymwFBCNAFEJQDSFryq4qpAzMIARUAAIhCGADYAQHiAQoIGBACGAY4AUAB8AEB-AG2CIACgA-KAgwIABABGFsgXyhlMA8=&rs=AOn4CLA_P-5ExEn9EGLJDNeJedsxb3k1eQ",
"channel": {
"id": "UCGRdcRxpJWi5Q2oDCrMDUuQ",
"title": "Abby and Ryan",
"handle": "abbyandryan",
"thumbnail": "https://yt3.ggpht.com/8UdUEesepx1Ry_rFUPJOJgndTCKno9VTkSysnuJpFjMj63N6av0pNwnqoiKh_7PN2dw7PGIp=s68-c-k-c0x00ffffff-no-rj"
},
"viewCountText": "462,705 views",
"viewCountInt": 462705,
"publishedTimeText": "10 months ago",
"publishedTime": "2024-07-28T17:08:46.498Z",
"lengthText": "0:44",
"lengthSeconds": 44,
"badges": []
}
],
"shelves": [
{
"type": "shelf",
"title": "Shorts",
"items": [
{
"type": "short",
"id": "LLBR5nO05tE",
"url": "https://www.youtube.com/watch?v=LLBR5nO05tE",
"title": "running through walls gone wrong",
"thumbnail": "https://i.ytimg.com/vi/LLBR5nO05tE/oardefault.jpg?sqp=-oaymwEoCJUDENAFSFqQAgHyq4qpAxcIARUAAIhC2AEB4gEKCBgQAhgGOAFAAQ==&rs=AOn4CLCYYIIDmBllgkLP68AjVs25UpyevQ",
"viewCountText": "750K",
"viewCountInt": 750000
}
]
}
],
"lives": [],
"continuationToken": "EooDEg..."
}Credits
Most ScrapeCreators endpoints consume 1 credit per successful response. Some heavier endpoints (transcripts, AI-driven enrichment, ad detail lookups) may cost more. Check GET /v1/credit-balance for your remaining balance.
Errors
| Status | Meaning | Action |
|---|---|---|
| 200 | Success. | Use the JSON payload. |
| 400 | Invalid or missing parameter. | Verify required parameters and value format. |
| 401 | Missing or invalid x-api-key. | Pass a valid API key in the header. |
| 402 | Out of credits. | Top up at scrapecreators.com or wait for plan reset. |
| 404 | Resource not found or private. | Confirm the handle, URL, or id and that the resource is public. |
| 429 | Rate limited. | Backoff and retry with exponential delay. |
| 500 | Server error or upstream platform failure. | Retry with backoff; report persistent errors to support. |