All AI API keys listed here are optional. SENTi-radar has built-in fallback mechanisms and works without any external AI keys by using local keyword-based analysis.
Overview
| Service | Purpose | Required | Free Tier | Monthly Quota |
|---|---|---|---|---|
| Scrape.do | X & Reddit scraping | ⭐ Recommended | ✅ Yes | 1,000 requests |
| YouTube Data API | Video comments | Optional | ✅ Yes | 10,000 units/day |
| OpenAI | AI insights (Tier 1) | Optional | ❌ Pay-per-use | $0.15/1M input tokens |
| Google Gemini | AI analysis (Tier 2) | Optional | ✅ Yes | 15 RPM (free tier) |
| Groq | LLM fallback (Tier 3) | Optional | ✅ Yes | 14,400 requests/day |
| Parallel.ai | Social search fallback | Optional | ❌ Paid only | Varies by plan |
Scrape.do (Recommended)
This is the primary data source for X (Twitter) and Reddit. Without it, the app falls back to YouTube → Parallel.ai → Algorithmic generation.
Create account
- Go to scrape.do
- Click Sign Up or Start Free Trial
- Verify your email address
Get API token
- Log in to Scrape.do dashboard
- Navigate to API Tokens section
- Copy your default token or create a new one
- Note your free tier credits (usually 1,000 requests)
- Free tier: 1,000 requests
- Standard request: 1-5 credits
- With rendering: 5-10 credits
- Residential proxies: 25-50 credits
YouTube Data API v3
Enables fetching video search results and comments for sentiment analysis.Create Google Cloud project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter project name:
senti-radar-youtube - Click Create
Enable YouTube Data API
- In the Cloud Console, go to APIs & Services → Library
- Search for “YouTube Data API v3”
- Click YouTube Data API v3
- Click Enable
Create API credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → API Key
- Copy the generated API key
- (Optional) Click Restrict Key to add application restrictions:
- Application restrictions: HTTP referrers or IP addresses
- API restrictions: Restrict to YouTube Data API v3
- Default: 10,000 units per day
- Search request: 100 units
- Video details: 1 unit
- Comments: 1 unit
OpenAI (GPT-4o mini)
Tier 1 AI provider for strategic insights and chat. Provides the highest quality analysis.Create OpenAI account
- Go to platform.openai.com
- Click Sign up and create an account
- Complete email verification
Add billing
- Navigate to Billing Settings
- Add a payment method
- Set a usage limit to control costs (recommended: $10/month)
Create API key
- Go to API Keys
- Click Create new secret key
- Name it:
senti-radar-production - Copy the key (starts with
sk-proj-)
gpt-4o-mini
Rate Limits:
- Free tier: Not available (pay-per-use only)
- Tier 1: 500 RPM, 200,000 TPM
- Tier 2+: Higher limits based on usage
- Input: $0.150 per 1M tokens
- Output: $0.600 per 1M tokens
- Typical insight report: ~$0.001-0.003 per analysis
- Client-side AI Insights Panel (strategic reports and chat)
Google Gemini AI
Tier 2 AI provider for sentiment analysis, emotion detection, and summary generation.Get API key
- Go to Google AI Studio
- Click Get API key
- Sign in with your Google account
- Click Create API key
- Select a Google Cloud project (or create new)
- Copy the generated API key
gemini-2.0-flash
Rate Limits (Free Tier):
- 15 requests per minute (RPM)
- 1 million tokens per minute (TPM)
- 1,500 requests per day (RPD)
- Free tier: Generous limits for development
- Pay-as-you-go: $0.075 per 1M input tokens
analyze-sentiment(sentiment + emotion classification)generate-insights(AI summaries and key takeaways)analyze-topic(comprehensive topic analysis)
Groq
Secondary LLM option for streaming AI summaries (alternative to Gemini).Create Groq account
- Go to console.groq.com
- Sign up with email or Google account
- Verify your email
Generate API key
- Log in to Groq Console
- Click Create API Key
- Enter a name:
senti-radar-production - Click Create
- Copy the API key (starts with
gsk_)
llama-3.1-70b-versatilellama-3.1-8b-instantmixtral-8x7b-32768gemma2-9b-it
- 14,400 requests per day
- 30 requests per minute
- Very fast inference speed (100+ tokens/sec)
- Free tier: 14,400 requests/day
- Pay-as-you-go: $0.10 per 1M tokens (Llama 3.1 8B)
Parallel.ai (Optional)
Social search fallback when Scrape.do is unavailable.Sign up for Parallel.ai
- Go to parallel.ai
- Contact sales or sign up for a plan
- Complete onboarding and payment setup
Get API key
- Log in to Parallel.ai dashboard
- Navigate to Settings → API Keys
- Generate a new API key
- Copy the key
fetch-twitter edge function (Step 2 fallback)
Documentation: Contact Parallel.ai support for API docs
Verification Checklist
After obtaining your API keys, verify they’re configured correctly:Test API connections
Start the development server:
- Create a new topic in the UI
- Watch browser console for API calls
- Check for successful responses (HTTP 200)
- Verify posts are fetched and analyzed
Best Practices
Security
Key Rotation
Rate Limiting
- Implement exponential backoff for rate limit errors (429)
- Cache API responses to reduce duplicate requests
- Monitor quota usage in each service’s dashboard
- Set up alerts when approaching quota limits
Cost Optimization
- Use free tiers first before upgrading to paid plans
- Enable only necessary APIs (start with Scrape.do + Gemini)
- Monitor usage in each provider’s dashboard
- Implement caching to reduce redundant API calls
- Use fallbacks wisely:
- Scrape.do (primary)
- YouTube (secondary)
- Parallel.ai (tertiary, paid)
- Algorithmic (guaranteed fallback)
Troubleshooting
API Key Not Working
Problem: API returns 401/403 errors Solutions:- Verify key is copied correctly (no extra spaces)
- Check key is active in provider dashboard
- Verify API is enabled (for Google APIs)
- Check IP restrictions (if configured)
- Restart dev server after adding keys
Quota Exceeded
Problem: API returns 429 or quota error Solutions:- Check usage in provider dashboard
- Wait for quota reset (usually daily)
- Implement request caching
- Upgrade to paid tier
- Use fallback providers
Edge Function Can’t Access Secrets
Problem: Function logs show “undefined” for secrets Solutions:- Verify secrets are set:
supabase secrets list - Redeploy function after setting secrets
- Check secret name matches exactly (case-sensitive)
- View function logs:
supabase functions logs <function-name>
YouTube API Quota Depletes Quickly
Problem: Hitting 10,000 unit daily limit Solutions:- Each search costs 100 units (limit to 100 searches/day)
- Implement result caching in database
- Reduce
maxResultsparameter (default 15) - Request quota increase in Google Cloud Console
- Use YouTube only as fallback (not primary source)
API Key Reference Summary
Next Steps
Environment Variables
Complete environment configuration guide
Supabase Setup
Deploy edge functions and database
Scrape.do Integration
Advanced scraping configuration
Deployment
Deploy your app to production