Overview
SEO analysis scripts are config-driven and focus on:- Baseline Analysis: Comprehensive snapshot of MOFU/BOFU keyword rankings
- BOFU Rankings: Detailed analysis of high-value buyer-intent keywords
- Competitor Analysis: Head-to-head comparison vs competitors
config/competitors.json for keyword lists and competitor domains.
Configuration
Setup
Copy the example config:config/competitors.json with your data:
Keyword Types
BOFU (Bottom of Funnel)- High buyer intent
- Ready to purchase
- Examples: “[product] pricing”, “best [product] for [use case]”, “[product] vs [competitor]”
- Research phase
- Evaluating solutions
- Examples: “how to [solve problem]”, “benefits of [solution]”, “[topic] guide”
- “[competitor] alternative”
- “[competitor] vs [your brand]”
- Captures users searching for competition
Environment Variables
Set indata_sources/config/.env:
Baseline Analysis
Script:seo_baseline_analysis.py
Comprehensive snapshot of current SEO position for high buyer-intent keywords.
Usage
What It Does
-
DataForSEO Live SERP Check
- Checks current rankings for all BOFU keywords
- Checks current rankings for all MOFU keywords
- Categorizes: Page 1, Page 2-3, Not Ranking
-
GSC Performance Data
- Last 30 days of actual traffic
- Filters to high-intent keywords using relevant_terms
- Identifies quick wins (position 11-20)
- Commercial intent analysis
-
Summary Report
- Percentage breakdowns
- Traffic potential metrics
- Baseline snapshot for tracking progress
Output Example
Use Cases
- Monthly reporting: Track progress over time
- Initial audit: Establish baseline before optimization
- Competitor comparison: Compare against targets
- Strategy validation: See which keyword groups are working
BOFU Rankings
Script:seo_bofu_rankings.py
Detailed analysis of specific high-value buyer-intent keywords.
Usage
What It Does
-
Live SERP Check (DataForSEO)
- Checks top 50 results for each BOFU keyword
- Shows your position and URL
- Lists top 5 competitors
- Displays search volume, CPC, competition
-
Alternative Keywords
- Checks “[competitor] alternative” keywords
- Identifies capture opportunities
-
GSC High-Intent Analysis
- Filters all GSC data to relevant terms
- Shows Page 1, Page 2, Page 3+ distribution
- Detailed performance metrics
-
Key Query Performance
- Tracks specific important queries from config
- Shows best ranking position
- Total impressions/clicks for related variants
Output Example
Use Cases
- BOFU strategy: Focus on high-value buyer keywords
- Competitor tracking: Monitor positions vs competitors
- Alternative keywords: Capture users searching for competitors
- Conversion tracking: Correlate rankings with conversions
Competitor Analysis
Script:seo_competitor_analysis.py
Head-to-head comparison of your site vs configured competitors.
Usage
What It Does
-
Head-to-Head BOFU Rankings
- Checks each keyword for all competitors
- Shows who ranks where
- Visual status indicators
-
Ranking Comparison Table
- Side-by-side table of all positions
- Easy to spot gaps and wins
-
Competitor Keyword Analysis
- Fetches top 300 keywords for each competitor
- Filters to relevant industry terms
- Shows their top-ranking content
-
Keyword Gap Analysis
- Where competitors rank but you don’t
- Prioritized by search volume
- Content opportunities
-
Win/Loss Analysis
- Head-to-head wins vs each competitor
- Keywords where you win
- Keywords where you lose
-
MOFU Comparison
- Same analysis for MOFU keywords
- Research phase positioning
Output Example
Use Cases
- Competitive positioning: Understand your market position
- Gap identification: Find keywords competitors dominate
- Content strategy: Prioritize based on competitive intel
- Win analysis: Double down on areas where you’re winning
- Reporting: Executive summaries of competitive performance
Best Practices
Frequency
- Weekly: Quick spot-checks on critical keywords
- Monthly: Full baseline and competitor analysis
- Quarterly: Comprehensive reporting and strategy adjustment
Configuration Tips
- Start small: Begin with 10-20 critical BOFU keywords
- Expand gradually: Add more as you optimize existing ones
- Update regularly: Add new keywords as products/services evolve
- Remove irrelevant: Clean out keywords that don’t convert
- Segment by intent: Keep BOFU and MOFU separate
Cost Management
DataForSEO API costs:- Baseline Analysis: ~200-400 calls (0.40)
- BOFU Rankings: ~100-200 calls (0.20)
- Competitor Analysis: ~500-1000 calls (1.00)
- Limit competitor list to 3-5 direct competitors
- Use position_max and limit parameters
- Cache results when possible
- Run comprehensive analysis monthly, not daily
Interpreting Results
Priority Actions:- BOFU Page 2-3: Highest ROI - optimize existing content
- BOFU Not Ranking: Create new content targeting gaps
- Competitor Gaps: Study why they rank, what’s missing from your content
- Win/Loss Patterns: Understand your competitive advantages
- Page 1 %: Target 40-60% of BOFU keywords on page 1
- Quick Win Conversion: Target 50% of page 2-3 moved to page 1 within 3 months
- Traffic Lift: Monitor impressions and clicks from GSC
- Competitive Wins: Increase win ratio vs competitors over time
Integration with Workflow
Use SEO analysis findings:Troubleshooting
”No data available”
- Check DataForSEO credentials in
.env - Verify you have API credits
- Try with a simpler keyword first
”GSC Error: 403”
- Verify GSC API access is enabled
- Check service account credentials
- Ensure site is verified in GSC
”No keywords configured”
- Create
config/competitors.jsonfrom example - Add at least 5-10 keywords to test
High API costs
- Reduce competitor count
- Lower limit parameter
- Use position_max=30 instead of 100
- Run less frequently
Irrelevant keywords in results
- Add to
skip_termsin config - Refine
relevant_termsto be more specific - Filter results manually in reports