YouTube Search API
Run a YouTube search and get the results as JSON, with the sorting and filters the site itself offers.
- 100 free credits
- No card needed
- No Google Cloud project or OAuth
curl "https://pipefetch.com/v1/youtube/search?q=web+scraping+tutorial&limit=20" \
-H "x-api-key: YOUR_API_KEY"const res = await fetch('https://pipefetch.com/v1/youtube/search?q=web+scraping+tutorial&limit=20', {
headers: { 'x-api-key': process.env.PIPEFETCH_API_KEY },
});
const { data, credits } = await res.json();import os, requests
res = requests.get(
"https://pipefetch.com/v1/youtube/search",
params={"q": "web scraping tutorial", "limit": 20},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
)
data = res.json()["data"]What you get
- Up to 40 results per search, in YouTube's order
- Videos, Shorts, channels or playlists
- Title, link, description snippet, duration, views and publish time
- The channel of every result, with its verification flag
{
"data": {
"query": "web scraping tutorial",
"results": [
{
"type": "video",
"id": "QhD015WUMxE",
"url": "https://www.youtube.com/watch?v=QhD015WUMxE",
"title": "Beginners Guide To Web Scraping with Python - All You Need To Know",
"description": "The web is full of data. Lots and lots of data. Data prime for scraping. But manually going to a website and copying and pasting the ...",
"publishedAt": "2022-05-19T14:34:23.927Z",
"publishedAtPrecision": "estimated",
"durationSeconds": 456,
"viewCount": 491436,
"viewCountIsExact": true,
"isLive": false,
"thumbnailUrl": "https://i.ytimg.com/vi/QhD015WUMxE/hq720.jpg",
"position": 1,
"channel": {
"id": "UCZDA1kA3y3EIg25BpcHSpwQ",
"name": "Tinkernut",
"handle": "@Tinkernut",
"url": "https://www.youtube.com/@Tinkernut",
"isVerified": true
}
},
{
"type": "video",
"id": "hHQlcnubuFI",
"url": "https://www.youtube.com/watch?v=hHQlcnubuFI",
"title": "Learn Web Scraping in 5 Minutes (NO PRIOR KNOWLEDGE)",
"description": "Get Rid of IP Blocking for just $1 with DataImpulse: ...",
"publishedAt": "2026-03-04T12:19:23.927Z",
"publishedAtPrecision": "estimated",
"durationSeconds": 293,
"viewCount": 191388,
"viewCountIsExact": true,
"isLive": false,
"thumbnailUrl": "https://i.ytimg.com/vi/hHQlcnubuFI/hq720.jpg",
"position": 2,
"channel": {
"id": "UCFVteOob_YXJHPaGTqlDV2Q",
"name": "CodeHead",
"handle": "@codehead01",
"url": "https://www.youtube.com/@codehead01",
"isVerified": true
}
}
]
},
"credits": {
"used": 1,
"remaining": 99
}
}One GET request
Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.
GET/v1/youtube/search
Costs 1 credit per request. Only requests that return data are charged.
Parameters
| Name | Type | Description |
|---|---|---|
qrequired |
string | The search query. |
limitoptional |
integer | How many results to return. Default: 20. From 1 to 40. |
typeoptional |
string | Kind of result. One of: video, short, channel, playlist, all. Default: video. |
sortoptional |
string | Result order. One of: relevance, popularity, newest, mostViewed. Default: relevance. |
uploadedoptional |
string | Only results uploaded within this period. One of: hour, today, week, month, year. |
countryoptional |
string | Two-letter country code the search is run for. |
langoptional |
string | Interface language code for titles and labels. |
Good to know
- A search with no results answers 404 no_results and costs nothing.
What people build with it
Keyword and topic research
See what ranks for a query and how those videos perform.
Brand monitoring
Sort by newest and limit to today to catch new videos that mention your brand.
Finding creators
Search with type=channel to build a list of channels on a topic.
Buy credits once. Use them whenever.
This endpoint costs 1 credit per request, and a request that returns no data costs nothing. Move the slider to see what your volume costs.
One credit is one request that returns data. Requests that return nothing are free.
- $2.42 per 1,000 requests
- About $12.08 a month at this pace
- Lasts about 2.4 months at this pace
- Credits never expire
Questions and answers
How is this different from search in the official YouTube Data API?
By default the official API lets a project make 100 search.list calls a day; search has its own allowance, separate from the 10,000 daily units for other calls. Here a search costs 1 credit and there is no daily cap.
Are the results the same as on youtube.com?
They are what YouTube returns to a signed-out visitor in the country and language you pass. Personalised results do not apply.
What if a search finds nothing?
The request answers 404 no_results and costs nothing.
What does a search cost?
One request costs 1 credit. Credit packs start at $9 for 3,000 credits, never expire, and a request that returns no data is not charged. New accounts get 100 free credits without a card.
Step-by-step guides
How to get a YouTube transcript in Node.js
The npm package route and the plain fetch route, with code, and why browsers and serverless functions need the second.
Read the guideYouTube API quota exceeded: what the error means and how to fix it
How Google counts quota today, why search runs out first, and seven ways to stay under the limit or get past it.
Read the guide
More YouTube APIs
-
1 credit
YouTube Transcript API
The transcript of any public video with captions, as plain text, timestamped segments, SRT or WebVTT.
GET /v1/youtube/transcript -
1 credit
YouTube Video API
Exact views, likes and comment count, description, tags, chapters and channel for one video.
GET /v1/youtube/video -
1 credit
YouTube Channel API
Subscribers, video count, description, keywords and avatar for a channel, from a handle, id or URL.
GET /v1/youtube/channel -
1 credit
YouTube Channel Videos API
The latest uploads of a channel, newest first, with views, duration and publish time.
GET /v1/youtube/channel/videos -
1 credit
YouTube Shorts API
The Shorts of a channel, newest first, with view counts and thumbnails.
GET /v1/youtube/channel/shorts -
1 credit / 20
YouTube Comments API
Top or newest comments of a video with likes, reply counts, pinned and hearted flags.
GET /v1/youtube/comments
Make your first request in a minute
Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.