# 计算 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 + 3 × 1 credit Index = 6 credits。
- kpi_tier 为 pro 时只返回核心 KPI；scale 时返回全部 KPI。
- 单次请求的样本量小，KPI 仅供参考；趋势和对比请用 /v1/geo/index/summary。
