Get quick AI-generated summaries for YouTube videos directly from their ID.
- Fetch video title and transcript using just the video ID.
- Generate a concise summary using the Anthropic Claude Haiku API.
- Save transcript data (JSON, TXT) and the summary (Markdown) to the
./outputs
directory.
- Node.js
- TypeScript
- Anthropic API (Claude 3.5 Haiku via
@anthropic-ai/sdk
) youtube-transcript
play-dl
(for video title)dotenv
- Clone:
git clone https://github.com/angusgee/youtube-tldr.git
- Navigate:
cd youtube-tldr
- Install:
npm install
- Configure API Key:
- Create a
.env
file in the project root. - Add your Anthropic API key:
ANTHROPIC_API_KEY=your_actual_api_key
- Create a
- Set Video ID: Open
main.ts
and change theexampleVideoId
variable. - Run:
npx ts-node main.ts
- Check Output: Find the results in the
./outputs
directory.
Built to demonstrate modular TypeScript, API integration, and async handling.