> ## 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.

# Overview

> Architecture for the List Competitors endpoint

## Purpose

Returns a lightweight list of all competitors for the Explore tab bubble visualization. Includes both auto-discovered and user-added competitors.

## Architecture

```mermaid theme={null}
flowchart TD
    Request["GET /api/explore/competitors"]
    
    subgraph auth [Authentication]
        GetOrg["Get org_id from request.state"]
    end
    
    subgraph db [Database]
        Entities["entities table"]
        Competitors["competitors table"]
    end
    
    Request --> GetOrg
    GetOrg --> Entities
    Entities --> Competitors
    Competitors --> Response
```

## Response Format

```json theme={null}
{
  "status": "success",
  "competitors": [
    {
      "id": "uuid-...",
      "name": "Competitor A",
      "url": "https://competitor-a.com",
      "favicon_url": "https://...",
      "source": "auto_discovered"
    },
    {
      "id": "uuid-...",
      "name": "Competitor B",
      "url": "https://competitor-b.com",
      "favicon_url": null,
      "source": "user_added"
    }
  ],
  "count": 2
}
```

## Source Types

| Source            | Description                              |
| ----------------- | ---------------------------------------- |
| `auto_discovered` | Found during onboarding via Exa          |
| `user_added`      | Manually added by user                   |
| `own_business`    | The user's own business (for comparison) |

## Code Location

```
src/app/apis/explore/list_competitors/routes.py
```
