All resources
Guide·6 min read·Replit · Apify · OpenAI

Build a Viral Reel Decoder on Replit (My Exact Prompt)

This is the whole thing from the video. You paste any Instagram reel into the app and it tells you exactly why it blew up: a virality score, what your hook and curiosity gap scored, the moves the creator made that you would never notice, and a frame-by-frame of what was said versus what was shown. Below is the exact prompt I used to one-shot it on Replit, it scrapes the reel with Apify, transcribes the audio, and scans every frame with vision.

What you're building

A web app, the Viral Reel Decoder. You paste a reel URL and it scrapes the reel with Apify, transcribes the audio with Whisper, scans every frame with a vision model, then scores the virality and ranks the hook, curiosity gap, retention, and more. It tells you why it worked, the moves you missed, and gives a frame-by-frame breakdown of what was said versus what was shown. No code skills needed, Replit builds the whole thing from one prompt.

Step 1 - Open Replit

Go to Replit and start a new build with the Agent. This is where you paste the prompt and it writes the entire app for you.

Copy-paste this
https://replit.com/refer/ariacodez

Step 2 - Paste this exact prompt (the beefy one-shot)

This is the full build spec. It tells Replit the stack, the Apify scrape, the Whisper transcription, the vision passes, the scoring rubric, and the dashboard. Paste it in exactly as-is and let it build:

Copy-paste this
Build a complete, working web app called "Viral Reel Decoder" in ONE shot. It reverse-engineers why any Instagram reel went viral, frame by frame. Build the entire thing, backend and frontend, and make it actually run. Do not stub anything.

STACK
- Backend: Python + Flask.
- Frontend: one dark single-page dashboard (HTML + Tailwind via CDN + vanilla JS). No separate framework.
- Run the decode as a background job with a job id, and a /status/<id> endpoint the frontend polls so it can show live progress.
- requirements.txt: flask, apify-client, openai, opencv-python-headless, requests. Make sure ffmpeg is installed as a system dependency.

SECRETS (read from Replit Secrets, never hardcode)
- APIFY_TOKEN
- OPENAI_API_KEY

INPUT
- One field for an Instagram reel URL and a "Decode" button.

PIPELINE (run in the background, stream these 4 progress steps to the UI: "Fetching reel", "Transcribing audio", "Scanning frames with vision", "Decoding virality")
1. SCRAPE with Apify. Use apify-client. Run actor "apify/instagram-scraper" with input { "directUrls": [reelUrl], "resultsType": "details", "resultsLimit": 1 }. From the item, pull: caption, hashtags, videoViewCount, likesCount, commentsCount, ownerUsername, videoUrl, videoDuration. Download the videoUrl MP4 to a temp file with requests.
2. AUDIO. Use ffmpeg to extract and compress the audio to 16kHz mono mp3 so it clears Whisper's 25MB limit: ffmpeg -i input.mp4 -vn -ar 16000 -ac 1 -b:a 64k audio.mp3 -y.
3. TRANSCRIBE with OpenAI Whisper: model "whisper-1", response_format "verbose_json", timestamp_granularities ["word"]. Keep the word-level timestamps.
4. FRAMES. With OpenCV (cv2), extract one frame every 1.5 seconds. Resize each to max 512px on the long side, JPEG quality 75, base64-encode.
5. VISION PASS. For every frame, call OpenAI gpt-4o with the image (detail "low") and the prompt: "Describe what is on screen in this short-form video frame in 1-2 sentences: visible text, the app or website shown, and the action happening. Be specific." Run them in parallel, max 15 concurrent, preserve order.
6. MERGE. Build a timestamped timeline: for each 1.5s window, pair the words spoken in that window with that frame's visual description.
7. SCORE. Send the caption, engagement numbers, full transcript, and the merged timeline to gpt-4o and force a JSON response (response_format json_object) with EXACTLY this shape:
{
  "virality_score": <0-100 integer>,
  "categories": [
    {"name": "Hook (first 2s)", "score": <0-100>, "why": "<one line>"},
    {"name": "Curiosity gap", "score": <0-100>, "why": "<one line>"},
    {"name": "Retention & pacing", "score": <0-100>, "why": "<one line>"},
    {"name": "Emotional trigger", "score": <0-100>, "why": "<one line>"},
    {"name": "Payoff", "score": <0-100>, "why": "<one line>"},
    {"name": "CTA / gate", "score": <0-100>, "why": "<one line>"},
    {"name": "Shareability", "score": <0-100>, "why": "<one line>"}
  ],
  "why_it_worked": "<2-3 sentences>",
  "moves_you_missed": ["<1-3 specific, non-obvious things the creator did>"],
  "frame_by_frame": [{"t": "0.0s", "said": "<spoken>", "shown": "<on screen>"}],
  "final_thoughts": "<the single biggest lever and how to copy it>"
}
Tell the model to judge like a top short-form creator who lives and dies by the first 2 seconds, weight Hook and Curiosity gap the heaviest, and be specific, never generic.

OUTPUT DASHBOARD (dark theme, the result view)
- A big Virality Score up top with the @username and the view count.
- The 7 categories as labeled bars, each with its score and the one-line why.
- A "Why it worked" card.
- A highlighted "Moves you missed" card.
- A frame-by-frame section in two columns: what was SAID vs what was SHOWN, scrollable.
- A "Final thoughts" card at the bottom.
- While the job runs, show the 4 progress steps ticking off.

REQUIREMENTS
- Handle errors gracefully (bad or private URL, Apify failure, OpenAI failure) with a clear on-screen message.
- Clean up temp files after each run.
- One click from paste to full report. Build it complete and run it.

Step 3 - Add your keys and deploy

Replit builds the app in front of you. Add two secrets when it asks: your APIFY_TOKEN (the reel scraper, free tier is plenty) and your OPENAI_API_KEY (powers Whisper + the vision pass). Hit run, test it with a reel URL, then deploy to get your own live link.

What it scores

An overall Virality Score, plus a ranked breakdown of the hook (first 2 seconds), the curiosity gap, retention and pacing, the emotional trigger, the payoff, the CTA or gate, and shareability. Then a written 'why it worked,' the moves you missed, and the frame-by-frame.

Make it yours (cool tweaks)

Once it's running, ask Replit to add any of these in the same chat: "Add a button that rewrites my hook to score higher." "Let me paste two reels and compare them side by side." "Let me drop in a creator's whole profile and rank their reels best to worst." "Add an export button that saves the full report as a PDF." "Add a 'remix this' button that turns the breakdown into a script outline for my own version."

One last thing

It's genuinely wild what you can ship in an afternoon now. Go build it on Replit, paste the prompt, add your keys, and you'll have your own viral decoder live by tonight. Cheers.

Get the next one first

New prompts every week.

Free. The new drops and the tools behind them, before they hit the feed.

No spam · New issues Sunday · Unsubscribe anytime

Need it custom?

Want this built for you?

Tell me the idea and I’ll build it. An app, a tool, an automation. You don’t need to be technical.