Internal Service β This is not an HTTP endpoint. Itβs called by the competitor research service.
Purpose
Step 1 of competitor research: Fetches the business website content using Exaβs /contents endpoint.
Function Signature
async def fetch_website_content(api_key: str, url: str) -> str
Parameters
| Parameter | Type | Description |
|---|
api_key | str | Exa API key |
url | str | Business website URL |
Returns
str - First 2000 characters of website text content
Exa API Call
POST https://api.exa.ai/contents
{
"urls": [url],
"text": True,
"livecrawl": "fallback"
}
| Option | Value | Description |
|---|
urls | [url] | Single URL to fetch |
text | True | Return text content |
livecrawl | "fallback" | Live crawl if not cached |
Why 2000 Characters?
The content is truncated to 2000 characters because:
- Enough context to understand the business
- Keeps Exa Answer API costs low
- Faster response times
Code Location
src/website/competitor_research/service.py
# Lines 60-88: fetch_website_content()