# GEO Index を計算

`POST https://api.dataforgeo.dev/v1/geo/index` · Pro / Scale / Enterprise

/v1/geo/answer の結果から GEO Index の KPI を計算します。Pro・Scale・Enterprise で利用可能。Starter は 403 plan_not_allowed。

### パラメータ

/v1/geo/answer と同じパラメータで brand が必須。追加パラメータ：

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `brand` | string | はい | KPI を計算するブランド |
| `tag` | string | いいえ | 任意のグループタグ（例：osaka-family-q4）。/summary はこれで集計 |
| `intent` | string | いいえ | prompt の意図：compare、cost、discover、evaluate、howto、recommend |
| `persona` | string | いいえ | 質問者像（自由記述）。例：子連れの家族 |

### リクエスト例

```bash
curl https://api.dataforgeo.dev/v1/geo/index \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "prompt": "大阪带孩子住哪里方便？",
    "engines": [
      "chatgpt",
      "perplexity",
      "grok"
    ],
    "brand": "晓宅",
    "tag": "osaka-family-q4",
    "intent": "recommend",
    "persona": "带孩子的家庭",
    "location": "JP",
    "language": "zh-CN"
  }'
```

### レスポンス例

```json
{
  "request_id": "req_91d0b3",
  "brand": "晓宅",
  "tag": "osaka-family-q4",
  "credits_used": 6,
  "answers": [
    "…与 /v1/geo/answer 相同…"
  ],
  "kpis": {
    "visibility": {
      "value": 0.667,
      "numerator": 2,
      "denominator": 3,
      "samples": 3
    },
    "share_of_voice": {
      "value": 0.25,
      "numerator": 2,
      "denominator": 8,
      "samples": 3
    },
    "top_rate": {
      "value": 0,
      "numerator": 0,
      "denominator": 3,
      "samples": 3
    },
    "competitor_gap": {
      "value": -1.33,
      "samples": 3
    },
    "positive_ratio": {
      "value": 1,
      "numerator": 2,
      "denominator": 2,
      "samples": 3
    }
  },
  "kpi_tier": "pro"
}
```

- 上の例は標準エンジン 3 つ × 回答 1 件：3 × 1 credit + Index 3 × 1 credit = 6 credits。
- kpi_tier が pro ならコア KPI のみ、scale なら全 KPI を返します。
- 単発リクエストはサンプルが少なく KPI は参考値です。トレンドや比較には /v1/geo/index/summary を使ってください。
