MEMORIES_API_KEY from Memories.aihttps://mavi-backend.memories.ai for transcriptiongenerate_report.py will auto-install fpdf2, pandas, openpyxl if missingAnalyze videos and provide actionable feedback for creators.
High ROI videos: <100 words, ~5s per product, visual-first + background music
Low ROI videos: >150 words, >15s per product, too much explaining
The core problem: Creators spend too much time "selling" instead of "showing".
Remember: Ads reach non-followers who need to be hooked in 3 seconds.
| Metric | ✅ GOOD (High ROI) | ❌ BAD (Low ROI) |
|---|---|---|
| -------- | ------------------- | ------------------ |
| Word Count | <100 words | >150 words |
| Time per Product | ~5 seconds | >15 seconds |
| Shows All Products Upfront | YES | NO |
| Format | Visual + Music | Talking/Explaining |
Requires Memories.ai API key. Get one at https://api-tools.memories.ai
Set environment variable:
export MEMORIES_API_KEY="sk-mavi-your-key-here"
import os
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = os.environ.get("MEMORIES_API_KEY")
HEADERS = {"Authorization": API_KEY}
def get_transcript(url: str, platform: str = "instagram"):
resp = requests.post(
f"{BASE_URL}/{platform}/video/transcript",
headers=HEADERS,
json={"video_url": url, "channel": "rapid"},
timeout=60
)
data = resp.json()
if data.get("success"):
text = data["data"]["transcripts"][0]["text"]
return {"text": text, "word_count": len(text.split())}
return {"error": data.get("msg")}
# Platform detection
def detect_platform(url):
url = url.lower()
if "tiktok" in url: return "tiktok"
if "instagram" in url: return "instagram"
if "twitter" in url or "x.com" in url: return "twitter"
return "youtube"
def analyze_video(url):
platform = detect_platform(url)
result = get_transcript(url, platform)
if "error" in result:
return result
word_count = result["word_count"]
return {
"url": url,
"word_count": word_count,
"word_count_status": "GOOD" if word_count < 100 else "OK" if word_count < 150 else "BAD",
"issues": [],
"transcript_preview": result["text"][:200]
}
Based on analysis, provide specific feedback:
If word_count > 150:
> "Your video has {X} words. Top performers use <100 words. Try replacing verbal explanations with visual demonstrations - stretch the fabric, spin around, show the fit."
If pace is slow (>15s per product):
> "You're spending ~{X} seconds per product. High-performers show each item in ~5 seconds. Try quick cuts - one outfit = one scene transition."
If no upfront overview:
> "Show ALL products in the first 2-3 seconds. Let viewers see the full haul immediately - it sets expectations and keeps them watching."
Always remind:
> "Remember: Ads reach people who DON'T follow you. You have 3 seconds to grab a stranger's attention - don't waste it on intros."
Detailed verbal reviews CAN work if:
Word count: 373 words can still perform if structure is right.
instagram.com/reel/Cy1zs4gLGFG - 46 words, 15s for 3 outfits, pure visualinstagram.com/reel/DEybxPbNeOl - 56 words, quick showcase, background musicinstagram.com/reel/DHHr5o2s1LG - 91 words, fast cuts, shows product featuresinstagram.com/reel/DBd6NxbOeBb - 91 words, demonstrates fit visuallyinstagram.com/reel/DCQJ355RWSE - 373 words but works: shows all upfront, low-pressureinstagram.com/reel/DRCdjLlDcla - 168 words, 30s per outfit, too much explainingHi [Creator],
Thanks for your video! Here's some feedback to help improve performance:
**What's Working:**
- [Specific positive]
**Opportunities:**
1. **Pacing**: Currently ~{X}s per product. Try ~5s per item with quick cuts.
2. **Word Count**: {X} words detected. Top performers use <100. Show more, tell less.
3. **Opening**: Consider showing all products in first 2-3 seconds.
**Key Reminder:**
Ads reach people who don't follow you yet. They need to be hooked in 3 seconds!
**Reference Videos:**
[Link to good example]
Best,
[Team]
def analyze_batch(excel_path, sample_size=20):
import pandas as pd
df = pd.read_excel(excel_path)
df.columns = [c.lower().replace('sum of ', '').replace(' ', '_') for c in df.columns]
# Get top and bottom performers
top = df.nlargest(sample_size // 2, 'roi')
bottom = df.nsmallest(sample_size // 2, 'roi')
results = []
for _, row in pd.concat([top, bottom]).iterrows():
url = row.get('video_url') or row.get('row_labels')
analysis = analyze_video(url)
analysis['roi'] = row['roi']
analysis['tier'] = 'TOP' if row['roi'] > 1.0 else 'BOTTOM'
results.append(analysis)
return results
共 1 个版本