YouTube search API: videos, channels, hashtags and trending Shorts as JSON

Search YouTube with four REST calls: keyword search, hashtag search, typeahead suggestions and trending Shorts. Keyword search returns videos, channels, playlists, shorts, shelves and live streams, and each video carries title, URL, thumbnail, views, publish date, duration, channel info and badges. You can filter by upload_date, duration, type and region, sort by relevance or popularity, and page through results with a continuation token.

Buy credits

Use cases

Endpoints and cost

EndpointWhat it returnsCredits/callUSD/call (Freelance plan)
/v1/youtube/searchSearch1$0.0017
/v1/youtube/search_hashtagSearch by Hashtag1$0.0017
/v1/youtube/search_typeaheadSearch Typeahead1$0.0017
/v1/youtube/shorts_trendingTrending Shorts1$0.0017

Endpoint details

/v1/youtube/search

Search 1,000 calls = 1,000 credits = $1.67 on the Freelance plan.

ParameterTypeRequiredDescription
querystringyesSearch query. For stricter title matching, use YouTube's intitle: operator, for example intitle:"Foursquare Swarm". Quoted queries by themselves may still be br
upload_datestringnoUpload date
sort_bystringnoSort by
typestringnoType of content to search for
durationstringnoDuration of the video. Only applies to videos (not shorts).
regionstringno2 letter country code of the country to put the proxy in.
include_extrasstringnoThis will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. *This will slow down t
next_cursor_tokenstringnoContinuation token to get more videos. Get 'continuationToken' from previous response.

Sample response (trimmed):

{
 "videos": [
  {
   "type": "video",
   "id": "BzSzwqb-OEE",
   "url": "https://www.youtube.com/watch?v=BzSzwqb-OEE",
   "title": "NF - RUNNING (Audio)",
   "thumbnail": "https://i.ytimg.com/vi/BzSzwqb-OEE/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLCasEKav1CLqeSSE2IYDqjGiIMBGw",
   "channel": {
    "id": "UCoRR6OLuIZ2-5VxtnQIaN2w",
    "title": "NFrealmusic",
    "handle": "channel/UCoRR6OLuIZ2-5VxtnQIaN2w",
    "thumbnail": "https://yt3.ggpht.com/J1_Si0TYNZ-991v09y8RpCh4_Z_ALwKmPgMYnJqjNhoglVtipf3oEN8LpzG1kS0qsv8Jptpmmg=s88-c-k-c0x00ffffff-no-rj"
   },
   "view_count_text": "14,860,541 views",
   "view_count_int": 14860541,
   "published_time_text": "2 years ago",
   "published_time": "2023-05-28T17:08:46.499Z",
   "length_text": "4:14",
   "length_seconds": 254,
   "badges": []
  }
 ],
 "channels": [],
 "playlists": [],
 "shorts": [
  {
   "type": "short",
   "id": "uMNvF-lSCHg",
   "url": "https://www.youtube.com/watch?v=uMNvF-lSCHg",
   "title": "LONG RUN ROUTINE #run #runvlog #runner #shorts #morning",
   "thumbnail": "https://i.ytimg.com/vi/uMNvF-lSCHg/hq720.jpg?sqp=-oaymwFBCNAFEJQDSFryq4qpAzMIARUAAIhCGADYAQHiAQoIGBACGAY4AUAB8AEB-AG2CIACgA-KAgwIABABGFsgXyhlMA8=&rs=AOn4CLA_...",
   "channel": {
    "id": "UCGRdcRxpJWi5Q2oDCrMDUuQ",
    "title": "Abby and Ryan",
    "handle": "abbyandryan",
    "thumbnail": "https://yt3.ggpht.com/8

/v1/youtube/search_hashtag

Search by Hashtag 1,000 calls = 1,000 credits = $1.67 on the Freelance plan.

ParameterTypeRequiredDescription
hashtagstringyesHashtag to search for
typestringnoSearch for all types of content or only shorts
next_cursor_tokenstringnoContinuation token to get more videos. Get 'continuationToken' from previous response.

/v1/youtube/search_typeahead

Search Typeahead 1,000 calls = 1,000 credits = $1.67 on the Freelance plan.

ParameterTypeRequiredDescription
querystringyesPartial or complete YouTube search query

/v1/youtube/shorts_trending

Trending Shorts 1,000 calls = 1,000 credits = $1.67 on the Freelance plan.

ParameterTypeRequiredDescription
trimstringno

Example: curl

curl -H "X-Scapi-Key: $SCAPI_KEY" "https://api.scrapall.bipsport.com/scapi/v1/youtube/search"

Example: Python

import os, requests
r = requests.get("https://api.scrapall.bipsport.com/scapi/v1/youtube/search",
    headers={"X-Scapi-Key": os.environ["SCAPI_KEY"]})
print(r.json())

FAQ

How do I search YouTube by keyword?

Call the search endpoint with query. Optional filters are upload_date, sort_by, type, duration and region. Each video result includes title, URL, thumbnail, views, publish date, duration, channel info and badges. Pass next_cursor_token from the previous response to load the next page.

Can I search by hashtag?

Yes. Call the hashtag search endpoint with hashtag. It returns matching videos with title, URL, thumbnail, views, publish date, duration and channel info. Use the type parameter to get all content types or only shorts, and next_cursor_token to paginate.

How do I get trending YouTube Shorts?

Call the trending Shorts endpoint. Each call returns approximately 48 currently trending Shorts with title, URL, thumbnail, views, likes, comment count, publish date, channel info, keywords and duration. Each subsequent call returns a fresh batch of different trending shorts.

What does the typeahead endpoint return?

It returns the live search suggestions YouTube shows while a user types. Each result has the suggested text and whether it is a normal query or a channel. For channel suggestions you also get the public channel ID, handle, name and thumbnail.

Can I find sponsored videos?

Yes. On keyword search, set is_paid_promotions=true to search YouTube videos that carry the paid product placement or sponsorship disclosure. This helps when you research which brands work with creators in a niche.

How do I pay and get my API key?

Open the Buy page, pick the Freelance plan and pay in USDT on TRC20 or ERC20. The key is shown once, right after the payment is confirmed on-chain.

How many credits does one call use?

The cost table on this page lists credits per call for each endpoint. The Freelance plan is $45 for 27,000 credits per 30 days.

Get an API key and credits

Full reference: all youtube endpoints.