YouTube Trends API Documentation
The YouTube Trends API provides developers access to the most currently trending videos on YouTube.
It enables the extraction of detailed data such as video titles, view counts, channel information, video lengths, published times, and thumbnail URLs.
It uses /api/v1/search?engine=youtube_trends
API endpoint to scrape real-time search results.
API Parameters
Filters
-
- Name
-
bp
- Required
- Optional
- Description
-
The parameter specifies the category of trending content. All available options:
now
- All trending content. (Default)music
- Music.gaming
- Gaming.films
- Films.
Localization
-
- Name
-
gl
- Required
- Optional
- Description
-
The default parameter
us
defines the country of the search. Check the full list of supported YouTubegl
countries.
-
- Name
-
hl
- Required
- Optional
- Description
-
The default parameter
en
defines the interface language of the search. Check the full list of supported YouTubehl
languages.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines the engine that will be used to retrieve real-time data. To retrieve YouTube video details, it must be set to
youtube_trends
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates 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
).
API Examples
Trending Videos
https://www.searchapi.io/api/v1/search?bp=music&engine=youtube_trends
- 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_trends",
"bp": "music"
}
response = requests.get(url, params = params)
print(response.text)
{
"trending": [
{
"position": 1,
"id": "VZIm_2MgdeA",
"title": "JoJo Siwa - Karma (Official Video)",
"link": "https://www.youtube.com/watch?v=VZIm_2MgdeA",
"views": 23814708,
"channel": {
"id": "UCoWTV6unC8rbshn7-0BF8vw",
"title": "JoJo Siwa",
"link": "https://www.youtube.com/channel/UCoWTV6unC8rbshn7-0BF8vw",
"is_verified": true,
"thumbnail": "https://yt3.ggpht.com/nj_aARqnxu9xQpku0XA_cJiLSJZbB6KjfMAargNfhR0tTm4gX0UHL8PBd8qHABkBwYeXyZLXO_Y=s88-c-k-c0x00ffffff-no-rj"
},
"length": "3:21",
"published_time": "12 days ago",
"thumbnail": "https://i.ytimg.com/vi/VZIm_2MgdeA/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDYnwr1FUWQlPdhkMx7Yez1sDvn0g"
},
...
]
}
Recently Trending Videos
https://www.searchapi.io/api/v1/search?engine=youtube_trends
- 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_trends"
}
response = requests.get(url, params = params)
print(response.text)
{
"recently_trending": [
{
"position": 1,
"id": "xy8aJw1vYHo",
"title": "Joker: Folie à Deux | Official Teaser Trailer",
"link": "https://www.youtube.com/watch?v=xy8aJw1vYHo",
"views": 30533260,
"channel": {
"id": "UCjmJDM5pRKbUlVIzDYYWb6g",
"title": "Warner Bros. Pictures",
"link": "https://www.youtube.com/@WarnerBrosPictures",
"is_verified": true,
"thumbnail": "https://yt3.ggpht.com/CoYiDB8ojHTQvSwr9h8clzpcm85wiFaHroW0MaVgTnDEXAIMxhGlzC5Vwo9N3-z3obfVqc_G62I=s68-c-k-c0x00ffffff-no-rj"
},
"length": "2:25",
"published_time": "7 days ago",
"thumbnail": "https://i.ytimg.com/vi/xy8aJw1vYHo/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC7IkFbLI9Oi11isV379m-Ogvgcag"
},
...
]
}
Trending Shorts
https://www.searchapi.io/api/v1/search?engine=youtube_trends
- 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_trends"
}
response = requests.get(url, params = params)
print(response.text)
{
"shorts": [
{
"position": 1,
"id": "ACpIhdFcZ8o",
"title": "SNAPCHAT WE DONT WANNA SNAP THE GROUPCHAT!!",
"link": "https://www.youtube.com/shorts/ACpIhdFcZ8o",
"views": 691000,
"thumbnail": "https://i.ytimg.com/vi/ACpIhdFcZ8o/oar2.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQY=&rs=AOn4CLCxITRd86p76ha_XawepmpRmOtiMA"
},
{
"position": 2,
"id": "BlQoJy8J_Q8",
"title": "Make it or break it! (That last level 🤯)",
"link": "https://www.youtube.com/shorts/BlQoJy8J_Q8",
"views": 1100000,
"thumbnail": "https://i.ytimg.com/vi/BlQoJy8J_Q8/oar2.jpg?sqp=-oaymwEdCJUDENAFSFWQAgHyq4qpAwwIARUAAIhCcAHAAQY=&rs=AOn4CLBhJl3_ariy-2wJFA3kUVtNSTQlaA"
},
...
]
}
Featured Artist Videos
https://www.searchapi.io/api/v1/search?engine=youtube_trends
- 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_trends"
}
response = requests.get(url, params = params)
print(response.text)
{
"featured_artist_videos": [
{
"position": 1,
"id": "ZXz_qbUizSg",
"title": "Oddly satisfying of card shuffling😮💨#shorts #asmr #satisfying #cardshuffle #viral_video #foryou_",
"link": "https://www.youtube.com/watch?v=ZXz_qbUizSg",
"views": 282406,
"is_short": true,
"channel": {
"id": "UCnbrqT13lFTJN9AU9obDGmQ",
"title": "Silas Noyes",
"link": "https://www.youtube.com/@silasnoyes1",
"is_verified": true
},
"published_time": "1 month ago",
"thumbnail": "https://i.ytimg.com/vi/ZXz_qbUizSg/hqdefault.jpg?sqp=-oaymwE2CPYBEIoBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhLIFQoZTAP&rs=AOn4CLBaslRbn_tjm1o951MrLk-WdVNyvQ"
},
...
]
}