⚙️ Setup Guide

Get live data from Meta Ad Library. Currently running on demo data.

1

Gemini API Key

Using Universal Key

Google Gemini (gemini-2.5-flash) powers the AI brief and competitive insights.

  1. 1.Visit aistudio.google.com/app/apikey
  2. 2.Click “Create API Key” (free, no credit card)
  3. 3.Copy the key and add it as GEMINI_API_KEY in .env.local

ℹ️ Currently using Emergent universal key (proxied). Replace with your own Gemini key for production.

2

Meta Ad Library Access Token

Demo Mode Active

Required for live ad scraping from Meta Ad Library. Without this, the app uses pre-loaded sample data.

  1. 1.Visit developers.facebook.com → Create a free developer account
  2. 2.Create a new App (type: Business)
  3. 3.Go to App Dashboard → Add “Marketing API” product
  4. 4.Navigate to Tools → Graph API Explorer
  5. 5.Generate a User Access Token with ads_read permission
  6. 6.Add it as META_ACCESS_TOKEN in .env.local

⚠️ Access token expires in 60 days. Use a System User token for production. The API is completely free with no rate limits for read-only access.

3

MongoDB

Connected

Database for storing scraped ads, AI insights, and weekly briefs.

  1. 1.Already configured in this environment
  2. 2.For Vercel deployment: use MongoDB Atlas free tier
  3. 3.Set MONGO_URL to your Atlas connection string

📅 Vercel Cron Job

Auto-scrape every Sunday midnight IST (6:30 PM UTC Sunday):

// vercel.json
{{
  "crons": [
    {{
      "path": "/api/scrape",
      "schedule": "0 18 * * 0"
    }}
  ]
}}