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

# Daily Auction

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

<Note>
  This endpoint is protected and requires an agency API key for access.
</Note>

<RequestExample>
  ```bash Request theme={null}
    curl --request GET \
      --url https://api.growthchannel.io/daily-auction/?date_from=2025-01-01&date_to=2025-1-03&advertiser_id=544
  ```
</RequestExample>

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

  <Card title="Endpoint" icon="link">
    `/daily-auction/`
  </Card>
</CardGroup>

## Headers

<ParamField header="X-Api-Key" type="string" required>
  The agency's API key for authorization ask admin to create ot for your usage
</ParamField>

## Parms

<ParamField path="date_from" type="string" example="2025-01-01" required>
  Date staring from response will be generated <code>?date\_from=2025-01-01</code>
</ParamField>

<ParamField path="date_to" type="string" example="2025-01-01" required>
  Date ending with response will be generated <code>?date\_to=2025-01-03</code>
</ParamField>

<ParamField path="advertiser_id" type="number" example="544" required>
  The unique identifier for the adveticer <code>?advertiser\_id=544</code>
</ParamField>

<ParamField path="response_format" type="string" example="json">
  The unique identifier for the adveticer <code>?response\_format=json</code>\
  By default: <code>'json'</code> can choose <code>'csv' | 'json'</code>
</ParamField>

## Responses

<Tabs>
  <Tab title="200 OK">
    ```json theme={null}
    {
      "data": [
        {
          "campaign_id": 11111,
          "campaign_name": "Name | Name | 11",
          "impressions": 194,
          "clicks": 3,
          "spend": 0.65,
          "budget": 1704.66,
          "matched_bid_opp": 1096,
            "date": "2025-04-30"
        },
      ],
      "pagination": {
        "total_records": 100,
        "total_pages": 10
      },
      "parameters": {
        "date_from": "2023-01-01",
        "date_to": "2023-01-03",
        "advertiser_id": 544
      }
    }
    ```

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

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

      <Expandable title="object">
        <ResponseField name="total_records" type="integer">
          The total number of records found.
        </ResponseField>

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

    <ResponseField name="parameters" type="object">
      An object containing the query parameters used for the request.
    </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": "..."
      }
    }
    ```

    Returned if the date range between `date_from` and `date_to` exceeds 31 day.

    ```json theme={null}
    {
        "error": {
            "code": "VALIDATION_ERROR",
            "message": "Date range cannot exceed 31 day",
            "details": {
                "date_from": "2025-01-01",
                "date_to": "2025-1-09",
                "date_range": 8,
                "max_allowed": 7
            },
            "request_id": "4cf3fd6c-b2a8-483d-bb50-f51255c4943c"
        }
    }
    ```
  </Tab>

  <Tab title="401 Unauthorized">
    Returned if the `X-Api-Key` header is missing or invalid.
  </Tab>

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