Overview
SENTi-radar aggregates sentiment data from multiple sources to provide comprehensive analysis. This guide walks you through configuring each data source by setting up API keys and tokens in your environment variables.All API keys are optional. SENTi-radar will work with whatever sources you configure and fall back gracefully to available data.
Environment Setup
All API keys are configured in a.env file at the root of your project.
Data Source: X (Twitter) via Scrape.do
What It Provides
Live posts from X.com search results using the “Latest” filter (real-time tweets, not algorithmic).Setup Instructions
Sign up for Scrape.do
Visit scrape.do and create an account.Pricing (as of 2026):
- Free tier: 1,000 requests/month
- Starter: $29/month for 20,000 requests
- Professional: $99/month for 100,000 requests
Each topic analysis uses 1-2 requests (one for X, one for Reddit). The free tier is enough for ~500 topic analyses per month.
Get your API token
After signing up:
- Navigate to your dashboard
- Click “API Tokens” in the sidebar
- Copy your token (starts with
scrape_...)
Verify setup
Analyze any topic and check the data source badges. You should see:✓ X via Scrape.do (green badge) - Posts fetched successfullyIf you see a gray badge or error, check:
- Token is correct (no extra spaces)
- Quota not exceeded (check Scrape.do dashboard)
.envfile is in project root- Dev server was restarted after adding the key
How It Works
ThefetchXPosts() function in src/services/scrapeDoProvider.ts performs:
- JavaScript rendering: X is a React SPA; Scrape.do renders it fully before scraping
- networkidle0 wait: Ensures tweets are loaded before capturing HTML
- Residential proxies: Bypasses X’s datacenter IP blocks (when
super: true) - Parsing strategy: Extracts
<article data-testid="tweet">elements and<div data-testid="tweetText">content
X parsing implementation
X parsing implementation
<span lang="en"> elements if article parsing fails.Troubleshooting X
'X via Scrape.do' shows as unavailable
'X via Scrape.do' shows as unavailable
Data Source: Reddit via Scrape.do
What It Provides
Recent Reddit posts and comments matching your query fromreddit.com/search.json.
Setup Instructions
Reddit uses the same Scrape.do token as X. Once you’ve addedVITE_SCRAPE_TOKEN, Reddit scraping is automatically enabled.
How It Works
Reddit provides a JSON API atreddit.com/search.json, which is easier to parse than HTML:
- No JavaScript rendering: Reddit’s JSON API is static
- Structured data: Direct access to title, selftext, author, created_utc
- Faster: JSON parsing is quicker than HTML parsing
Reddit parsing implementation
Reddit parsing implementation
Troubleshooting Reddit
Reddit returns 'Non-JSON' error
Reddit returns 'Non-JSON' error
Reddit sometimes returns HTML instead of JSON when it detects bots.Solution: Enable premium proxies:In
scrapeDoProvider.ts, modify the fetch call:Data Source: YouTube Comments
What It Provides
- Video titles and descriptions from search results
- Top-level comments from the 3 most relevant videos (up to 25 comments each)
Setup Instructions
Get YouTube Data API v3 key
- Go to Google Cloud Console
- Create a new project or select existing
- Enable YouTube Data API v3:
- Navigate to “APIs & Services” > “Library”
- Search for “YouTube Data API v3”
- Click “Enable”
- Create credentials:
- Go to “APIs & Services” > “Credentials”
- Click “Create Credentials” > “API Key”
- Copy the generated key
YouTube Data API is free with a quota of 10,000 units/day. Each topic analysis uses ~100-150 units (enough for 60+ analyses per day).
How It Works
ThefetchYouTubeComments() function performs a two-step process:
- Video titles (5 videos)
- Video descriptions (first 200 chars, 5 videos)
- Top-level comments (up to 75 total from 3 videos)
Troubleshooting YouTube
YouTube quota exceeded
YouTube quota exceeded
YouTube Data API has a daily quota of 10,000 units. Each request costs:
- Search: 100 units
- CommentThreads: 1 unit
- Wait until quota resets (midnight Pacific Time)
- Request quota increase in Google Cloud Console
- Disable YouTube temporarily by removing
VITE_YOUTUBE_API_KEY
'Comments disabled' or no comments returned
'Comments disabled' or no comments returned
Some videos have comments disabled. This is normal.Behavior: SENTi-radar will still use video titles/descriptions and move to the next video. If all 5 videos have comments disabled, YouTube contributes 0 comments but analysis continues with other sources.
Data Source: Google News RSS
What It Provides
News headlines from Google News RSS feeds matching your query.Setup Instructions
Google News RSS requires the Scrape.do token (same as X and Reddit). OnceVITE_SCRAPE_TOKEN is set, news scraping is automatically enabled.
No separate API key needed! Google News RSS is a public feed, but Scrape.do helps bypass rate limits and geo-restrictions.
How It Works
- Up to 10 news headlines
- Headlines are included in emotion scoring and AI summary generation
AI Summarization Services
SENTi-radar supports two AI providers for generating summaries:Gemini 2.0 Flash (Primary)
Tier: Primary (tried first)Get Gemini API key
- Visit Google AI Studio
- Click “Get API Key”
- Create a key for your project
- Copy the key (starts with
AIzaSy...)
- Streaming responses (word-by-word generation)
- Fast inference (~3-5 seconds)
- High-quality, nuanced summaries
- Free tier is generous for most use cases
Groq Llama 3.3 70B (Fallback)
Tier: Fallback (used if Gemini fails or is not configured)Get Groq API key
- Visit Groq Console
- Sign up or log in
- Navigate to “API Keys”
- Create a new key
- Copy the key (starts with
gsk_...)
- Extremely fast inference (~1-2 seconds)
- OpenAI-compatible API
- Open-source Llama model
- Great for high-frequency analysis
AI Fallback Hierarchy
Even with no AI keys configured, SENTi-radar generates high-quality summaries using template-based narratives and keyword analysis.
Security Considerations
Client-Side API Keys
Important: All keys prefixed with
VITE_ are embedded in the client-side JavaScript bundle and visible to anyone who inspects your page source.For production deployments, consider:- Moving Scrape.do calls to Supabase Edge Functions
- Storing tokens as Supabase secrets (not
VITE_prefixed) - Having the frontend call your Edge Functions instead of APIs directly
TopicDetail.tsx:24-30 for the security warning comment in the codebase.Recommended Production Architecture
- API keys never exposed to users
- Rate limiting enforced server-side
- Usage tracking and logging
- Can add authentication/authorization
Data Source Priority
SENTi-radar fetches data from all available sources in parallel for speed:- If X fails but Reddit succeeds → Use Reddit + YouTube + News
- If all sources fail → Fall back to keyword analysis (no live data)
- More sources = more accurate emotion detection
Testing Your Configuration
After adding keys, verify each source:Verify data source badges
Check for green ✓ badges:
- ✓ X via Scrape.do
- ✓ Reddit via Scrape.do
- Data source label should say “X · Reddit · YouTube · News”
Related Resources
- Analyzing Topics - Use your configured sources to analyze sentiment
- Understanding Metrics - How data from different sources affects emotion scoring
- Exporting Data - Export includes data source attribution for transparency