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

# モデル、地域、ペルソナ別に Visibility をセグメント化する

> 1 つのアセットの Visibility Score を、回答を生成した AI モデル、地域、ペルソナ別に分解します

Profound アプリの **Platforms** タブ("Visibility Score by Platform")では、
同じメトリクスを回答した AI サーフェス別に分けて表示します。同じパターンは地域と
ペルソナにも使えます。セグメント化するフィールドを `dimensions` に追加します(または
`filter` として使い、1 つの値に絞り込みます)。

## この例の仕組み

1. **セグメント化するフィールドを `asset_name` とともに `dimensions` に追加します。**
   (セグメント、アセット)ごとに 1 行が返されます。
2. **自社アセットでフィルタリングして**、レスポンスをセグメントごとに 1 行にします。
3. **スコアで並べ替えて**、セグメントをランク付けします。

<RequestExample>
  ```python Python theme={null}
  import os
  from profound import Profound

  client = Profound(api_key=os.environ["PROFOUND_API_KEY"])

  # What to fetch — replace with your own values.
  CATEGORY_NAME = "<your-category-name>"
  ASSET_NAME    = "<your-asset-name>"
  START_DATE    = "2026-05-05"
  END_DATE      = "2026-05-12"
  SEGMENT       = "model"   # or "region", "persona"


  def get_visibility_by_segment(category_id, asset_name, segment, start_date, end_date):
      """Visibility Score for one asset, broken down by `segment` (model/region/persona)."""
      res = client.reports.visibility(
          category_id=category_id,
          start_date=start_date,
          end_date=end_date,
          metrics=["visibility_score"],
          dimensions=[segment],
          filters=[{"field": "asset_name", "operator": "is", "value": asset_name}],
      )
      m_order = res.info.query["metrics"]
      d_order = res.info.query["dimensions"]
      i_score   = m_order.index("visibility_score")
      i_segment = d_order.index(segment)
      return sorted(
          [(row.dimensions[i_segment], row.metrics[i_score]) for row in res.data],
          key=lambda x: x[1],
          reverse=True,
      )


  # Helpers — translate human-readable names into the IDs the report API needs.

  def find_category_id(name):
      """Return the UUID of the category whose name matches (case-insensitive)."""
      for c in client.organizations.categories.list():
          if c.name.lower() == name.lower():
              return c.id
      raise ValueError(f"No category named {name!r}")


  def find_asset_name(category_id, name):
      """Return the canonical asset name (case-insensitive) inside the category."""
      for a in client.organizations.categories.assets(category_id):
          if a.name.lower() == name.lower():
              return a.name
      raise ValueError(f"No asset named {name!r} in this category")


  # Resolve names → IDs, then run.
  category_id = find_category_id(CATEGORY_NAME)
  asset_name  = find_asset_name(category_id, ASSET_NAME)

  rows = get_visibility_by_segment(category_id, asset_name, SEGMENT, START_DATE, END_DATE)
  print(f"{asset_name} Visibility Score by {SEGMENT}:")
  for segment, score in rows:
      print(f"  {segment:<24} {score:.1%}")
  ```

  ```bash curl theme={null}
  export PROFOUND_API_KEY=your_api_key_here

  curl -X POST "https://api.tryprofound.com/v1/reports/visibility" \
    -H "X-API-Key: $PROFOUND_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "category_id": "your-category-uuid",
      "start_date": "2026-05-05",
      "end_date": "2026-05-12",
      "metrics": ["visibility_score"],
      "dimensions": ["model"],
      "filters": [{"field": "asset_name", "operator": "is", "value": "<your-asset-name>"}]
    }'
  ```
</RequestExample>

## 代わりに単一のセグメントに絞り込む

1 つのモデルのスコアだけが必要な場合(たとえば「ChatGPT 上で自社はどの位置にいるか?」)は、
`dimensions` から `model` を外し、代わりに `model_id` でフィルタリングします。
値は `GET /v1/org/models` から取得したモデルの UUID です。

```python theme={null}
filters=[
    {"field": "asset_name", "operator": "is", "value": "<your-asset-name>"},
    {"field": "model_id",   "operator": "is", "value": "<model-uuid>"},
]
```

これでレスポンスは 1 行になります。[ヘッドライン
レシピ](/ja-jp/cookbook/visibility/asset-visibility-score)と同じ形式で、ChatGPT にスコープされます。
