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

# 歷史記錄

> 取得 Ayrshare 為您推廣的 Reddit 廣告記錄的每日花費和成效，以及總計。

取得 Ayrshare 為您透過[推廣貼文](https://www.ayrshare.com/docs/apis/ads/reddit/boost-post.md)建立的 Reddit 廣告記錄的每日花費和成效。如需即時數據，請使用[洞察](https://www.ayrshare.com/docs/apis/ads/reddit/get-ad-insights.md)。

<ul>
  <li>`history` 中的每個項目代表一則廣告在某一天的資料，最新的排在最前面。</li>
  <li>找不到任何資料時，結果仍為成功：`history` 為空，且 `warnings` 中包含一個 `code: 401` 的項目。</li>
  <li>`spend` 使用廣告帳戶的幣別，顯示在 `currency` 中。僅當該幣別為 USD 時才會設定 `spendUsd`，否則為 `null`。`totalSpend` 一律為 `null`：請使用 `totalSpendByCurrency`。</li>
  <li>Reddit 不會回報這些天的觸及人數，因此 `reach`、`frequency` 和 `cpp` 為 `0`。</li>
  <li>篩選條件依以下順序套用，且只會使用第一個傳送的條件：`adId`、`postId`、`accountId`、`socialPostId`。</li>
</ul>

## 請求頭參數

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## 查詢參數

**adId** `string`

只返回此 Reddit 廣告的每日資料。

**postId** `string`

只返回從此 Ayrshare [貼文 ID](https://www.ayrshare.com/docs/apis/overview.md#ayrshare-post-id) 推廣的廣告的每日資料。

**accountId** `string`

只返回此 Reddit 廣告帳戶中廣告的每日資料，例如 `a2_abc123`。

**socialPostId** `string`

只返回推廣此 Reddit 貼文的廣告的每日資料。請傳送不含 `t3_` 的小寫 ID，例如 `1abc27`。`redditPostId` 也會被視為同一個欄位。

**startDate** `string` (default: endDate 前 30 天)

要包含的第一天，格式為 ISO 8601 日期，例如 `2026-11-01`。

**endDate** `string` (default: 現在)

要包含的最後一天，格式為 ISO 8601 日期。不得早於 `startDate`。

**limit** `number` (default: 25)

要返回的最多列數，最新的排在最前面。每一列代表一則廣告在某一天的資料，因此有多則廣告時，涵蓋的天數會少於 `limit`。超過 300 的值會被限制為 300。總計只會加總返回的列：若要取得整個日期範圍的資料，請縮小日期範圍或提高 `limit`。

```bash cURL theme={"system"}
curl \
  -H "Authorization: Bearer API_KEY" \
  -X GET "https://api.ayrshare.com/api/ads/reddit/history?adId=2707300000000000001&startDate=2026-11-20"
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "history": [
    {
      "accountId": "a2_abc123",
      "adId": "2707300000000000001",
      "adName": "Spring sale",
      "budgetDaily": 50,
      "budgetType": "",
      "currency": "USD",
      "deliveryStatus": null,
      "goal": { "type": "website_visits" },
      "isActive": true,
      "isComplete": false,
      "metrics": {
        "clicks": 42,
        "cpc": 0.2,
        "cpp": 0,
        "cpm": 3.5,
        "ctr": 1.75,
        "frequency": 0,
        "impressions": 2400,
        "reach": 0
      },
      "network": "reddit",
      "postId": "DE6gpw8kxlonHy6eb721",
      "redditPostId": "1abc27",
      "socialPostId": "1abc27",
      "spend": 8.4,
      "spendDate": "2026-11-21T00:00:00.000Z",
      "spendUsd": 8.4,
      "status": "ACTIVE"
    }
  ],
  "dateRange": {
    "start": "2026-11-20T00:00:00.000Z",
    "end": "2026-12-02T10:15:00.000Z",
    "adId": "2707300000000000001"
  },
  "metrics": {
    "totalSpend": null,
    "totalSpendByCurrency": { "USD": 8.4 },
    "totalClicks": 42,
    "totalImpressions": 2400,
    "totalReach": 0,
    "averageCTR": 1.75,
    "averageFrequency": 0,
    "cpm": 3.5,
    "cpp": 0,
    "cpc": 0.2,
    "costPerResult": 0.2,
    "byGoalType": {
      "website_visits": {
        "spend": 8.4,
        "impressions": 2400,
        "clicks": 42,
        "reach": 0,
        "count": 1,
        "ctr": 1.75,
        "cpm": 3.5,
        "cpp": 0,
        "cpc": 0.2
      }
    },
    "byGoalTitle": {},
    "goalPerformance": {
      "bestPerformingGoalType": { "type": "website_visits", "clicks": 42, "spend": 8.4, "ctr": 1.75 },
      "mostEfficientGoalType": { "type": "website_visits", "cpc": 0.2, "spend": 8.4 }
    },
    "count": 1,
    "firstDay": "2026-11-21T00:00:00.000Z",
    "lastDay": "2026-11-21T00:00:00.000Z"
  }
}
```

```json 400: Bad dates theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "Start date must be before end date."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.