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

# オーディエンス

> Snapchat 広告アカウントのオーディエンスセグメントを、種類、規模、ブーストでターゲットにできるかとともに一覧表示します。

Snapchat 広告アカウントのオーディエンスセグメントを一覧表示します: 顧客リスト、Snap Pixel が検出したウェブサイト訪問者、および類似オーディエンス (lookalike) です。[Snap をブースト](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md#audiences)するときに、ID を `targeting.audiences` または `targeting.excludedAudiences` で使用します。

<ul>
  <li>Ayrshare で作成したものだけでなく、Snapchat Ads Manager で作成したセグメントも一覧に含まれます。</li>
  <li>Snapchat がブーストでセグメントをターゲットにできると示すと、`status.ready` が `true` になります。照合済みの人が少なすぎるセグメントは準備ができていません (`TOO_FEW_USERS`)。</li>
  <li>`size` は Snapchat 独自の照合済み人数で、`lower` と `upper` の両方として送られます。</li>
  <li>結果はキャッシュされません: セグメントの規模と準備状況は、蓄積中に変化します。</li>
  <li>Snapchat が独自のページサイズを設定するため、ここでは `limit` は効果がありません。</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*

セグメントを一覧表示する Snapchat 広告アカウントの ID。例: `5a0d0000-0000-4000-8000-000000000003`。

**next** `string`

レスポンスに `meta.pagination.hasMore: true` がある場合、その `meta.pagination.next` の値をここに送ると次のページを取得できます。その他のパラメータは変更せずに送ってください: 別のリクエストの `next` 値は `code: 101` を返します。

## レスポンス

各オーディエンスには以下が含まれます:

<ul>
  <li>`id`: ブースト、人の追加、削除のときに使うセグメント ID。</li>
  <li>`name`: Ads Manager に表示される名前。</li>
  <li>`type`: `customerList`、`website`、`lookalike`、または Ayrshare が作成しない種類のセグメントの場合は `other`。</li>
  <li>`size`: `{ lower, upper }` (どちらも Snapchat の人数)、または Snapchat が人数を報告しない場合は `null`。</li>
  <li>`status`: `{ ready, code, description }`。`ready` は、ブーストで今すぐセグメントをターゲットにできる場合に `true` です。`code` は常に `null` です。`description` は Snapchat のステータスで、`READY`、`NOT_READY`、`TOO_FEW_USERS` のいずれかです。</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/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003"
```

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

fetch("https://api.ayrshare.com/api/ads/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003", {
      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/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "audiences": [
    {
      "id": "8c1e2f3a-0000-4000-8000-000000000101",
      "name": "Newsletter subscribers",
      "type": "customerList",
      "size": { "lower": 12000, "upper": 12000 },
      "status": { "ready": true, "code": null, "description": "READY" },
      "created": "2026-11-20T09:12:00.000Z"
    },
    {
      "id": "8c1e2f3a-0000-4000-8000-000000000102",
      "name": "Like my subscribers",
      "type": "lookalike",
      "size": { "lower": 0, "upper": 0 },
      "status": { "ready": false, "code": null, "description": "NOT_READY" },
      "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: Snapchat refused the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 370,
  "message": "Error getting audiences. Please try again.",
  "details": "Snapchat's reason"
}
```


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