> ## 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 でブーストした Snapchat 広告の日別リアルタイム指標 (費用、インプレッション、スワイプアップ、CPM、CPC、CTR) を取得。

[投稿をブースト](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md)で作成した広告について、Snapchat 広告のリアルタイムの成果を広告ごと・日ごとに 1 行で取得します。

<ul>
  <li>数値は呼び出し時に Snapchat から読み取られます。日別の費用記録には [履歴](https://www.ayrshare.com/docs/apis/ads/snapchat/get-ad-history.md)を使用してください。</li>
  <li>Snapchat は広告単位でレポートするため、`level=ad` を送ってください。その他のレベルは `code: 101` を返します。</li>
  <li>日は広告アカウントのタイムゾーンでの日です。金額は広告アカウントの通貨で、各行の `currency` に返されます。</li>
  <li>1 つのリクエストは 1 つの広告アカウントを対象とします。複数の広告アカウントの広告は `code: 101` を返します。</li>
  <li>別のプロフィール用に Ayrshare で作成した広告は `code: 400` を返します。</li>
  <li>各広告は範囲内の 31 日ごとに 1 回 Snapchat から読み取られ、1 つのリクエストで行える読み取りは最大 100 回です。たとえば 62 日間の 50 広告は 100 回の読み取りです。それより大きいリクエストは `code: 101` を返します: 広告を減らすか、範囲を短くしてください。</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`

## クエリパラメータ

**level** `string` *required*

`ad` である必要があります。

**ids** `string`

カンマ区切りの Snapchat 広告 ID。最大 50 件。

`ids` を省略して代わりに `accountId` を送ることもできます。その場合、その広告アカウントでこのプロフィールのために Ayrshare でブーストした広告がレポート対象になります。アカウントにあなたの広告が 50 件を超えてある場合、リクエストは `code: 101` を返します: 代わりにそれらの ID を送ってください。見つからない場合、レポートは空になります。

**accountId** `string`

Snapchat 広告アカウントの ID。`ids` を省略する場合は必須です。`ids` を送る場合、Ayrshare に記録のあるすべての広告がこのアカウントに含まれている必要があります。Ayrshare に記録のない ID は、それを含むあなたの広告アカウントから読み取られるため、`accountId` による制限は受けません。

**metrics** `string`

返す指標のカンマ区切りリスト。すべて取得するには省略します。[指標](#metrics)を参照してください。

**startDate** `string` (default: 30 days ago)

最初の日。`YYYY-MM-DD` 形式。最大 37 か月前まで指定できます。

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

最後の日。`YYYY-MM-DD` 形式。

## 指標

| 指標 | 型 | 意味 |
| - | - | - |
| `spend` | number | 費用 |
| `impressions` | number | 広告が表示された回数 |
| `clicks` | number | 広告のスワイプアップ数 |
| `cpm` | number または `null` | 1,000 インプレッションあたりの費用。インプレッションのない日は `null` |
| `cpc` | number または `null` | スワイプアップ 1 回あたりの費用。スワイプアップのない日は `null` |
| `ctr` | number または `null` | インプレッションあたりのスワイプアップ率 (パーセント)。インプレッションのない日は `null` |

各行には、`clicks` と同じ数の `swipes` と、通貨が USD の場合は `spend`、それ以外は `null` となる `spendUsd` も含まれます。

Snapchat は `reach`、`actions`、`conversionValue` を日別に報告しません。これらを要求すると `code: 101` が返されます。Snapchat には内訳もないため、`breakdowns` を送ると `code: 101` が返されます。

## ページング

すべての行が 1 つのレスポンスで返されるため、`meta.pagination.hasMore` は常に `false` です。

## エラー

| Code | 発生条件 |
| - | - |
| `101` | パラメータが不足しているか誤っている、`level` が `ad` ではない、指標または内訳がサポートされていない、`startDate` が 37 か月より前、ID が 50 件を超えて送られた、`accountId` だけで 50 件を超える広告が対象になる、広告が複数の広告アカウントにまたがる、広告が `accountId` に含まれていない、またはリクエストに 100 回を超える読み取りが必要 |
| `400` | 広告があなたのものではない、または `accountId` が Ayrshare に記録されている広告の広告アカウントではない |
| `364` | Snapchat のレート制限に達しました。1 分待ってから再試行してください |
| `370` | Snapchat がインサイトを返せませんでした。再試行してください |

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/insights?level=ad&ids=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-21"
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "platform": "snapchat",
  "level": "ad",
  "startDate": "2026-11-20",
  "endDate": "2026-11-21",
  "insights": [
    {
      "date": "2026-11-20",
      "level": "ad",
      "id": "c3a1e2d4-0000-4000-8000-0000000000ad",
      "currency": "USD",
      "spend": 12.5,
      "impressions": 3000,
      "clicks": 30,
      "cpm": 4.17,
      "cpc": 0.42,
      "ctr": 1,
      "swipes": 30,
      "spendUsd": 12.5
    },
    {
      "date": "2026-11-21",
      "level": "ad",
      "id": "c3a1e2d4-0000-4000-8000-0000000000ad",
      "currency": "USD",
      "spend": 18,
      "impressions": 4000,
      "clicks": 42,
      "cpm": 4.5,
      "cpc": 0.43,
      "ctr": 1.05,
      "swipes": 42,
      "spendUsd": 18
    }
  ],
  "count": 2,
  "meta": { "pagination": { "hasMore": false } }
}
```

```json 400: Wrong level 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": "Insights on snapchat report by ad: use level \"ad\" with the ad ids."
}
```


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