# ytapi — YouTube Transcript & Metadata API > Specialized YouTube data API for AI agents, developers, and workflows. Fast InnerTube & timedtext extraction, MCP native, only bills on successful HTTP 200 responses. ## Core API Endpoints Base URL: `https://api.ytapi.dev` Authentication: `Authorization: Bearer yta_YOUR_KEY` Billing Rule: You only pay for successful HTTP 200 responses. Failed requests cost 0 credits. - `GET /v1/transcripts/{videoId}?lang={lang}&format={json|text|srt|vtt}`: Full transcript with timestamped segments. (1 credit) - `GET /v1/transcripts/{videoId}/languages`: Available transcript languages (including auto-generated ASR tags). (0 credits / Free) - `GET /v1/videos/{videoId}`: Video metadata (title, channel, duration, views, likes, publish date, keywords). (1 credit) - `GET /v1/search?q={query}&type={video|channel}&page={page}`: Search YouTube for videos or channels. (1 credit/page) - `GET /v1/channels/{idOrHandle}`: Resolve channel ID, handle, or custom URL. (0 credits / Free) - `GET /v1/channels/{channelId}/latest`: Latest 15 uploaded videos from channel RSS. (0 credits / Free) - `POST /v1/transcripts/batch`: Batch fetch up to 50 transcripts. (1 credit per successful item) ## Model Context Protocol (MCP) Server Direct streamable JSON-RPC HTTP endpoint for Claude Code, Cursor, and custom AI agents: - MCP Server URL: `https://ytapi.dev/api/mcp` - Auth Header: `Authorization: Bearer yta_YOUR_KEY` - Exposed Tools: `get_transcript`, `get_video_metadata`, `search_youtube`, `list_latest_videos` ### Connect Claude Code ```bash claude mcp add ytapi --transport http --header "Authorization: Bearer yta_YOUR_KEY" https://ytapi.dev/api/mcp ``` ### Connect Cursor ```json { "mcpServers": { "ytapi": { "url": "https://ytapi.dev/api/mcp", "headers": { "Authorization": "Bearer yta_YOUR_KEY" } } } } ``` ## Quick Example (cURL) ```bash curl -s "https://api.ytapi.dev/v1/transcripts/dQw4w9WgXcQ?format=json" \ -H "Authorization: Bearer yta_YOUR_KEY" ``` ## Documentation & Developer Resources - OpenAPI Spec: https://ytapi.dev/openapi.yaml - OpenAPI JSON: https://ytapi.dev/openapi.json - Full Documentation: https://ytapi.dev/docs - MCP Documentation: https://ytapi.dev/docs/mcp - Error Reference: https://ytapi.dev/docs/errors - Rate Limits & Pricing: https://ytapi.dev/docs/rate-limits - Live Status: https://ytapi.dev/status - Full LLM Context: https://ytapi.dev/llms-full.txt - Sitemap: https://ytapi.dev/sitemap.xml