YouTube scraper API: search results and detail pages as JSON
Send any YouTube page URL with recipe=youtube and get title, views, duration and 7 more fields as JSON. No selectors to write, no proxies to pick.
- 2 page types
- 10 fields
- 5 credits a page · $0.50 per 1,000
- Working · 90.5% in 7 days
5,000 free credits for 21 days, no card.
curl -G 'https://api.ujeebu.com/scrape' \
-H "ApiKey: $UJEEBU_API_KEY" \
--data-urlencode 'url=https://www.youtube.com/results?search_query=cooking+pasta' \
--data-urlencode 'recipe=youtube/listing'
{
"result": {
"videos": [
{
"title": "How To Cook The Perfect Pasta | Gordon Ramsay",
"views": "12,110,378 views",
"duration": "1:32"
}
]
},
"success": true
}
YouTube API or the page data?
Official API: open
YouTube has an official API (YouTube Data API v3). Any developer with a Google Cloud project can get a key to search and read public videos, channels, playlists and comments within a daily quota. When you need the public page data instead (fields the API does not return, the official rate limits, or no developer key to apply for), the recipe gives it to you.
Source: YouTube Data API v3 on developers.google.com, checked November 6, 2026.
How to get YouTube data as JSON today
- Get a free API key: 5,000 free credits for 21 days, no card.
- Send any YouTube page URL with
recipe=youtubeto the Scrape API (the call). - Get 10 fields as JSON, 5 credits a page, billed only when the call succeeds.
Ujeebu's YouTube recipe returns title, views, duration and 7 more fields from any public YouTube page as JSON: send the URL with recipe=youtube to the Scrape API, 5 credits a page, no YouTube account or partner approval needed.
What you get from YouTube
The fields of each page type and a real sample from our last validation, shortened.
Search and listing pages recipe=youtube/listing 5 credits a page
| Field | Type | Example |
|---|---|---|
videos | list of 3+ items | |
videos[].duration | text | 1:32 |
videos[].image | image URL | https://i.ytimg.com/vi/UYhKDweME3A/hq720.jpg |
videos[].published | text | 12y ago |
videos[].title | text | How To Cook The Perfect Pasta | Gordon Ramsay |
videos[].url | URL | https://www.youtube.com/watch?v=UYhKDweME3A |
videos[].views | text | 12,071,276 views |
Sample answer, validated 2026-11-19
{
"videos": [
{
"duration": "1:32",
"image": "https://i.ytimg.com/vi/UYhKDweME3A/hq720.jpg",
"published": "12y ago",
"title": "How To Cook The Perfect Pasta | Gordon Ramsay",
"url": "https://www.youtube.com/watch?v=UYhKDweME3A",
"views": "12,110,378 views"
},
{
"duration": "4:15",
"image": "https://i.ytimg.com/vi/VnwNR5qR9ow/hq720.jpg",
"published": "8y ago",
"title": "How to Boil Pasta",
"url": "https://www.youtube.com/watch?v=VnwNR5qR9ow",
"views": "355,486 views"
}
]
}
Detail pages recipe=youtube/detail 5 credits a page
| Field | Type | Example |
|---|---|---|
video.name | text | Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) |
video.thumbnail | image URL | https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg |
video.uploaded | date | 2009-10-24T23:57:33-07:00 |
description | text | The official video for “Never Gonna Give You Up” by Rick Astley. Ne... |
image | image URL | https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg |
url | URL | https://www.youtube.com/watch?v=dQw4w9WgXcQ |
Sample answer, validated 2026-11-18
{
"video": {
"name": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"uploaded": "2009-10-24T23:57:33-07:00"
},
"description": "The official video for “Never Gonna Give You Up” by Rick Astley. Never: The Autobiography 📚 OUT NOW! Follow this link to get your copy and listen to Rick’s ...",
"image": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
One call
Send the page URL and the recipe name to the Scrape API. The recipe brings the extract rules and the settings that work on YouTube (JavaScript rendering).
curl -G 'https://api.ujeebu.com/scrape' \
-H "ApiKey: $UJEEBU_API_KEY" \
--data-urlencode 'url=https://www.youtube.com/results?search_query=cooking+pasta' \
--data-urlencode 'recipe=youtube/listing'
import os, requests
r = requests.get(
"https://api.ujeebu.com/scrape",
params={"url": "https://www.youtube.com/results?search_query=cooking+pasta", "recipe": "youtube/listing"},
headers={"ApiKey": os.environ["UJEEBU_API_KEY"]},
timeout=120,
)
for item in r.json()["result"]["videos"][:3]:
print(item["title"], item["views"], item["duration"])
# Example output:
# How To Cook The Perfect Pasta | Gordo... 12,110,378 views 1:32
# How to Boil Pasta 355,486 views 4:15
const params = new URLSearchParams({
url: "https://www.youtube.com/results?search_query=cooking+pasta",
recipe: "youtube/listing",
});
const res = await fetch(`https://api.ujeebu.com/scrape?${params}`, {
headers: { ApiKey: process.env.UJEEBU_API_KEY },
});
const { result } = await res.json();
for (const item of result.videos.slice(0, 3)) {
console.log(item.title, item.views, item.duration);
}
// Example output:
// How To Cook The Perfect Pasta | Gordo... 12,110,378 views 1:32
// How to Boil Pasta 355,486 views 4:15
The answer is {"result": {...}} with the headers Ujb-Recipe and Ujb-Credits. Other page types: recipe=youtube/detail, or recipe=youtube and the API picks the page type from the URL. Your own parameters always win over the recipe.
Search YouTube with parameters
One call, no URL: send recipe=youtube/search with the parameters below. We build the YouTube search URL and answer the listing JSON, at the same credits as the page call.
| Parameter | Type | Values |
|---|---|---|
query required | string | Search words. |
sort | enum | relevance, newest, views, rating |
One call (query=cooking pasta)
curl -G 'https://api.ujeebu.com/scrape' \
-H 'ApiKey: YOUR_API_KEY' \
-d 'recipe=youtube/search' \
--data-urlencode 'query=cooking pasta'
import os, requests
r = requests.get(
"https://api.ujeebu.com/scrape",
params={"recipe": "youtube/search", "query": "cooking pasta"},
headers={"ApiKey": os.environ["UJEEBU_API_KEY"]},
timeout=120,
)
for item in r.json()["result"]["videos"][:3]:
print(item["title"], item["views"], item["duration"])
# Example output:
# How To Cook The Perfect Pasta | Gordo... 12,110,378 views 1:32
# How to Boil Pasta 355,486 views 4:15
const params = new URLSearchParams({
recipe: "youtube/search",
query: "cooking pasta",
});
const res = await fetch(`https://api.ujeebu.com/scrape?${params}`, {
headers: { ApiKey: process.env.UJEEBU_API_KEY },
});
const { result } = await res.json();
for (const item of result.videos.slice(0, 3)) {
console.log(item.title, item.views, item.duration);
}
// Example output:
// How To Cook The Perfect Pasta | Gordo... 12,110,378 views 1:32
// How to Boil Pasta 355,486 views 4:15
The answer carries the built URL in the Ujb-Url header; a missing or invalid parameter answers 400 naming it (free). Have the URL already? Send it with recipe=youtube/listing. Search with parameters in the docs
What people build with YouTube data
Market research
Follow public company pages and job postings to see who grows and hires.
Learn more
Price
Same price as the page call, no fee for the recipe. Only successful responses are billed; blocked, timed-out and failed requests are free.
| Page type | Credits a page | Per 1,000, Starter | Per 1,000, Pro |
|---|---|---|---|
| Search results, Detail page | 5 | $0.82 | $0.50 |
FAQ
YouTube API vs scraping: which one should I use?
Use the official YouTube API when it returns what you need. Any developer with a Google Cloud project can get a key to search and read public videos, channels, playlists and comments within a daily quota. Use the page data when you need what the public page shows: Ujeebu's YouTube recipe returns title, views, duration and 7 more fields from any public YouTube page as JSON: send the URL with recipe=youtube to the Scrape API, 5 credits a page, no YouTube account or partner approval needed.
What does the YouTube recipe return?
JSON with 10 fields from search results (recipe=youtube/listing) and detail page (recipe=youtube/detail), for example title, views, duration, image, published. The answer is {"result": {...}} with the fields shown on this page.
How much does it cost to scrape YouTube?
5 credits a page ($0.50 per 1,000 on Pro, $0.82 on Starter). Same price as the page call, no fee for the recipe. Only successful responses are billed; blocked, timed-out and failed requests are free.
Do I need proxies or a headless browser?
No. The recipe brings the settings that work on YouTube: JavaScript rendering. Send only the URL and recipe=youtube/listing.
What happens when YouTube changes its pages?
We check YouTube every day and re-validate the recipe on real pages every week, then fix it when the site changes. Until a fix is live, the API answers 404 "the recipe has no working version" instead of empty data, and that call is free.
Can I search YouTube with parameters?
Yes, in one call: send recipe=youtube/search with query, sort and no URL. We build the YouTube search URL (returned in the Ujb-Url header), apply recipe=youtube/listing and answer its JSON, at the same credits as the page call. A missing or invalid parameter answers 400 naming it, and that call is free.
Related recipes
LinkedInSearch results, Detail page, Profile · 5 credits
X (Twitter)Profile · 5 credits
InstagramProfile · 5 credits
TikTokProfile · 5 credits
RedditSearch results · 5 credits
BlueskyProfile · 5 credits
Logos and names belong to their owners. Ujeebu is not affiliated with YouTube.
Get YouTube data as JSON today.
5,000 free credits for 21 days. No card.