YouTube Hashtag API Documentation
The YouTube Hashtag API returns the videos or shorts YouTube lists under a hashtag, with the hashtag's approximate video and channel counts.
API Parameters
Search Query
-
- Name
-
hashtag - Required
- Required
- Description
-
Defines the hashtag to look up, with or without the leading
#. Examples:funny,#cooking. Up to 100 characters, with only letters, numbers and underscores. Values from thehashtagsfield of the YouTube Post API can be passed as they are.
Filters
-
- Name
-
search_type - Required
- Optional
- Description
-
Selects the hashtag feed to return, one of
allorshorts.allreturns thevideosYouTube lists under the hashtag, andshortsreturns itsshorts.
Localization
-
- Name
-
gl - Required
- Optional
- Description
-
The default parameter
USdefines the country of the search. Check the full list of supported YouTubeglcountries.
-
- Name
-
hl - Required
- Optional
- Description
-
The default parameter
endefines the interface language of the search. Check the full list of supported YouTubehllanguages.
Pagination
-
- Name
-
next_page_token - Required
- Optional
- Description
-
A token used to retrieve the next page of the same
hashtagandsearch_type. Use thepagination.next_page_tokenfrom the previous response.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines the engine that will be used to retrieve real-time data. To retrieve videos and shorts from a YouTube hashtag, it must be set to
youtube_hashtag.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response
Each page holds up to 36 videos. Videos that are YouTube Shorts carry is_short, and live streams carry is_live with their current viewers in views. Some hashtags list a single page, so the response has no pagination.
Use the pagination.next_page_token to retrieve the next page. Paginated responses don't include the hashtag object. Hashtags without a YouTube hashtag page return an error message instead of results.
https://www.searchapi.io/api/v1/search?engine=youtube_hashtag&hashtag=cooking
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "youtube_hashtag",
"hashtag": "cooking"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_savSP3BPGOCd8EDfw5JrpkSa",
"status": "Success",
"created_at": "2026-09-29T00:49:24Z",
"request_time_taken": 1.95,
"parsing_time_taken": 0.18,
"total_time_taken": 2.13,
"request_url": "https://www.youtube.com/hashtag/cooking",
"html_url": "https://www.searchapi.io/api/v1/searches/search_savSP3BPGOCd8EDfw5JrpkSa.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_savSP3BPGOCd8EDfw5JrpkSa"
},
"search_parameters": {
"engine": "youtube_hashtag",
"hashtag": "cooking",
"search_type": "all",
"gl": "US",
"hl": "en"
},
"hashtag": {
"title": "#cooking",
"link": "https://www.youtube.com/hashtag/cooking",
"videos": 41000000,
"channels": 4100000
},
"videos": [
{
"position": 1,
"id": "FUc6iKRXeUc",
"title": "First Day in Georgia! Cooking Chicken for a Heartwarming Dinner",
"link": "https://www.youtube.com/watch?v=FUc6iKRXeUc",
"views": 390908,
"channel": {
"id": "UCjAKzWYZLayOQfSud0lU1vQ",
"title": "Royal Cooking",
"link": "https://www.youtube.com/channel/UCjAKzWYZLayOQfSud0lU1vQ",
"thumbnail": "https://yt3.ggpht.com/wO9nCIsV1rU0UGMXVeXZSstwE7LnZx9Wdp8rmRMUPHNe4m06abCt1v5eXvuvEfhYhgG0BdtMrg=s68..."
},
"length": "39:41",
"published_time": "1d ago",
"thumbnail": {
"static": "https://i.ytimg.com/vi/FUc6iKRXeUc/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs...",
"rich": "https://i.ytimg.com/vi/FUc6iKRXeUc/hqdefault.jpg?sqp=-oaymwEbCMQBEG5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs..."
}
},
"..."
],
"pagination": {
"next_page_token": "eyJ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DAifQ"
}
}
Shorts
Set search_type to shorts to get the hashtag's shorts feed. Shorts carry the title, link, thumbnail and an approximate view count.
https://www.searchapi.io/api/v1/search?engine=youtube_hashtag&hashtag=funny&search_type=shorts
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "youtube_hashtag",
"hashtag": "funny",
"search_type": "shorts"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_V6QeGdKRg9qeslqWg8mBExyv",
"status": "Success",
"created_at": "2026-09-30T18:47:31Z",
"request_time_taken": 1.82,
"parsing_time_taken": 0.02,
"total_time_taken": 1.83,
"request_url": "https://www.youtube.com/hashtag/funny/shorts",
"html_url": "https://www.searchapi.io/api/v1/searches/search_V6QeGdKRg9qeslqWg8mBExyv.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_V6QeGdKRg9qeslqWg8mBExyv"
},
"search_parameters": {
"engine": "youtube_hashtag",
"hashtag": "funny",
"search_type": "shorts",
"gl": "US",
"hl": "en"
},
"hashtag": {
"title": "#funny",
"link": "https://www.youtube.com/hashtag/funny",
"videos": 516000000,
"channels": 42000000
},
"shorts": [
{
"position": 1,
"id": "MLVF8JLeJV0",
"title": "This Woman Had the Officer Speechless #funny #shorts #skit #comedy #usa",
"link": "https://www.youtube.com/shorts/MLVF8JLeJV0",
"views": 21000000,
"thumbnail": "https://i.ytimg.com/vi/MLVF8JLeJV0/oardefault.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQ..."
},
"..."
],
"pagination": {
"next_page_token": "eyJ0b2tlbiI6IjRxbUZzZ0xYQVJJSlJrVm9ZWE5vZEdGbkdySUJRME5TTm1Nd1RrUlVWa1pEVlcwNU1XUXlaRnBqYTA1dVZtMHhhMVo2VmpGYVZrcEtZVlpPUjFWWWJGUmlWM2gyVlcweE5HUXhVbGhPVjBaV1V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