> ## 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: 30 days before endDate)

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

**endDate** `string` (default: now)

要包含的最后一天，使用 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.