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

# コンテンツ配信レポート収集

> 各プラットフォームから再生数・ロイヤリティを自動収集し、一括エクスポート。

## 概要

コンテンツクリエイターや音楽レーベルは、Spotify・YouTube・Apple Music など複数のプラットフォームからアナリティクスを集約する必要があります。各プラットフォームのダッシュボードはレイアウトもエクスポート形式も異なり、手動でのログイン・ダウンロードは手間がかかりミスも発生します。

Refrain はこのフロー全体を自動化します。ログインしてアナリティクスページに移動し、日付フィルタを適用してデータをエクスポートします。

## 手順書の例

```yaml theme={null}
name: streaming-analytics-export
url: https://analytics.example-music.com/login
variables:
  - name: username
    source: secrets
  - name: password
    source: secrets
  - name: date_range
    source: fixed
    value: "last-30-days"
steps:
  - action: input
    selector: "#email"
    value: "{{ username }}"
  - action: input
    selector: "#password"
    value: "{{ password }}"
  - action: click
    selector: "#signIn"
  - action: wait
    selector: ".dashboard"
  - action: click
    selector: "[data-range='{{ date_range }}']"
  - action: wait
    timeout: 2000
  - action: download
    selector: ".export-csv-button"
```

## 生成と実行

<Steps>
  <Step title="手順書を生成する">
    ```bash theme={null}
    npx @refrainai/cli generate -- \
      --url https://analytics.example-music.com/login \
      --goal "ログインして過去 30 日間を選択し、アナリティクス CSV をダウンロードする" \
      --context ./context.md \
      --output ./streaming-report.yaml
    ```
  </Step>

  <Step title="実行してダウンロードする">
    ```bash theme={null}
    npx @refrainai/cli execute -- \
      --runbook ./streaming-report.yaml \
      --secrets ./secrets.json \
      --output-dir ./reports
    ```
  </Step>

  <Step title="複数プラットフォームを統合する">
    各プラットフォームの手順書を個別に実行し、`--merge-downloads` で CSV を統合します：

    ```bash theme={null}
    npx @refrainai/cli execute -- \
      --runbook ./youtube-report.yaml \
      --output-dir ./reports \
      --merge-downloads
    ```
  </Step>
</Steps>

## Refrain が向いている理由

* **マルチプラットフォーム** — プラットフォームごとに手順書を作成し、スケジュール実行。
* **ダウンロード管理** — エクスポートファイルを自動でダウンロード・整理。
* **再実行コストゼロ** — 月次レポート収集も AI トークン不要。
* **自己修復** — ダッシュボードのリニューアルにも自動対応。

## 次のステップ

<CardGroup cols={2}>
  <Card title="手順書を実行する" icon="play" href="/ja/guides/execute-runbook">
    ダウンロードとファイルエクスポートのオプションを学ぶ。
  </Card>

  <Card title="変数とシークレット" icon="key" href="/ja/guides/variables-and-secrets">
    複数プラットフォームの認証情報を管理する。
  </Card>
</CardGroup>
