The Content Length Comparator fetches top SERP results for a keyword and analyzes their content length to determine optimal word count for competitive ranking. It provides statistical analysis and recommendations based on competitor benchmarks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TheCraigHewitt/seomachine/llms.txt
Use this file to discover all available pages before exploring further.
Basic Usage
Use the convenience function for quick comparison:Class API
ContentLengthComparator
The main comparator class:analyze()
Analyze content length compared to SERP competitors.Search keyword to analyze
Your content’s word count for comparison
SERP results from DataForSEO. Each dict should contain:
url(string): Page URL to fetchdomain(string): Domain nametitle(string): Page title
Whether to fetch and analyze competitor content. Default:
TrueThe analyzed keyword
Number of competitor pages successfully analyzed
Your content’s word count
Statistical measures of competitor word counts:
min(int): Shortest competitor contentmax(int): Longest competitor contentmean(int): Average word countmedian(int): Median word countmode(int): Most common word countstd_dev(int): Standard deviationpercentile_25(int): 25th percentilepercentile_75(int): 75th percentile
Individual competitor data:
position(int): SERP position (1-10)url(string): Page URLdomain(string): Domain nametitle(string): Page titleword_count(int): Word count
Where your content falls in the competitor range
Length recommendations:
recommended_min(int): Minimum recommended word countrecommended_optimal(int): Optimal target word countrecommended_max(int): Maximum recommended word countyour_status(string): Status -too_short,short,good,optimal,longmessage(string): Actionable recommendation messagereasoning(string): Explanation of recommendation
Competitive comparison:
total_competitors(int): Total competitors analyzedlength_distribution(dict): Distribution by word count rangescomparison(dict): How you compare (if your_word_count provided)gap_to_median(dict): Gap to median (if below median)gap_to_75th_percentile(dict): Gap to 75th percentile
Statistics Analysis
Understand competitor content length distribution:Competitor Analysis
View individual competitor word counts:Recommendations
Get actionable length recommendations:Recommendation Logic
The recommended optimal target is calculated as:- Greater of: 75th percentile OR median + 20%
- This ensures you match or exceed top performers
Status Values
too_short: < 80% of recommended minimum - significantly shortshort: < recommended minimum - below most competitorsgood: < recommended optimal - competitive but room to improveoptimal: Within recommended range - matches top performers ✅long: > recommended maximum - longer than necessary
Length Distribution
See how competitor content is distributed across length ranges:Your Position
See where your content falls in the competitor range:Comparison Analysis
Get detailed comparison when your word count is provided:Gap Analysis
See how many words you’re behind competitors:Integration with DataForSEO
Combine with DataForSEO for real SERP analysis:Content Extraction
The comparator intelligently extracts main content:- Removes noise: Strips
script,style,nav,footer,header,asideelements - Finds main content: Looks for
article,main,.content,.post,.entry-content - Counts real words: Only counts words with 2+ characters
- Handles failures: Silently skips pages that fail to fetch
Real-World Example
Complete workflow:Error Handling
The module handles errors gracefully:- No SERP results provided
- Could not fetch competitor content
- Insufficient sections for clustering
Best Practices
- Target 75th percentile - aim to match or exceed top performers
- Analyze top 10 results - provides comprehensive competitor data
- Use with DataForSEO - get real-time SERP data
- Check regularly - competitor content lengths change over time
- Consider intent - transactional queries may need less content
- Quality over quantity - don’t add fluff just to hit word count
- Match or exceed median - minimum competitive threshold
Related Modules
- SEO Quality Rater - Includes word count in quality score
- Search Intent Analyzer - Different intents need different lengths
- Keyword Analyzer - Longer content affects keyword density