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

# 受众

> 列出 Reddit 广告账户上的自定义受众，包括每个受众的类型、规模以及推广是否已可定位它。

列出 Reddit 广告账户上的自定义受众：您的客户名单、网站访客，以及该账户上的任何其他受众。在[推广帖子](https://www.ayrshare.com/docs/apis/ads/reddit/boost-post.md#audiences)时，将这些 ID 用于 `targeting.audiences` 或 `targeting.excludedAudiences`。

<ul>
  <li>在 Reddit Ads Manager 中创建的受众也会列出，而不仅仅是通过 Ayrshare 创建的受众。</li>
  <li>当 Reddit 匹配到至少 1,000 人且推广可以定位该受众时，`status.ready` 为 `true`。</li>
  <li>`size` 是 Reddit 自己的估算值，以下限和上限表示。在 Reddit 没有估算值时为 `null`。</li>
  <li>结果不会缓存：受众在填充过程中，其规模和就绪状态会变化。</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`

## 查询参数

**accountId** `string` *required*

您的 Reddit 广告账户 ID，例如 `a2_abc123`。

**limit** `number`

每页返回的最大受众数，1 到 2000。更大的数字返回 2000。

**next** `string`

当响应包含 `meta.pagination.hasMore: true` 时，将其 `meta.pagination.next` 值发送到这里以获取下一页。其他参数保持不变：来自其他请求的 `next` 值会返回 `code: 101`。

## 响应

每个受众包含：

<ul>
  <li>`id`：推广、添加人员或删除时使用的受众 ID。</li>
  <li>`name`：在 Reddit Ads Manager 中显示的名称。</li>
  <li>`type`：`customerList`、`website`、`engagement`，或者 Ayrshare 不创建的受众类型（例如类似受众）为 `other`。</li>
  <li>`size`：`{ lower, upper }`，Reddit 的估算值，或 `null`。</li>
  <li>`status`：`{ ready, code, description }`。当推广现在可以定位该受众时，`ready` 为 `true`。`description` 是 Reddit 的状态，例如 `PENDING`、`VALID` 或 `NOT_ENOUGH_MATCHES_ERROR`。在 Reddit 上 `code` 始终为 `null`。</li>
  <li>`created`：受众的创建时间，ISO 8601 格式，或 `null`。</li>
</ul>

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/reddit/audiences?accountId=a2_abcdefg"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/reddit/audiences?accountId=a2_abcdefg", {
      method: "GET",
      headers: {
        "Authorization": `Bearer ${API_KEY}`
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY'}

r = requests.get('https://api.ayrshare.com/api/ads/reddit/audiences?accountId=a2_abcdefg', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "audiences": [
    {
      "id": "ca.129482487242828",
      "name": "Buyers",
      "type": "customerList",
      "size": { "lower": 140000, "upper": 160000 },
      "status": { "ready": true, "code": null, "description": "VALID" },
      "created": "2026-11-20T09:12:00.000Z"
    },
    {
      "id": "ca.129482487242999",
      "name": "Site visitors 30d",
      "type": "website",
      "size": null,
      "status": { "ready": false, "code": null, "description": "PENDING" },
      "created": "2026-12-01T16:40:00.000Z"
    }
  ],
  "meta": { "pagination": { "hasMore": false } }
}
```

```json 400: Missing account 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": "accountId is required."
}
```

```json 400: Reddit failed the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 370,
  "message": "Error getting audiences. Please try again.",
  "details": "Reddit's reason"
}
```


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