YouTube Hashtag API

Read the videos and Shorts on a YouTube hashtag page by hashtag, in the order YouTube shows them. Each row is one item: id, url, title, author_name, view_count, duration, published_text, for $0.79 per 1,000 calls.

  • hashtag can be written with or without #, or be a hashtag page link; case does not matter
  • First-page rows also carry hashtag_name, hashtag_video_count and hashtag_channel_count, where the video and channel counts are the approximate figures on the YouTube page
  • Failed calls and empty results are not charged.

API health

24h health
Normal
  • Healthy / normal
  • Available
Normal

Last 24 hours

Last 30 days

  1. 1Request

    POST /api/v1/social
    {
      "platform": "youtube",
      "action": "hashtag",
      "params": {
        "hashtag": "cooking"
      }
    }
  2. 2JSON response

    {
      "results": [
        {
          "type": string,
          "title": string,
          "text": string,
          "author_name": string
        },
        …
      ]
    }
  3. 3Rows

    typetitletextauthor_name
    stringstringstringstring
  4. 4CSV

    youtube-hashtag-sample.csv type,id,url,title,text,author_name,author_username,author_id,author_url,author_avatar_url,author_is_verified,view_count,view_count_estimated,duration,published_text,thumbnail_url,preview_url,badges,is_live,is_upcoming,hashtag_name,hashtag_video_count,hashtag_video_count_estimated,hashtag_channel_count,hashtag_channel_count_estimated,platform

A request with hashtag (plus optional country and language, and page_token for later pages) goes in, and one page of videos and Shorts comes back; each row in results is one item, listed as a field table and a CSV file.

What data you get

Each row is one video or Short from the hashtag page. This endpoint has no public real sample yet. The table lists the fields, types and meanings that each row returns, with no values.

FieldTypeMeaning
typestringRecord type; values depend on the capability (for example video / image / text).
idstringThe record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms.
urlstringLink to the record on the platform.
titlestringTitle. null when the platform has no titles (for example text-only posts).
textstringBody text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so).
author_namestringAuthor's display name.
author_usernamestringAuthor's username (@handle), usually usable in URLs.
author_idstringAuthor's unique ID on the platform.
author_urlstringLink to the author's profile on the platform.
author_avatar_urlstringLink to the author's avatar image (on most platforms the link is signed and expires).
author_is_verifiedbooleanWhether the channel has a verified badge.
view_countnumberViews or plays. null means not disclosed, not 0.
view_count_estimated—true means view_count (views) is an estimate converted from the rounded figure YouTube displays (such as 1.2M), not an exact count. The field does not appear when the count is exact.
durationstringDuration; on channel_lives, playlist_videos, video_search and hashtag it is written as H:MM:SS.
published_textstringPublish time as written on the YouTube page, in relative form (e.g. 2 years ago), returned as is; null when the page shows none.
thumbnail_urlstringThumbnail link, lower resolution than image_url.
preview_url—Link to the video's preview (channel_lives, playlist_videos, video_search, hashtag).
badgesarrayBadges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none.
is_livebooleanWhether the video is live now.
is_upcoming—Whether it is a premiere or scheduled live stream that has not started yet.
hashtag_name—The hashtag's name without #, as the YouTube hashtag page writes it (hashtag); first page only, the same on every row.
hashtag_video_count—Number of videos under the hashtag (hashtag), the rounded figure on the YouTube hashtag page turned into an integer; first page only, the same on every row, absent when YouTube shows none.
hashtag_video_count_estimated—true means hashtag_video_count is an estimate converted from the rounded figure YouTube displays (such as 43M), not an exact count.
hashtag_channel_count—Number of channels that used the hashtag (hashtag), the rounded figure on the YouTube hashtag page turned into an integer; first page only, the same on every row, absent when YouTube shows none.
hashtag_channel_count_estimated—true means hashtag_channel_count is an estimate converted from the rounded figure YouTube displays (such as 4.3M), not an exact count.
platformstringSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Use cases

  • See what is on a hashtag

    Read title, author_name and view_count to see the videos and Shorts at the top of the hashtag page.

  • Size up a hashtag

    Read hashtag_video_count and hashtag_channel_count on the first page to see roughly how many videos and channels use it.

  • Compare what different regions see

    Change country and call again to see which videos YouTube shows for the same hashtag in another region.

  • Separate videos from Shorts

    Both come mixed on the same page; check type on each row to tell them apart.

