Appearance
Search by Hashtag
GET /v1/youtube/search/hashtag
Searches YouTube for content matching a specific hashtag and returns matching videos with title, URL, thumbnail, view count (views), publish date, duration, and channel info. Supports pagination via continuationToken and filtering to return all content types or only shorts.
Authentication
All requests require the x-api-key header. Get your key at scrapecreators.com.
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
hashtag | string | yes | Hashtag to search for | funny |
continuationToken | string | no | Continuation token to get more videos. Get 'continuationToken' from previous response. | 4qmFsgKrCBIYVUNkRkpXVWE0M3NtUm00SXBIQnB |
type | enum(all, shorts) | no | Search for all types of content or only shorts | all |
Example Request
curl
bash
curl 'https://api.scrapecreators.com/v1/youtube/search/hashtag?hashtag=funny' \
-H 'x-api-key: $SCRAPECREATORS_API_KEY'Node / TypeScript
js
const params = new URLSearchParams({ hashtag: 'funny' });
const res = await fetch(`https://api.scrapecreators.com/v1/youtube/search/hashtag?${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/hashtag',
headers={'x-api-key': os.environ['SCRAPECREATORS_API_KEY']},
params={'hashtag': 'funny'},
)
r.raise_for_status()
print(r.json())CLI
bash
scrapecreators youtube search-hashtag --helpExample Response
json
{
"videos": [
{
"type": "video",
"id": "jXMISgQq9MM",
"url": "https://www.youtube.com/watch?v=jXMISgQq9MM",
"title": "Epic fails 🤣🤣🤣 #shorts #funny #fails",
"description": "",
"thumbnail": "https://i.ytimg.com/vi/jXMISgQq9MM/hqdefault.jpg?sqp=-oaymwFBCNACELwBSFryq4qpAzMIARUAAIhCGADYAQHiAQoIGBACGAY4AUAB8AEB-AG2CIACgA-KAgwIABABGGUgXyhVMA8=&rs=AOn4CLC1HXfxzLayoVBdicS5DIUQh9zGcQ",
"channel": {
"id": "UCvUzWu1Whyw1FWuLl9GOo_g",
"title": "ZZang Funny",
"thumbnail": "https://yt3.ggpht.com/rcZKcfewHTzkauGknat3NeC53rGBofYDbL8AjFkwvsk2fXzM1clht7OTn9-1IIPnmbeZkrNGdxI=s68-c-k-c0x00ffffff-no-rj"
},
"viewCountText": "22,668,056 views",
"viewCountInt": 22668056,
"publishedTimeText": "4 weeks ago",
"publishedTime": "2025-01-04T23:12:42.919Z",
"lengthText": "1:00",
"lengthSeconds": 60,
"badges": []
}
],
"continuationToken": "4qmFsgLtBRIJRkVoYX...."
}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. |