Skip to main content

Purpose

Finds 5 competitors for a business URL using Exa’s AI-powered search. Used on the marketing website to show visitors their competitive landscape.

Architecture

Two-Step Approach

  1. Fetch Content - Get the business website content via Exa /contents
  2. Find Competitors - Ask Exa /answer to identify competitors based on the content
This ensures accurate competitor identification by understanding what the business does first.

Internal Services

ServicePurpose
fetch_website_contentGets website content via Exa
fetch_competitors_from_exaUses Exa Answer to find competitors
parse_json_from_answerExtracts JSON from Exa response
parse_competitors_from_textFallback text parsing
fallback_from_citationsUses citations if parsing fails
add_favicon_urls_to_competitorsAdds favicon URLs

Code Location

src/website/competitor_research/
├── routes.py    # HTTP endpoint
└── service.py   # All business logic

Rate Limiting

  • 10 requests per minute per IP address

Automatic Retry

The service automatically retries once on failure (timeout, API error, or insufficient results).