> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Website Content

<Note>
  **Internal Service** — This is not an HTTP endpoint. It's called by the competitor research service.
</Note>

## Purpose

Step 1 of competitor research: Fetches the business website content using Exa's `/contents` endpoint.

## Function Signature

```python theme={null}
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

```python theme={null}
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:

1. Enough context to understand the business
2. Keeps Exa Answer API costs low
3. Faster response times

## Code Location

```
src/website/competitor_research/service.py
# Lines 60-88: fetch_website_content()
```
