@idiomark/adapter-youtube
YouTube adapter for Idiomark (Personality Compression Protocol). Extracts user personality data from YouTube including videos, comments, descriptions, and channel info.
Features
- Channel Info: Subscriber count, view count, channel description
- Videos: Titles, descriptions, views, likes, comments
- Comments: Threaded discussions with engagement metrics
- Playlists: User playlists and activity
Authentication
Uses API Key authentication.
import { YouTubeAdapter } from '@idiomark/adapter-youtube'
const adapter = new YouTubeAdapter({
apiKey: 'your_api_key',
channelId: 'your_channel_id'
})
await adapter.authenticate()
Rate Limits
YouTube enforces quota limits:
- 10,000 quota units per day
- Most API calls cost ~100 units each
The adapter tracks quota usage and warns when approaching limits.
Usage
// Fetch all user data
const content = await adapter.fetchData({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31'),
includeReplies: true
})
// Extract raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText({ limit: 100 })
Data Types
| Type | Description |
|---|---|
channel | YouTube channel metadata and stats |
video | Videos with titles, descriptions, and metrics |
comment | Comments with likes and replies |
API Documentation
License
MIT