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

# Get Business

> Retrieve business entity details including favicon

Gets the business entity associated with a Clerk organization.

## Authentication

Requires a valid Clerk JWT token in the `Authorization` header.

## Path Parameters

<ParamField path="business_id" type="string" required>
  The Clerk organization slug (e.g., `alphax-technologies-787155`)
</ParamField>

## Response

<ResponseField name="business" type="object">
  The business entity object, or `null` if not found.

  <Expandable title="Business Object">
    <ResponseField name="id" type="string">
      UUID of the business entity
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name of the business
    </ResponseField>

    <ResponseField name="url" type="string">
      Business website URL
    </ResponseField>

    <ResponseField name="favicon_url" type="string">
      Public URL to the business favicon (PNG, 128x128).
      Stored in Supabase Storage. May be `null` if not fetched yet.
    </ResponseField>

    <ResponseField name="citation_count" type="integer">
      Number of AI citations created for this business
    </ResponseField>

    <ResponseField name="clerk_org_id" type="string">
      Clerk organization slug
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://searchcompany-main.up.railway.app/api/business/alphax-technologies-787155" \
    -H "Authorization: Bearer YOUR_CLERK_JWT"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "business": {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "name": "AlphaX Technologies",
      "url": "https://alphax.inc",
      "favicon_url": "https://wrxafcplzfqywrswtlgg.supabase.co/storage/v1/object/public/favicons/alphax-technologies-787155/a1b2c3d4e5f6.png",
      "citation_count": 5,
      "clerk_org_id": "alphax-technologies-787155",
      "created_at": "2024-12-19T10:30:00Z"
    }
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Not Found theme={null}
  {
    "business": null
  }
  ```
</ResponseExample>

## Favicon Storage

Favicons are automatically fetched and stored during onboarding:

1. **Fetch**: Tries `/favicon.ico`, `/apple-touch-icon.png`, then Google's favicon service
2. **Convert**: Converts to PNG (128x128) for browser compatibility
3. **Upload**: Stores in Supabase Storage bucket `favicons`
4. **URL**: Returns public CDN URL

<Note>
  Favicons are only fetched for **business entities**, not products.
  If favicon fetch fails, the entity is still created with `favicon_url: null`.
</Note>

## Errors

| Status | Description                  |
| ------ | ---------------------------- |
| 401    | Missing or invalid JWT token |
| 500    | Database not configured      |
