YouTube videos by hashtag API
  1. Docs
  2. YouTube
  3. YouTube videos by hashtag API

YouTube videos by hashtag API

Videos (or Shorts) on a hashtag's page.

GET /v1/youtube/search/hashtag

GET /v1/youtube/search/hashtag

Videos (or Shorts) on a hashtag's page. The all tab holds about 30 videos and usually no next page; the short tab pages with cursor.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
hashtagstringyesHashtag, with or without #.
typestringnoKind of result. One of all, short. Also accepted values: shorts for short.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/youtube/search/hashtag" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "hashtag=minecraft"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_1f827a4f0a9a06a75bba3a8b",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "youtube",14        "id": "PkI-vfHANSE",15        "url": "https://www.youtube.com/watch?v=PkI-vfHANSE",16        "type": "video",17        "author": {18          "id": "UC0h07r_UgTD0Tc-Dn5XLX3g",19          "handle": null,20          "name": "Wisp",21          "url": "https://www.youtube.com/channel/UC0h07r_UgTD0Tc-Dn5XLX3g",22          "avatar_url": null,23          "verified": true24        },25        "title": "Minecraft, But Fishing Drops Custom Items...",26        "text": null,27        "published_at": "2026-10-29T00:00:00Z",28        "duration_seconds": 2376.0,29        "language": null,30        "hashtags": null,31        "mentions": null,32        "stats": {33          "views": 475245,34          "likes": null,35          "comments": null,36          "shares": null,37          "saves": null,38          "dislikes": null39        },40        "media": {41          "thumbnail_url": "https://i.ytimg.com/vi/PkI-vfHANSE/hq2.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBvwWMnkOQPKX7UyJXSmA1PjZWcfA",42          "video_url": null,43          "audio_url": null,44          "image_urls": null,45          "width": null,46          "height": null47        },48        "song": null,49        "location": null,50        "is_pinned": null,51        "is_sponsored": null,52        "extra": {53          "published_at_approximate": true,54          "published_text": "1 day ago",55          "views_text": "475,245 views"56        }57      },58      {59        "object": "post",60        "platform": "youtube",61        "id": "UJXwiq0AnW4",62        "url": "https://www.youtube.com/watch?v=UJXwiq0AnW4",63        "type": "video",64        "author": {65          "id": "UCWVSknuLPIRVGWf-4bFKT4Q",66          "handle": null,67          "name": "Johnny Minecraft",68          "url": "https://www.youtube.com/channel/UCWVSknuLPIRVGWf-4bFKT4Q",69          "avatar_url": null,70          "verified": true71        },72        "title": "Hiding in a SECRET BASE INSIDE the TOILET in Minecraft",73        "text": null,74        "published_at": "2026-10-29T18:00:00Z",75        "duration_seconds": 807.0,76        "language": null,77        "hashtags": null,78        "mentions": null,79        "stats": {80          "views": 81512,81          "likes": null,82          "comments": null,83          "shares": null,84          "saves": null,85          "dislikes": null86        },87        "media": {88          "thumbnail_url": "https://i.ytimg.com/vi/UJXwiq0AnW4/hq2.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAlD9UeQyyO3xbKOCesoAfzKuw9xg",89          "video_url": null,90          "audio_url": null,91          "image_urls": null,92          "width": null,93          "height": null94        },95        "song": null,96        "location": null,97        "is_pinned": null,98        "is_sponsored": null,99        "extra": {100          "published_at_approximate": true,101          "published_text": "8 hours ago",102          "views_text": "81,512 views"103        }104      }105    ],106    "cursor": null,107    "has_more": false,108    "parent": null109  },110  "cursor": null,111  "has_more": false112}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.