FastAPI + Gemini-first backend for analyzing YouTube Shorts, Instagram links with user-provided context, and uploaded videos. It generates a structured content report, creates a PDF, and can create shareable report links through Supabase Storage without user login or report history.
- FastAPI backend
- No login
- 100 MB video upload limit
- Gemini-first AI report generation
- YouTube Shorts metadata through YouTube Data API
- Instagram link intake with manual context first
- Uploaded video metadata through FFmpeg / ffprobe
- Uploaded video analysis through Gemini Files API when key is configured
- PDF report generation
- Shareable links through Supabase Storage, no database table required
- Report languages: English, Hindi, Tamil, Telugu, Spanish, French
- It does not scrape every Instagram, TikTok, LinkedIn, or Facebook reel from a public link.
- It does not access private analytics like saves, shares, audience retention, reach, or watch time unless the platform API and permissions allow it or the user provides them.
- It does not store user accounts or report history.
- Python 3.11+
- FFmpeg
- Git
Check FFmpeg:
ffmpeg -version
ffprobe -versioncd backend
python -m venv .venvWindows PowerShell:
.\.venv\Scripts\Activate.ps1Mac/Linux:
source .venv/bin/activatepip install -r requirements.txtcopy .env.example .envOn Mac/Linux:
cp .env.example .envOpen .env and paste your keys.
uvicorn app.main:app --reloadOpen:
http://127.0.0.1:8000
API docs:
http://127.0.0.1:8000/docs
- Go to Google AI Studio.
- Sign in with your Google account.
- Open API Keys.
- Click Create API key.
- Copy the key.
- Put it in
.env:
GEMINI_API_KEY=your_key_here
GEMINI_MODEL=gemini-3.5-flashUse this only on the backend. Never put the key inside frontend JavaScript.
- Go to Google Cloud Console.
- Create a new project, for example
sway-reel-agent. - Go to APIs & Services.
- Enable APIs and Services.
- Search for YouTube Data API v3.
- Click Enable.
- Go to Credentials.
- Click Create Credentials.
- Choose API key.
- Copy the key.
- Restrict the key to YouTube Data API v3 if possible.
- Put it in
.env:
YOUTUBE_API_KEY=your_key_here- Go to Supabase.
- Create a new project.
- Open Project Settings.
- Go to API Keys.
- Copy Project URL.
- Copy anon public key.
- Copy service_role key.
- Put them in
.env:
SUPABASE_URL=https://your-project-ref.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
SUPABASE_PUBLIC_BUCKET=reportsThe anon key is useful for frontend apps later. This MVP does not need it because the backend handles uploads.
- Open Supabase dashboard.
- Go to Storage.
- Create a bucket named
reports. - For easy public share links, make the bucket public.
- Keep the service role key only on the backend.
If you keep the bucket private, change the backend to generate signed URLs instead of public URLs.
- Go to Meta for Developers.
- Create a Business type app.
- Add Instagram and Facebook products needed for your use case.
- Use Instagram Login for Business or Facebook Login depending on the API path.
- Connect an Instagram professional account.
- Generate an access token from the app dashboard for testing.
- For public production use and advanced permissions, complete App Review.
- Put future values in
.env:
META_APP_ID=your_app_id
META_APP_SECRET=your_app_secret
META_ACCESS_TOKEN=your_access_tokenFor MVP, Instagram works best when the user uploads the video or pastes caption, transcript, visible stats, and comments.
- Go to TikTok for Developers.
- Create an app.
- Add the TikTok API product that matches your use case.
- Complete required review or research/commercial access steps.
- Copy Client Key and Client Secret.
- Put them in
.env:
TIKTOK_CLIENT_KEY=your_client_key
TIKTOK_CLIENT_SECRET=your_client_secret- Go to LinkedIn Developers.
- Create an app.
- Connect it to your LinkedIn Page or organization if required.
- Request the required products and permissions.
- Copy Client ID and Client Secret.
- Put them in
.env:
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secretLinkedIn video data requires approved access and ownership or admin context for many operations.
- Uploaded video analyzer
- YouTube Shorts metadata and Gemini analysis
- PDF report generation
- Supabase Storage public share links
- Instagram manual context mode
- Instagram/Facebook Meta API integration
- TikTok integration
- LinkedIn integration
- Admin prompt editor
- Paid usage limits and authentication
- Push this folder to GitHub.
- Go to Render.
- Create New Web Service.
- Connect GitHub repo.
- Root directory:
backend. - Build command:
pip install -r requirements.txt- Start command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT- Add environment variables from
.envinside Render dashboard.
Render free is enough for testing. Upgrade when video uploads and Gemini calls get heavier.
For the current static frontend, the FastAPI backend also serves it. If you want separate frontend hosting:
- Upload the
frontendfolder to Cloudflare Pages. - Set the frontend API base URL to your Render backend URL in
app.js. - Deploy.
- Never put
GEMINI_API_KEY,YOUTUBE_API_KEY, orSUPABASE_SERVICE_ROLE_KEYin frontend code. - Never commit
.envto GitHub. - Use backend environment variables only.
- Restrict Google API keys where possible.
- Rotate keys immediately if leaked.
Add an admin-only prompt editor later. Since you chose no login for MVP, changing agent rules should be done in backend prompt files first. Admin mode needs authentication.