82trust / 100

Youtube Transcript

by agdata in AI models & inference

x402 APIPassing, checked 2 min ago

YouTube transcript API for AI agents: send a video URL or 11-character id and get its published subtitles as timed JSON segments, plain text, SRT or WebVTT, with title, channel, duration, views and publish date. Choose one of ten subtitle languages or any. No speech-to-text. A video without subtitles in that language is not charged.

POST https://agdata.shveik.dev/x402/youtube-transcript

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
63 ms typical, 63 ms slowest 5%
Last check
2 min ago
Next check
in 30 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agdata.shveik.dev/x402/youtube-transcript" \
  -H "content-type: application/json" \
  -d '{"format":"json","lang":"en","video":"dQw4w9WgXcQ"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagdata.shveik.dev%2Fx402%2Fyoutube-transcript
const res = await pay("https://agdata.shveik.dev/x402/youtube-transcript", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"format":"json","lang":"en","video":"dQw4w9WgXcQ"}),
});
console.log(await res.json());

Example input

{
  "format": "json",
  "lang": "en",
  "video": "dQw4w9WgXcQ"
}

Example output

{
  "availableLanguages": [],
  "channelName": "Rick Ast…",
  "channelUrl": "https://…",
  "durationSeconds": 213,
  "format": "json",
  "language": "en",
  "publishedAt": "2009-10-…",
  "segmentCount": 61,
  "subtitleType": "user_gen…",
  "title": "Rick Ast…",
  "transcript": [],
  "truncated": false,
  "url": "https://…",
  "videoId": "dQw4w9Wg…",
  "viewCount": 1822672170
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 min agoPassed402185 ms$0.032
5 h agoPassed40263 ms$0.032