Implementation:ALwrity ALwrity GSCAnalyzerService analyze search performance
| Knowledge Sources | |
|---|---|
| Domains | SEO, GSC, Search_Analytics |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Concrete tool for enterprise-level Google Search Console search performance analysis with concurrent multi-dimensional analysis and AI recommendations, provided by the ALwrity SEO subsystem.
Description
The GSCAnalyzerService.analyze_search_performance method is stage 4 of the SEO Analysis Pipeline. It fetches GSC data for a site over a configurable date range (default 90 days), then runs eight analysis tasks concurrently via asyncio.gather: performance overview, keyword performance, page performance, content opportunities, technical SEO signals, competitive position, trend analysis, and AI recommendations. Each task is fault-tolerant — a failed task returns a status dict rather than aborting the whole analysis. The result is a comprehensive dict with all analysis dimensions plus execution metadata (timestamp, execution time, analysis period).
Usage
Import this service when:
- The SEO pipeline needs GSC search performance analysis for a site.
- Concurrent multi-dimensional analysis (keywords, pages, opportunities, trends) is needed.
- AI-powered recommendations should synthesise GSC data into actionable insights.
- Fault-tolerant analysis is required (one failed task should not abort the rest).
Code Reference
Source Location
- Repository: ALwrity
- File: backend/services/seo_tools/gsc_analyzer_service.py (L37-80+)
Signature
@dataclass
class ContentOpportunity:
keyword: str
impressions: int
clicks: int
ctr: float
position: float
priority_score: float
opportunity_type: str # 'high_volume_low_ctr', 'long_tail', 'ranking_improvement', etc.
recommendation: str
class GSCAnalyzerService:
"""Advanced Google Search Console analyzer with enterprise-level insights."""
def __init__(self):
self.gsc_service = GSCService()
async def analyze_search_performance(
self,
site_url: str,
date_range_days: int = 90,
user_id: Optional[str] = None,
) -> Dict[str, Any]:
"""
Comprehensive search performance analysis from GSC data.
Args:
site_url: Website URL registered in GSC.
date_range_days: Number of days to analyze (default 90).
user_id: Optional user ID for database integration.
Returns:
Comprehensive search performance analysis with performance_overview,
keyword_analysis, page_analysis, content_opportunities,
technical_signals, competitive_position, trend_analysis,
ai_recommendations.
"""
Import
from services.seo_tools.gsc_analyzer_service import GSCAnalyzerService
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| site_url | str | Yes | GSC-registered website URL |
| date_range_days | int | No | Analysis window (default 90) |
| user_id | Optional[str] | No | Clerk user ID for DB integration |
Outputs
| Name | Type | Description |
|---|---|---|
| return | Dict[str, Any] | status, performance_overview, keyword_analysis, page_analysis, content_opportunities, technical_signals, competitive_position, trend_analysis, ai_recommendations, execution_time |
Usage Examples
Analysing search performance
from services.seo_tools.gsc_analyzer_service import GSCAnalyzerService
service = GSCAnalyzerService()
results = await service.analyze_search_performance(
site_url="https://acme-coffee.com",
date_range_days=90,
user_id="clerk_user_123",
)
print(f"Status: {results['status']}")
print(f"Execution time: {results['execution_time_seconds']}s")
perf = results["performance_overview"]
print(f"Clicks: {perf.get('clicks')}, Impressions: {perf.get('impressions')}")
for opp in results.get("content_opportunities", {}).get("opportunities", []):
print(f" Opportunity: {opp['keyword']} (priority: {opp['priority_score']})")