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

# Domain Report

> Get domain performance data aggregated by domain.

<Warning>Maximum date range 365 days</Warning>

<Note>
  This endpoint is public and does not require an API key for access.
</Note>

<RequestExample>
  ```bash Request theme={null}
    curl --request GET \
      --url https://api.growthchannel.io/domain/?date_from=2024-01-01&date_to=2024-01-07&advertiser_id=544
  ```
</RequestExample>

<CardGroup>
  <Card title="Method" icon="puzzle-piece">
    `GET`
  </Card>

  <Card title="Endpoint" icon="link">
    `/domain/`
  </Card>
</CardGroup>

## Headers

<ParamField header="X-Api-Key" type="string" required>
  The agency's API key for authorization. Contact an admin to get one.
</ParamField>

## Parameters

<ParamField path="date_from" type="string" required>
  Start date in YYYY-MM-DD format.
</ParamField>

<ParamField path="date_to" type="string" required>
  End date in YYYY-MM-DD format.
</ParamField>

<ParamField path="advertiser_id" type="integer" required>
  The unique identifier for the advertiser.
</ParamField>

<ParamField path="page" type="integer" default="0">
  Page number for pagination.
</ParamField>

<ParamField path="sort_column" type="string" default="impressions">
  Column to sort by.
</ParamField>

<ParamField path="sort_order" type="string" default="DESC">
  Sort order (ASC/DESC).
</ParamField>

<ParamField path="campaign_id" type="integer">
  Filter by a specific campaign ID.
</ParamField>

<ParamField path="domain_type" type="string">
  Filter by domain type (if applicable).
</ParamField>

## Responses

<Tabs>
  <Tab title="200 OK">
    ```json theme={null}
    {
      "data": [
        {
          "domain": "example.com",
          "impressions": 1200,
          "clicks": 45,
          "total_conversions": 3,
          "video_audio_views": 300,
          "video_audio_complete": 190,
          "total_revenue": 120.30,
          "total_spend": 56.00,
          "cpm": 46.67,
          "cpc": 1.24,
          "cpa": 18.67,
          "cpv": 0.18,
          "roas": 2.15,
          "vcr": 63.3,
          "ctr": 3.75
        }
      ],
      "pagination": {
        "current_page": 0,
        "total_pages": 5,
        "total_count": 100
      }
    }
    ```

    <ResponseField name="data" type="array">
      An array of domain performance objects.
    </ResponseField>

    <ResponseField name="pagination" type="object">
      An object containing pagination details.

      <Expandable title="object">
        <ResponseField name="current_page" type="integer">
          The current page number.
        </ResponseField>

        <ResponseField name="total_pages" type="integer">
          The total number of pages.
        </ResponseField>

        <ResponseField name="total_count" type="integer">
          The total number of records.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="400 Bad Request">
    Returned if required query parameters like `date_from` or `date_to` are missing.

    ```json theme={null}
    {
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Missing required parameters",
        "details": {
          "missing_fields": ["date_from", "date_to"]
        },
        "request_id": "..."
      }
    }
    ```
  </Tab>

  <Tab title="401 Unauthorized">
    Returned if the advertiser validation fails.
  </Tab>

  <Tab title="500 Internal Server Error">
    Returned if there is an unexpected error on the server while fetching data.
  </Tab>
</Tabs>
