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

# Fetch Campaign Statistics by Campaign ID

> Fetch campaign statistics using the campaign's ID

## Path Parameters

<ParamField path="campaign_id" type="integer" required>
  Campaign ID
</ParamField>

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your API key
</ParamField>

<ParamField query="offset" type="integer">
  List offset
</ParamField>

<ParamField query="limit" type="integer">
  Max number of stats to return (max 1000)
</ParamField>

<ParamField query="email_sequence_number" type="integer">
  Single sequence number (min: 1, max: 20)
</ParamField>

<ParamField query="email_status" type="string">
  Filter by email status. Possible values: `opened`, `clicked`, `replied`, `unsubscribed`, `bounced`
</ParamField>

<ParamField query="sent_time_start_date" type="string">
  Filters campaign stats with sent time greater than this date. Format: `2023-10-16 10:33:02.000Z`
</ParamField>

<ParamField query="sent_time_end_date" type="string">
  Filters campaign stats with sent time less than this date. Format: `2023-10-16 10:33:02.000Z`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://server.smartlead.ai/api/v1/campaigns/12345/statistics?api_key=YOUR_API_KEY&limit=100&offset=0"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"
  CAMPAIGN_ID = 12345

  response = requests.get(
      f"https://server.smartlead.ai/api/v1/campaigns/{CAMPAIGN_ID}/statistics",
      params={
          "api_key": API_KEY,
          "limit": 100,
          "offset": 0
      }
  )

  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';
  const CAMPAIGN_ID = 12345;

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/campaigns/${CAMPAIGN_ID}/statistics?api_key=${API_KEY}&limit=100&offset=0`
  );

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key. Check your authentication.
</ResponseField>

<ResponseField name="404" type="Not Found">
  The requested resource does not exist or you don't have access to it
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": [
      {
        "campaign_id": 123,
        "sequence_number": 1,
        "sent": 1240,
        "opened": 372,
        "clicked": 89,
        "replied": 23,
        "unsubscribed": 4,
        "bounced": 18
      },
      {
        "campaign_id": 123,
        "sequence_number": 2,
        "sent": 892,
        "opened": 267,
        "clicked": 54,
        "replied": 12,
        "unsubscribed": 2,
        "bounced": 9
      }
    ],
    "offset": 0,
    "limit": 100
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```
</ResponseExample>
