100 free credits. No credit card required. Get a key

YouTube hashtag API

The videos or Shorts on a YouTube hashtag page, about 30 a page.

GET /v1/youtube/hashtags/{tag}Beta1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/youtube/hashtags/cooking?type=shorts",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"kind": "youtube#videoListResponse",
"items": [
{
"kind": "youtube#video",
"id": "SN4DrMOH9YM",
"snippet": {
"title": "#funny #comedy #memes #cooking #food",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/SN4DrMOH9YM/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/SN4DrMOH9YM/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/SN4DrMOH9YM/hqdefault.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/SN4DrMOH9YM/sddefault.jpg",
"width": 640,
"height": 480
}
},
"liveBroadcastContent": "none"
},
"isShort": true,
"statistics": {
"viewCount": "5300000"
},
"statisticsAreApproximate": true
},
{
"kind": "youtube#video",
"id": "4WzURM-7Jnk",
"snippet": {
"title": "The Most Satisfying Village Feast Ever 🍴",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/4WzURM-7Jnk/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/4WzURM-7Jnk/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/4WzURM-7Jnk/hqdefault.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/4WzURM-7Jnk/sddefault.jpg",
"width": 640,
"height": 480
}
},
"liveBroadcastContent": "none"
},
"isShort": true,
"statistics": {
"viewCount": "133000000"
},
"statisticsAreApproximate": true
},
"… 1 more"
],
"pageInfo": {
"resultsPerPage": 6
}
}

Parameters

NameTypeDescription
tagpath · requiredstringThe hashtag, with or without #. Example: cooking.
typequery"all" | "shorts"One of all, shorts.
afterquerystringThe previous page’s nextPageToken. Tokens last 6 hours.
Response fields

200 with a YouTubeVideoList, in the shape of YouTube Data API v3 resources.

FieldTypeDescription
kind"youtube#videoListResponse"
itemsYouTubeVideo[]
nextPageTokenstringPass as after for the next page. Absent on the last page. Lasts 6 hours.
pageInfoobject
missingobject[]Batch only: requested ids that did not resolve, and why.
Status codes
StatusMeaning
200A page of tagged videos.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The video, channel, playlist or post does not exist, was removed, or has nothing there.
429Too many requests. Wait for Retry-After seconds.
503YouTube is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

With or without #?

Either.

YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.