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.
hashtagcan be written with or without #, or be a hashtag page link; case does not matter- First-page rows also carry
hashtag_name,hashtag_video_countandhashtag_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
Last 24 hours
Last 30 days
1Request
POST /api/v1/social { "platform": "youtube", "action": "hashtag", "params": { "hashtag": "cooking" } }2JSON response
{ "results": [ { "type": string, "title": string, "text": string, "author_name": string }, … ] }3Rows
type title text author_name string string string string 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
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.
| Field | Type | Meaning |
|---|---|---|
| type | string | Record type; values depend on the capability (for example video / image / text). |
| id | string | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | string | Link to the record on the platform. |
| title | string | Title. null when the platform has no titles (for example text-only posts). |
| text | string | Body 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_name | string | Author's display name. |
| author_username | string | Author's username (@handle), usually usable in URLs. |
| author_id | string | Author's unique ID on the platform. |
| author_url | string | Link to the author's profile on the platform. |
| author_avatar_url | string | Link to the author's avatar image (on most platforms the link is signed and expires). |
| author_is_verified | boolean | Whether the channel has a verified badge. |
| view_count | number | Views 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. |
| duration | string | Duration; on channel_lives, playlist_videos, video_search and hashtag it is written as H:MM:SS. |
| published_text | string | Publish 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_url | string | Thumbnail link, lower resolution than image_url. |
| preview_url | — | Link to the video's preview (channel_lives, playlist_videos, video_search, hashtag). |
| badges | array | Badges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none. |
| is_live | boolean | Whether 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. |
| platform | string | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
Use cases
See what is on a hashtag
Read
title,author_nameandview_countto see the videos and Shorts at the top of the hashtag page.Size up a hashtag
Read
hashtag_video_countandhashtag_channel_counton the first page to see roughly how many videos and channels use it.Compare what different regions see
Change
countryand 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
typeon each row to tell them apart.
Limits and gotchas
hashtagis 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.countryis a two-letter country code (such asUSorJP),USwhen left out, and it changes which videos YouTube shows.languageis a language code (such asen,jaorzh-CN),enwhen left out, and it changes howpublished_textis 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 aspage_token, withcountryandlanguagethe same as on the first page. A token is valid for 24 hours. hashtag_name,hashtag_video_countandhashtag_channel_countappear on the first page only and are the same on every row; they are absent when YouTube shows no count. When the matching_estimatedfield istrue, the number was converted from a rounded figure (such as 43M) and is an estimate.- Videos and Shorts come mixed; check
typeon 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.
| Calls | Cost |
|---|---|
| 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
#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.
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
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | youtube | Platform identifier, fixed value. |
action | body | string | Yes | hashtag | Capability identifier, fixed value. |
hashtag | body.params | string | Yes | - | 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. |
country | body.params | string | No | - | 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 | body.params | string | No | - | 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_token | body.params | string | No | - | 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
#{ "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.
| Field | Meaning |
|---|---|
type | Record type; values depend on the capability (for example video / image / text). |
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
url | Link to the record on the platform. |
title | Title. null when the platform has no titles (for example text-only posts). |
text | Body 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_name | Author's display name. |
author_username | Author's username (@handle), usually usable in URLs. |
author_id | Author's unique ID on the platform. |
author_url | Link to the author's profile on the platform. |
author_avatar_url | Link to the author's avatar image (on most platforms the link is signed and expires). |
author_is_verified | Whether the channel has a verified badge. |
view_count | Views 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. |
duration | Duration; on channel_lives, playlist_videos, video_search and hashtag it is written as H:MM:SS. |
published_text | Publish 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_url | Thumbnail link, lower resolution than image_url. |
preview_url | Link to the video's preview (channel_lives, playlist_videos, video_search, hashtag). |
badges | Badges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none. |
is_live | Whether 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. |
platform | Source 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.
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.
Related YouTube endpoints
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.
- Search
search$0.78 per 1,000 callsSearch YouTube videos by keyword, up to 50 per call. - Details
profile$0.56 per 1,000 callsGet a YouTube channel from its channel URL. - Posts by user
user_posts$0.56 per 1,000 callsList videos from a YouTube channel URL, up to 50 per call. - Video details
video$0.56 per 1,000 callsFetch the title, description, channel, views, likes, comment count, duration and publish date of one YouTube video from its watch or share link. - Comments
comments$0.56 per 1,000 callsRead comments on a YouTube video, up to 100 per call. - Followers
followers$0.56 per 1,000 callsCheck the subscriber count of a YouTube channel from its handle. - Transcript
transcript$0.56 per 1,000 callsPull the captions of a YouTube video as full text and timestamped segments, with the track language, available languages and channel details. - Shorts
shorts$0.56 per 1,000 callsBrowse the Shorts of a YouTube channel by handle, up to 100 per call. - Comment replies
comment_replies$0.79 per 1,000 callsRead the replies under one YouTube comment, on a video or on a channel post, from the link and the comment'scomment_id(acommentsorcommunity_post_commentsrow'sid). - Related posts
related_posts$0.56 per 1,000 callsList the videos, Shorts and playlists YouTube recommends next to one video, from the video link. - Channel ID lookup
resolve_channel$0.56 per 1,000 callsTurn a YouTube channel link, @handle, UC channel ID or channel name into the channel's ID, handle, display name and both links. - Community posts
community_posts$0.56 per 1,000 callsPage through the posts in a YouTube channel's Posts tab, newest first, from the channel link or @handle. - Channel post
community_post$0.56 per 1,000 callsOpen one YouTube channel post from its link and get its text, likes, comment count, the time YouTube shows, author, and attachment: images, a video, or poll options and total votes. - Channel post comments
community_post_comments$0.56 per 1,000 callsRead the comments on one YouTube channel post from its link. - Search in channel
search_in_channel$0.56 per 1,000 callsSearch inside one YouTube channel by keyword, from the channel link or @handle. - Shorts search
shorts_search$0.79 per 1,000 callsSearch YouTube Shorts across the whole site by keyword, with optionalsortanddate_range. - Account search
user_search$0.56 per 1,000 callsFind YouTube channels by name or keyword. - Search suggestions
search_suggest$0.56 per 1,000 callsGet the suggestions YouTube's search box shows for what you type, about 14 in one call, in order. - Video formats
video_formats$0.56 per 1,000 callsList the formats a YouTube video has, from its link: quality, codec, bitrate, size, frame rate and audio quality for each format, with no playback URLs. - Media download links
media_links$0.56 per 1,000 callsGet every format of a YouTube video with its playback URL, from the video link. - Format stream URL
stream_url$0.56 per 1,000 callsGet the playback URL of one format of a YouTube video, from the video link and the format'sitag(taken fromvideo_formatsormedia_links). - Channel live streams
channel_lives$0.56 per 1,000 callsList the entries on a YouTube channel's Live tab fromchannel_id: streams that are live now, past streams and upcoming ones. - Channel playlists
channel_playlists$0.56 per 1,000 callsList the playlists on a YouTube channel's Playlists tab fromchannel_id. - Playlist videos
playlist_videos$0.56 per 1,000 callsList the videos of a YouTube playlist in the playlist's order fromplaylist_id(an ID starting with PL, UU or OLAK5uy_, or a link withlist=). - Video search
video_search$0.56 per 1,000 callsSearch YouTube for videos only bykeyword, with an optional upload-time filter insort:hour,today,week,month(the default) oryear. - Recommended Shorts
recommended_shorts$0.79 per 1,000 callsRead a page of YouTube's Shorts recommendation feed, with no parameters.