YouTube channel API
Use when you need what a YouTube channel has published: up to 50 of its latest videos, shorts or streams with views, duration and approximate publish date. Accepts @handle, channel URL or channel ID. $0.01 per successful call; errors are not charged.
Parameters
GET https://scrapemole-api-mainnet.scrapemole.workers.dev/v1/youtube/channel
| Name | Required | Description |
|---|---|---|
channel | yes | Channel @handle, URL or UC… channel ID. |
tab | no | Which feed. One of: videos shorts streamsDefault: videos |
limit | no | Max videos (1-50). Default: 20 |
Call it
// npm i @x402/fetch @x402/evm viem import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from '@x402/fetch'; import { ExactEvmScheme } from '@x402/evm'; import { privateKeyToAccount } from 'viem/accounts'; // Your agent's own wallet, holding a little USDC on Base. No ScrapeMole account or API key. const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY); const pay = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }], }); // On 402 the wrapper signs the USDC authorization and retries once. const res = await pay('https://scrapemole-api-mainnet.scrapemole.workers.dev/v1/youtube/channel?channel=@3blue1brown&limit=5'); console.log(res.status, await res.json()); // Settled only on 200; the receipt (tx hash) is in the PAYMENT-RESPONSE header. if (res.ok) console.log(decodePaymentResponseHeader(res.headers.get('payment-response')));
# 1. Unpaid: returns 402 with price $0.01 and the payTo address curl -i "https://scrapemole-api-mainnet.scrapemole.workers.dev/v1/youtube/channel?channel=@3blue1brown&limit=5" # 2. Paid: repeat the request with a PAYMENT-SIGNATURE header (a signed USDC # authorization for the quoted amount). An x402 client does this for you: # see the JavaScript tab.
Also available as the MCP tool youtube_channel on https://scrapemole-api-mainnet.scrapemole.workers.dev/mcp (x402 MCP transport, same price).
Example response
A real response from this endpoint (arrays and long strings trimmed here).
{
"count": 2,
"videos": [
{
"videoId": "4MJnPVnY3_o",
"url": "https://www.youtube.com/watch?v=4MJnPVnY3_o",
"title": "The Best Espresso Machine You've Never Heard Of",
"channelName": "Daddy Got Coffee",
"channelId": "UCu7x43fFlwbBykF1r04T_wQ",
"channelHandle": "@DaddyGotCoffee",
"channelUrl": "https://www.youtube.com/channel/UCu7x43fFlwbBykF1r04T_wQ",
"viewCount": 158741,
"viewCountText": "158,741 views",
"publishedText": "8 months ago",
"publishedAtApprox": "2026-02-07",
"durationSeconds": 1215,
"durationText": "20:15",
"isShort": false,
"isLive": false,
"badges": [
"4K"
],
"isVerifiedChannel": false,
"descriptionSnippet": "The $3000 espresso category hasn't changed in years — until now. The Arkel Coast brings saturated group performance, flow ...",
"thumbnailUrl": "https://i.ytimg.com/vi/4MJnPVnY3_o/maxresdefault.jpg",
"sourceType": "search",
"searchQuery": "espresso machine review",
"position": 2,
"likeCount": 1986,
"commentCount": 280,
"publishDate": "2026-02-07T03:00:13-08:00",
"uploadDate": "2026-02-07T03:00:13-08:00",
"category": "People & Blogs",
"description": "The $3,000 espresso category hasn’t changed in years — until now.\nThe Arkel Coast brings saturated group performance, flow control, shot …",
"keywords": [],
"isLiveNow": false,
"isFamilySafe": true,
"isShortsEligible": false,
"availableCountriesCount": 249
},
{
"videoId": "miNqgmVH9I0",
"url": "https://www.youtube.com/watch?v=miNqgmVH9I0",
"title": "Best Entry Level Espresso Machines 2025 – Our Top Picks for Beginners",
"channelName": "Whole Latte Love",
"channelId": "UCJwRmBtnYh_7Xs9oXUrLhZg",
"channelHandle": "@Wholelattelovepage",
"channelUrl": "https://www.youtube.com/channel/UCJwRmBtnYh_7Xs9oXUrLhZg",
"viewCount": 169694,
"viewCountText": "169,716 views",
"publishedText": "11 months ago",
"publishedAtApprox": "2025-11-08",
"durationSeconds": 929,
"durationText": "15:30",
"isShort": false,
"isLive": false,
"badges": [
"4K"
],
"isVerifiedChannel": true,
"descriptionSnippet": "Looking for the best entry level espresso machine in 2025? We tested the top affordable espresso machines to find which ones ...",
"thumbnailUrl": "https://i.ytimg.com/vi_webp/miNqgmVH9I0/maxresdefault.webp",
"sourceType": "search",
"searchQuery": "espresso machine review",
"position": 3,
"likeCount": 1259,
"commentCount": 115,
"publishDate": "2025-11-07T12:30:07-08:00",
"uploadDate": "2025-11-07T12:30:07-08:00",
"category": "Howto & Style",
"description": "Looking for the best entry level espresso machine in 2025? We tested the top affordable espresso machines to find which ones make real ca…",
"keywords": [
"best entry level espresso machine 2025",
"espresso machine for beginners"
],
"isLiveNow": false,
"isFamilySafe": true,
"isShortsEligible": false,
"availableCountriesCount": 249
}
]
}Live test results
5/5Live calls from Cloudflare Workers, 11 Oct 2026 11:02 UTC
6/6Live calls from the Vercel deployment, 11 Oct 2026 11:22 UTC
Paid end-to-end checks (Base Sepolia testnet, 11 Oct 2026 18:36 UTC)
| Call | Status | Charged | Pass |
|---|---|---|---|
unpaid /v1/youtube/channel | 402 | price quoted | ✓ |
paid /v1/youtube/channel?channel=@3blue1brown&limit=5 | 200 | $0.01 | ✓ |
paid /v1/youtube/channel?channel=@zzqq-no-such-channel-8812731 (unknown channel) | 404 | $0 | ✓ |
Errors
Failures return JSON like {"error": {"code": "NOT_FOUND", "message": "…", "charged": false}}. None of them are charged.
| Status / errorCode | Meaning |
|---|---|
400 INVALID_INPUT | Missing or malformed parameter. Fix the input. |
404 NOT_FOUND | The video, channel, product or term doesn't exist or isn't public. |
404 NO_DATA | It exists, but has nothing to return (for example no captions). |
503 BLOCKED | The source rate-limited us even after retries. Try again later. |
502 / 504 | Upstream error or timeout. Try again. |
402 | No or invalid payment. Pay the quoted amount and retry. |