YouTube search with metrics
Add include_metrics=true to search for video metrics and channel handles at the normal one-credit price. The option preserves the original search records, precise publish dates and continuation.
One-credit enriched search
GET /v1/youtube/search?query=space%20exploration&type=video&include_metrics=true
Video rows gain metrics.views, metrics.likes, metrics.comments and metrics.duration_seconds. The existing channel batch supplies channel.handle, channel.avatar_url, channel.subscribers and channel.subscribers_hidden when available. Zero stays zero; unavailable fields stay null. Subscriber counts are YouTube’s publicly rounded counts.
Check data.enrichment.metrics and data.enrichment.channels: ok, partial, unavailable or not_needed. Metrics marked ok have views and duration for every distinct returned video; optional engagement counts can still be null. Channels marked ok have some metadata for each distinct channel; individual fields can still be null. channel_handles_matched, channel_avatars_matched and channel_subscribers_matched report field availability by distinct channel. An optional lookup failure retains the search page and adds a warning. A fallback source may omit enrichment entirely and provide a warning.
Each request uses at most one video batch and one channel batch. Keep the same inputs and include_metrics=true when following the cursor. Search without the option keeps its existing response and cost.
For a creator’s verification and external links, use youtube/profile with a handle. verified and links are source-reported and nullable. The separate channel lookup retains its existing precise dates and upload metadata.
Video disclosure and channel metadata
youtube/video returns has_paid_product_placement from the video source’s explicit disclosure. True means the source reports paid placement, false is an explicit negative, and null means unavailable. This is captured in the existing video request; it is never inferred from a caption or description.
GET /v1/youtube/video?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFkjNbTCFY1Q&include_channel=true
Add include_channel=true for the channel handle, avatar and public subscriber metadata at the normal video price. It uses at most one additional channel batch and joins only the exact channel ID. The original video’s dates, counters and channel identity are retained if the optional lookup fails. Check data.enrichment.channels and the field-availability counts; missing metadata stays null. Search’s existing include_metrics=true already includes this channel metadata.
Preview, then run
The separate Node.js batch workflow remains available when you want to control which videos receive a detail lookup. It uses the normal component prices. With Node.js 22 or newer, set MONOCRAWL_API_KEY and run a free estimate:
node youtube-search-metrics.mjs '{"query":"space exploration","maxResults":25,"maxVideos":25,"maxCredits":3,"estimateOnly":true}'Remove estimateOnly to execute. The workflow uses the public GET endpoints with your key. It checks both prices before spending, checks again before each request, and sends a per-call X-Max-Credits ceiling. Choose maxCredits using the current estimate.
maxResults accepts 1–50 and defaults to 25. maxVideos accepts 0–50 and defaults to 50; zero runs search only. One run reads one search page and at most one batch of distinct video IDs. It never fans out into one lookup per video.
Read the enriched results
Each search row retains its existing fields and gains metrics: views, likes, comments and duration_seconds. A measured zero stays zero; unavailable values stay null. metrics_status explains whether the lookup succeeded, was unrequested, unavailable or failed.
The join uses the exact video ID and never overwrites published_at. Rows retain their order even if the batch answers in a different order, omits a private video or fails. The returned cursor and has_more still describe the search page; pass the cursor back with the same query and key for another explicitly priced run.
Ordinary youtube/search requests keep their existing response and cost. This downloadable helper adds the batch only when you run it.
Costs and partial results
| Component | Current base price |
|---|---|
youtube/search | 1 credits |
youtube/videos | 2 credits |
The maximum is one search price plus one GET video-batch price. Empty searches skip the batch, and cache hits can lower the charge. The helper reports its ledger and confirmed credits. maxDurationSeconds defaults to 90 and accepts 1–180.
A missing paid response stops the workflow without automatic retries, retains that request’s maximum charge under credits_reserved_unknown, and reports a partial result. Check account usage before retrying. A successful search remains charged if a later enrichment fails.