Licence
MIT
Version
0.6.5
Deps
1
Size
70 kB
Vulns
0
Weekly
1.5K
@apicity/youtube
YouTube Data API v3 provider for posting content.
Runtime dependencies:
zod@^4.4.3— request schemas attached to every POST endpoint as.schema
Installation
npm install @apicity/youtube
# or
pnpm add @apicity/youtubeQuick Start
import { createYouTube } from "@apicity/youtube";
const youtube = createYouTube({ apiKey: process.env.YOUTUBE_API_KEY! });API Reference
5 endpoints across 4 groups. Each method mirrors an upstream URL path.
channels
GET youtube.channels.list
GET https://www.googleapis.com/youtube/v3/channels{query}
const res = await youtube.channels.list({ /* ... */ });
transcripts
GET youtube.transcripts
GET https://www.youtube.com/watch?v={videoId}
const res = await youtube.transcripts({ /* ... */ });
videoMetadata
youtube.videoMetadata
const res = await youtube.videoMetadata({ /* ... */ });
videos
POST youtube.videos.insert
POST https://www.googleapis.com/youtube/v3/videos{query}
const res = await youtube.videos.insert({ /* ... */ });
GET youtube.videos.list
GET https://www.googleapis.com/youtube/v3/videos{query}
const res = await youtube.videos.list({ /* ... */ });
Middleware
import { createYouTube, withRetry } from "@apicity/youtube";
const youtube = createYouTube({ apiKey: process.env.YOUTUBE_API_KEY! });
const models = withRetry(youtube.get.v1.models, { retries: 3 });Part of the apicity monorepo.
License
MIT — see LICENSE.