|
1 | 1 | # TranscriptFetch Node.js SDK |
2 | 2 |
|
3 | | -The official Node.js / TypeScript client for the [TranscriptFetch API](https://transcriptfetch.com). Fetch YouTube transcripts, channels, playlists, and search as clean, typed data, with built-in retries, idempotency, and a typed error hierarchy. |
| 3 | +The official Node.js / TypeScript client for the [TranscriptFetch API](https://transcriptfetch.com). Fetch transcripts as clean, typed data, with built-in retries, idempotency, and a typed error hierarchy. |
4 | 4 |
|
| 5 | +- Transcripts from **YouTube, TikTok, Instagram, and direct media file URLs** |
| 6 | +- YouTube channel, playlist, and search listing |
5 | 7 | - Typed responses (full TypeScript types, ESM + CommonJS) |
6 | 8 | - Automatic retries on 429 and 5xx with backoff |
7 | 9 | - Auto-generated idempotency keys on writes |
@@ -34,14 +36,33 @@ console.log("credits left:", t.usage?.balance); |
34 | 36 |
|
35 | 37 | Keep your key server-side. Never ship it to the browser. |
36 | 38 |
|
| 39 | +## Supported inputs |
| 40 | + |
| 41 | +`transcripts.video()` and `transcripts.batch()` accept: |
| 42 | + |
| 43 | +| Input | Example | |
| 44 | +| --- | --- | |
| 45 | +| YouTube URL or bare video ID | `https://youtu.be/aircAruvnKk`, `aircAruvnKk` | |
| 46 | +| TikTok video URL | `https://www.tiktok.com/@user/video/7137723462233555205` | |
| 47 | +| Instagram post or reel URL | `https://www.instagram.com/reel/Cxyz.../` | |
| 48 | +| Direct media file URL | `https://example.com/talk.mp3` | |
| 49 | + |
| 50 | +The string is sent to the API as-is, so the SDK never has to be upgraded for the |
| 51 | +API to accept a new input. |
| 52 | + |
| 53 | +`channel()`, `playlist()`, and `search()` are YouTube-only concepts and take |
| 54 | +YouTube handles, IDs, and queries. |
| 55 | + |
37 | 56 | ## Endpoints |
38 | 57 |
|
39 | 58 | ```ts |
40 | 59 | await tf.transcripts.video(video); // single transcript (text + segments) |
41 | | -await tf.transcripts.channel(channel, { limit, cursor }); // a channel's videos (metadata) |
42 | | -await tf.transcripts.playlist(playlist, { limit, cursor }); // a playlist's videos |
43 | | -await tf.transcripts.search(query, { limit, cursor }); // search YouTube |
44 | 60 | await tf.transcripts.batch(videoIds); // up to 50 transcripts in one call |
| 61 | +await tf.transcripts.channel(channel, { limit, cursor }); // a YouTube channel's videos (metadata) |
| 62 | +await tf.transcripts.playlist(playlist, { limit, cursor }); // a YouTube playlist's videos |
| 63 | +await tf.transcripts.search(query, { limit, cursor }); // search YouTube |
| 64 | +await tf.transcripts.job(jobId); // poll an async transcription job (free) |
| 65 | +await tf.me(); // validate the key, read the balance (free) |
45 | 66 | await tf.health(); // unauthenticated liveness probe |
46 | 67 | ``` |
47 | 68 |
|
@@ -100,6 +121,11 @@ const tf = new TranscriptFetch({ |
100 | 121 | - API docs: https://transcriptfetch.com/docs |
101 | 122 | - Python SDK: https://github.com/TranscriptFetch/python-sdk |
102 | 123 |
|
| 124 | +## Versioning |
| 125 | + |
| 126 | +This package follows [Semantic Versioning](https://semver.org/). Breaking |
| 127 | +changes only land in a new major version. |
| 128 | + |
103 | 129 | ## License |
104 | 130 |
|
105 | 131 | MIT |
0 commit comments