Skip to Content

Hashtag Posts

A hashtag's videos or Shorts, about 36 a page.

GET
/v1/youtube/hashtag/posts

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

name?string

The hashtag, with or without #.

url?string

Its page's link, instead of name.

shorts?boolean

Its Shorts alone.

cursor?string

nextCursor of the previous page.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.

data*array<>
pagination*
Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.youtube.hashtagPosts({ name: "cooking" });
Example Response
{  "data": [    {      "id": "y9K0aFv7xzU",      "url": "https://www.youtube.com/watch?v=y9K0aFv7xzU",      "text": null,      "createdAt": null,      "author": {        "id": "UCI78AdiI6f7VKhqW1i4B3Rw",        "username": "",        "displayName": "Zach Choi",        "avatarUrl": "https://yt3.ggpht.com/ytc/AIdro_nv3K8KG6LvfLVy_U1RS77IdrpBcRs_08kB-bOymm3dlKot=s68-c-k-c0x00ffffff-no-rj",        "verified": false,        "url": "https://www.youtube.com/channel/UCI78AdiI6f7VKhqW1i4B3Rw"      },      "stats": {        "views": 726446,        "likes": null,        "comments": null,        "shares": null,        "saves": null,        "engagementRate": null      },      "media": [        {          "kind": "video",          "url": null,          "thumbnailUrl": "https://i.ytimg.com/vi/y9K0aFv7xzU/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARh_ID0oHTAP&rs=AOn4CLDPj4WGGyyXVsZCxITFsJ1-0JNeCA",          "width": null,          "height": null,          "durationSeconds": 28        }      ],      "hashtags": [],      "mentions": [],      "ext": {        "kind": "video",        "title": "would you eat this? #asmr #cooking (#recipe in description)",        "durationSeconds": 28,        "publishedText": "5 days ago",        "category": null,        "keywords": [],        "chapters": [],        "music": [],        "liveNow": false,        "unlisted": false,        "familySafe": null,        "membersOnly": false,        "channelSubscribers": null      }    },    {      "id": "ujuyFehC6do",      "url": "https://www.youtube.com/watch?v=ujuyFehC6do",      "text": null,      "createdAt": null,      "author": {        "id": "UCh9hXCt6UfiOge6r7RZrU3A",        "username": "",        "displayName": "Mama J Rae",        "avatarUrl": "https://yt3.ggpht.com/RDg2CpT8FCeOcQRYL2Elh455iUrwC8Ma1QYRd0-Kb_-uL5blsz6d3zL4RXzYFPTJnzvhlcsRdQ=s68-c-k-c0x00ffffff-no-rj",        "verified": false,        "url": "https://www.youtube.com/channel/UCh9hXCt6UfiOge6r7RZrU3A"      },      "stats": {        "views": 4443589,        "likes": null,        "comments": null,        "shares": null,        "saves": null,        "engagementRate": null      },      "media": [        {          "kind": "video",          "url": null,          "thumbnailUrl": "https://i.ytimg.com/vi/ujuyFehC6do/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIFYoSTAP&rs=AOn4CLCCbRBYlMqHJKVc5-vGedtrouoRrA",          "width": null,          "height": null,          "durationSeconds": 177        }      ],      "hashtags": [],      "mentions": [],      "ext": {        "kind": "video",        "title": "Meatloaf & Mashed Potatoes! 🍽 #Cooking #Dinner #EasyRecipe",        "durationSeconds": 177,        "publishedText": "1 year ago",        "category": null,        "keywords": [],        "chapters": [],        "music": [],        "liveNow": false,        "unlisted": false,        "familySafe": null,        "membersOnly": false,        "channelSubscribers": null      }    }  ],  "pagination": {    "nextCursor": "4qmFsgKzBRIJRkVoYXNodGFnGo4FQ0NGNjB3TkRRMUZSUVVKcFlsOUplbXQxYzJsamJUVlZRa2ROTjNZMVRUZDZPVGMyZEZob2FtVjZXbXBvTm1VelZXb3dPRmwwZFdKemREZHBRbWN0VTJ0QlVtcHBhazUxU0d4MFJFMDFhMjlaTVhGWVlXNXdja3B2WW1GTFFWSnFVR3RQTWpWZk5GYzNlRmhWV1c1bExTMHlUblU1ZURVMVYwZFBhWGd0VFhwUmJITjFhRWRTYW5sMlRXVnRjbU5oUmpneVkxbHJkVFpUY0RSbWJERTBSSE5CVW1waWFuRklMUzA1Ukd0MVFXdFpNR1l0UmpoMmVuTTFjRlUwUjFCaU16RTRYMXB6T1ZOTU4yZEZXVEp5UkdN…",    "hasMore": true  }}