-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your YouTube API key:YOUTUBE_API_KEY=your_actual_api_key_here -
Install dependencies (if not already done):
uv pip install -e . uv pip install pytest
pytest tests/test_youtube_tools.py -vpytest tests/test_youtube_api_tools.py -vpytest tests/ -v- The
.envfile is gitignored and will never be committed to the repository - Your API key is only loaded into environment variables when the tests run
- The API key is never logged or displayed in test output
- Video ID parsing from various URL formats
- Duration parsing (ISO 8601)
- Transcript extraction utilities
- Cache management
- Error response formatting
youtube_get_video_metadata- Fetches video detailsyoutube_get_channel_videos- Lists channel videosyoutube_get_channel_metadata- Gets channel infoyoutube_search_videos- Searches for videos
Be aware that running API tests will consume your YouTube API quota:
- Video metadata: 3 units per call
- Channel videos: 101+ units (search + details)
- Channel metadata: 3-103 units (depending on lookup method)
- Search: 100 units per call
Daily quota limit is typically 10,000 units for free tier.