FastAPI backend for the AI Recipe app: analyze cooking videos (YouTube, TikTok, Instagram) via Gemini and serve extracted recipes.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtTikTok video downloads use @tobyg74/tiktok-api-dl. Install dependencies:
npm installIf npm install fails due to native modules (e.g. canvas), use:
npm install --ignore-scriptsEnsure Node is on your PATH so the backend can run node download_tiktok.js ....
source .venv/bin/activate
uvicorn main:app --reload --host 0.0.0.0 --port 8000- POST /analyze_reel – Body:
{ "url": "https://..." }. Supports YouTube, TikTok (tiktok.com,vt.tiktok.com), and Instagram Reels. Returns recipe JSON and optionalvideo_urlfor in-app playback. - GET /video/{video_id} – Stream a previously downloaded video (e.g. from TikTok/Instagram).
| Platform | Example URLs |
|---|---|
| YouTube | youtube.com/watch?v=..., youtu.be/... |
| TikTok | tiktok.com/@user/video/..., vt.tiktok.com/... |
| Reel URLs |