Backend for a post-publish video intelligence tool. Given a YouTube URL, it:
- Fetches real public metrics
- Compares them against 174k 2026 trending videos across 11 countries
- Generates 4 LLM-reasoned counterfactual scenarios (what-if creative changes)
- Produces a next-upload recommendation
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in the project root:
GROQ_API_KEY=YOUR API KEY
Place the 2026 YouTube Trending Kaggle dataset CSVs in archive/ (not committed — download from Kaggle).
python -m uvicorn app.main:app --reloadThen open http://127.0.0.1:8000/docs for the Swagger UI.
curl -X POST http://127.0.0.1:8000/api/benchmarks/build -H "Content-Type: application/json" -d '{}'POST /api/benchmarks/build— process dataset into benchmark JSONPOST /api/analyses— create analysis contextPOST /api/analyses/{id}/publish-link— attach YouTube URL, fetch real metadataGET /api/analyses/{id}/post-publish— benchmark-backed diagnosis with LLM insightsPOST /api/analyses/{id}/counterfactual-simulate— LLM-reasoned scenariosGET /api/analyses/{id}/next-recommendation— LLM next-upload strategy