https://github.com/nitesht2/transcript-api
API to transcribe TikTok and Instagram videos to text — paste a URL, get a transcript
https://github.com/nitesht2/transcript-api
api fastapi instagram python tiktok transcription whisper yt-dlp
Last synced: 16 days ago
JSON representation
API to transcribe TikTok and Instagram videos to text — paste a URL, get a transcript
- Host: GitHub
- URL: https://github.com/nitesht2/transcript-api
- Owner: nitesht2
- Created: 2026-04-19T00:24:26.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-04T21:35:45.000Z (22 days ago)
- Last Synced: 2026-06-04T23:12:35.511Z (22 days ago)
- Topics: api, fastapi, instagram, python, tiktok, transcription, whisper, yt-dlp
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Transcript API
**Paste a TikTok or Instagram video URL, get clean text back.** A small, self-hostable FastAPI service that downloads a short-form video and transcribes its audio locally with Whisper — no third-party transcription service, no per-minute fees.




---
## Architecture
```mermaid
flowchart LR
C[Client] -->|POST /transcribe
X-API-Key| A[FastAPI app]
A --> P{detect platform}
P -->|tiktok / instagram| D[yt-dlp
download audio]
D --> W[faster-whisper
transcribe]
W --> R[JSON: transcript,
word_count, platform]
R --> C
```
## Endpoints
| Method | Path | Description |
|--------|------|-------------|
| `POST` | `/transcribe` | Body `{ "url": "..." }` → returns the transcript, platform, word count, and method |
| `GET` | `/health` | Liveness check → `{ "status": "ok" }` |
Auth is via the `X-API-Key` header (set the `API_KEY` env var in production; defaults to `dev` locally).
## Quick start
```bash
git clone https://github.com/nitesht2/transcript-api.git
cd transcript-api
pip install -r requirements.txt # also needs ffmpeg + yt-dlp on PATH
API_KEY=mykey uvicorn main:app --host 0.0.0.0 --port 8000
```
Transcribe a video:
```bash
curl -X POST http://localhost:8000/transcribe \
-H "X-API-Key: mykey" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.tiktok.com/@user/video/123456789"}'
```
```json
{
"url": "https://www.tiktok.com/@user/video/123456789",
"platform": "tiktok",
"transcript": "...",
"word_count": 142,
"method": "yt-dlp"
}
```
## Configuration
| Env var | Default | Notes |
|---------|---------|-------|
| `API_KEY` | `dev` | Required header value in production |
| `WHISPER_MODEL` | `base.en` | `tiny.en` for speed, `medium.en` for accuracy |
## Tech stack
FastAPI · Uvicorn · yt-dlp · faster-whisper · ffmpeg
Supported platforms: TikTok and Instagram (Reels / video posts).
## Deploy
`deploy.sh` provisions the service on a Linux VPS — installs system + Python dependencies and registers a `systemd` unit so the API runs persistently and restarts on failure:
```bash
ssh user@your-vps-ip
API_KEY=yourkey bash deploy.sh
```
## License
MIT