Limits and gotchas

  • hashtag is required. A name can have letters, digits and underscores in any script, no spaces, and at most 100 characters. A value that is not recognized returns 422 before any charge. A hashtag with nothing to watch returns an empty result and is not charged.
  • country is a two-letter country code (such as US or JP), US when left out, and it changes which videos YouTube shows. language is a language code (such as en, ja or zh-CN), en when left out, and it changes how published_text is written and which title shows when a creator set titles in several languages; content is not translated.
  • A page holds about 6 to 36 rows depending on the hashtag, and most hashtags end on the first page. When the response has next_page_token, pass it back unchanged as page_token, with country and language the same as on the first page. A token is valid for 24 hours.
  • hashtag_name, hashtag_video_count and hashtag_channel_count appear on the first page only and are the same on every row; they are absent when YouTube shows no count. When the matching _estimated field is true, the number was converted from a rounded figure (such as 43M) and is an estimate.
  • Videos and Shorts come mixed; check type on each row.

Pricing

You pay $0.000792 per page, and each page is one call. The number of rows on the page does not change the price. Failed calls and empty results are not charged.

CallsCost
10,000$7.92
100,000$79.17
1,000,000$791.67

`country` and `language` do not change the price of a call.

Code samples

#
bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "youtube",
  "action": "hashtag",
  "params": {
    "hashtag": "cooking"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

API reference

See the parameters, response fields, errors and billing for hashtag, and copy the page or open it as Markdown for an AI assistant.

POST

AI prompt

#
Please help me write a data collection script with the EveryInfra YouTube Hashtag endpoint (youtube/hashtag).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to youtube and action to hashtag, and put the parameters inside params.
- Required parameters:
  - hashtag: The hashtag for hashtag: its name with or without # (cooking, #cooking) or a hashtag page link such as https://www.youtube.com/hashtag/cooking; case does not matter.
- Optional parameters:
  - country: Country, as a two-letter code such as US or JP; US when left out. It changes which videos YouTube shows. A value that is not recognized returns 422 and is not charged.
  - language: Interface language, as a language code such as en, ja or zh-CN; en when left out. It changes how published_text is written and which title shows when a creator set titles in several languages; content is not translated.
  - page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged, language and country included.
- Returns a list of records. Main fields of each record: type, id, url, title, text, author_name, author_username, author_id, author_url, author_avatar_url (Link to the author's avatar image (on m…), author_is_verified (Whether the channel has a verified badg…), view_count; 25 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=youtube.
- Example request body:
{
  "platform": "youtube",
  "action": "hashtag",
  "params": {
    "hashtag": "cooking"
  }
}
- Price: $0.79 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesyoutubePlatform identifier, fixed value.
actionbodystringYeshashtagCapability identifier, fixed value.
hashtagbody.paramsstringYes-The hashtag for hashtag: its name with or without # (cooking, #cooking) or a hashtag page link such as https://www.youtube.com/hashtag/cooking; case does not matter. Letters, digits and underscores in any script, no spaces, at most 100 characters. A value that is not recognized returns 422 and is not charged; a hashtag with nothing to watch returns an empty result and is not charged.
countrybody.paramsstringNo-Country, as a two-letter code such as US or JP; US when left out. It changes which videos YouTube shows. A value that is not recognized returns 422 and is not charged.
languagebody.paramsstringNo-Interface language, as a language code such as en, ja or zh-CN; en when left out. It changes how published_text is written and which title shows when a creator set titles in several languages; content is not translated. A value that is not recognized returns 422 and is not charged.
page_tokenbody.paramsstringNo-Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged, language and country included. About 6 to 36 per page depending on the hashtag, and most hashtags end on the first page; each page is one call and limit has no effect. Tokens last 24 hours, and the last page has no next_page_token.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "id": "req_…",  "platform": "youtube",  "action": "hashtag",  "results": [    {      "type": …,      "id": …,      "url": …,      "title": …,      "text": …,      "author_name": …,      "author_username": …,      "author_id": …,      "author_url": …,      "author_avatar_url": …,      "author_is_verified": …,      "view_count": …,      "view_count_estimated": …,      "duration": …,      "published_text": …,      "thumbnail_url": …,      "preview_url": …,      "badges": …,      "is_live": …,      "is_upcoming": …,      "hashtag_name": …,      "hashtag_video_count": …,      "hashtag_video_count_estimated": …,      "hashtag_channel_count": …,      "hashtag_channel_count_estimated": …,      "platform": …    }  ],  "next_page_token": …,  "pagination": { … },  "count": …,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.

FieldMeaning
typeRecord type; values depend on the capability (for example video / image / text).
idThe record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms.
urlLink to the record on the platform.
titleTitle. null when the platform has no titles (for example text-only posts).
textBody text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so).
author_nameAuthor's display name.
author_usernameAuthor's username (@handle), usually usable in URLs.
author_idAuthor's unique ID on the platform.
author_urlLink to the author's profile on the platform.
author_avatar_urlLink to the author's avatar image (on most platforms the link is signed and expires).
author_is_verifiedWhether the channel has a verified badge.
view_countViews or plays. null means not disclosed, not 0.
view_count_estimatedtrue means view_count (views) is an estimate converted from the rounded figure YouTube displays (such as 1.2M), not an exact count. The field does not appear when the count is exact.
durationDuration; on channel_lives, playlist_videos, video_search and hashtag it is written as H:MM:SS.
published_textPublish time as written on the YouTube page, in relative form (e.g. 2 years ago), returned as is; null when the page shows none.
thumbnail_urlThumbnail link, lower resolution than image_url.
preview_urlLink to the video's preview (channel_lives, playlist_videos, video_search, hashtag).
badgesBadges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none.
is_liveWhether the video is live now.
is_upcomingWhether it is a premiere or scheduled live stream that has not started yet.
hashtag_nameThe hashtag's name without #, as the YouTube hashtag page writes it (hashtag); first page only, the same on every row.
hashtag_video_countNumber of videos under the hashtag (hashtag), the rounded figure on the YouTube hashtag page turned into an integer; first page only, the same on every row, absent when YouTube shows none.
hashtag_video_count_estimatedtrue means hashtag_video_count is an estimate converted from the rounded figure YouTube displays (such as 43M), not an exact count.
hashtag_channel_countNumber of channels that used the hashtag (hashtag), the rounded figure on the YouTube hashtag page turned into an integer; first page only, the same on every row, absent when YouTube shows none.
hashtag_channel_count_estimatedtrue means hashtag_channel_count is an estimate converted from the rounded figure YouTube displays (such as 4.3M), not an exact count.
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

FAQ

Is the number of videos under a hashtag exact?

No. hashtag_video_count is the rounded figure on the YouTube hashtag page, turned into an integer; when hashtag_video_count_estimated is true, it is an estimate. hashtag_channel_count works the same way.

Does language translate the videos?

No. It only changes how published_text is written and which title shows when a video has titles in several languages.

What happens when a hashtag has no videos?

The call returns an empty result and is not charged.

You can also search videos with video_search, search Shorts with shorts_search, or read the search box suggestions with search_suggest, using the same EveryInfra API key.

Google Analytics needs consent. Privacy