# SERP API AI サマリー

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/serp/ai_summary`

**Tags:** DataForSEO

Google がクエリの検索結果の上部に表示する AI による概要を返します。`keyword`、`type`、`se_domain`、`location_code`、`language_code`、`check_url`、`datetime`、`spell`、`refinement_chips`、`item_types`、`items_count`、`items` を返します。DataForSEO のエンベロープに包まれます。データは `tasks[0].result`、結果は `tasks[0].status_code` に格納され、拒否されたリクエストでも HTTP 200 が返ります。

### 料金の参考情報

- 計測方法：報告されたレスポンスコスト。
- 参考リクエスト見積もり：0.02 USD。
- 参照用の顧客乗数：1.0。確定済みの顧客金額に再適用しないでください。

参照用のメタデータのみであり、アカウントへの見積もり、保証された価格、支出上限ではありません。リソースクレジットは Felo クレジットではありません。最終的な請求は Felo の請求記録に従います。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "description": "<em>タスク識別子</em><br><strong>必須フィールド</strong><br>関連するタスクの一意の識別子（<a href=\"https://en.wikipedia.org/wiki/Universally_unique_identifier\">UUID</a> 形式）<br><strong>30 日</strong>以内であれば、いつでもこの識別子を使ってタスクの結果をリクエストできます"
          },
          "prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>AI プロンプト</em><br>任意フィールド<br>AI 要約機能への追加タスク。<br>AI にどのような応答を求めているかを伝える、任意の形式のテキスト、質問、情報。<br>指定できる記号または文字の最大数：<code>2000</code><br><strong>注意：</strong>プロンプトは、SERP API への POST リクエストで指定したキーワードに関連している必要があります"
          },
          "support_extra": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>追加の SERP 機能をサポート</em><br>任意フィールド<br><code>true</code> に設定すると、AI モデルは <code>organic</code> 結果に加えて、次の追加の SERP 機能を考慮します：<code>answer_box</code>、<code>knowledge_graph</code>、<code>featured_snippet</code><br>デフォルト値：<code>true</code>"
          },
          "fetch_content": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>SERP 内のページからコンテンツを取得</em><br>任意フィールド<br><code>true</code> に設定すると、API は SERP 結果に表示されたページからコンテンツを取得し、AI モデルは結果の要約を生成する際にこのコンテンツを考慮します。<br>デフォルト値：<code>false</code>"
          },
          "include_links": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>要約にソースリンクを含める</em><br>任意フィールド<br><code>true</code> に設定すると、API レスポンスの <code>summary</code> フィールドに、生成された要約のソースへのリンクが含まれます。<br>デフォルト値：<code>false</code>"
          }
        },
        "example": [
          {
            "task_id": "07031739-1535-0139-0000-9d1e639a5b7d",
            "prompt": "explain what DataForSEO is",
            "include_links": true,
            "fetch_content": true
          }
        ]
      }
    ]
  },
  "example": [
    {
      "task_id": "07031739-1535-0139-0000-9d1e639a5b7d",
      "prompt": "explain what DataForSEO is",
      "include_links": true,
      "fetch_content": true
    }
  ]
}
```

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — Felo サポートに問い合わせる際に伝えるリクエスト識別子。

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_SerpAiSummaryResponseInfo"
    }
  ]
}
```

### 400 — リクエストを処理できませんでした。リクエストパラメータを確認してください。

### 401 — 有効な Felo API キーが必要です。

### 402 — 請求要件が満たされていないため、リクエストを続行できません。

### 403 — このアカウントにはこの操作を行う権限がありません。

### 429 — リクエストまたは支出の上限に達しました。

### 502 — サービスがリクエストを完了できませんでした。

### 503 — API または請求サービスが一時的に利用できません。

### 504 — リクエストの処理中にサービスがタイムアウトしました。

### default — エラーレスポンス。上流のパススルーレスポンスはプロバイダーの形式を使用する場合があります

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API の現在のバージョン"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "一般的なステータスコード\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "一般的な情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "合計実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 配列内のタスク数",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エラーで返された tasks 配列内のタスク数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスク識別子\n当社システム内で UUID 形式の一意のタスク識別子"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "タスクのステータスコード\nDataForSEO によって生成され、次の範囲の値になります: 10000-60000\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスクの情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 配列内の要素数",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL パス"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "POST リクエストで指定したものと同じパラメーターを含みます"
    }
  }
}
```

### Response36Afe1097B20_SerpAiSummaryItem

`#/components/schemas/Response36Afe1097B20_SerpAiSummaryItem`

```json
{
  "type": "object",
  "properties": {
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>生成された要約</em><br>リクエストで指定したパラメータに従って AI モデルが生成した要約"
    }
  }
}
```

### Response36Afe1097B20_SerpAiSummaryResponseInfo

`#/components/schemas/Response36Afe1097B20_SerpAiSummaryResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_SerpAiSummaryTaskInfo"
              }
            ]
          },
          "description": "<em>タスクの配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_SerpAiSummaryResultInfo

`#/components/schemas/Response36Afe1097B20_SerpAiSummaryResultInfo`

```json
{
  "type": "object",
  "properties": {
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>結果配列内の項目数</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_SerpAiSummaryItem"
          }
        ]
      },
      "description": "<em>項目の配列</em>"
    }
  }
}
```

### Response36Afe1097B20_SerpAiSummaryTaskInfo

`#/components/schemas/Response36Afe1097B20_SerpAiSummaryTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_SerpAiSummaryResultInfo"
              }
            ]
          },
          "description": "<em>結果の配列</em>"
        }
      }
    }
  ]
}
```
