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

# Perplexity API: 回答、引用、検索クエリ

> Perplexityに質問し、回答、引用した出典、関連する質問、検索クエリ、メディアを受け取ります。

`PERPLEXITY` は Perplexity に質問し、回答と引用した出典、モデルが実行した検索を返します。

| | |
| - | - |
| taskType | `PERPLEXITY` |
| 読むフィールド | `prompt`(なければ `query`) |
| クレジット | 1 |
| 国 | 任意、既定は `US`。`CN` は `422 REGION_UNSUPPORTED` で拒否されます。 |

## リクエスト

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "PERPLEXITY", "payload": { "prompt": "best CRM for a small team", "country": "US", "include": { "searchQueries": true } } }'
```

## レスポンス

| フィールド | 型 | 説明 |
| - | - | - |
| `text` | string | 回答。常に存在します。 |
| `sources` | array | 引用した出典: `position`、`url`、`label`、`description`。常に存在します。 |
| `related_queries` | string\[] | Perplexityが提案する次の質問。 |
| `search_model_queries` | array | Perplexityのモデルが実行した検索。各項目は `{ query, engine, limit }`。 |
| `searchQueries` | string\[] | 同じ検索をプレーンな文字列で。`include.searchQueries` のときのみ。 |
| `images`、`videos` | array | 回答とともに表示されたメディア: `title`、`url`、`medium`、`image`、`thumbnail`、`source`、`image_width`、`image_height`、動画には `duration`。 |
| `markdown` | string | Markdownの回答。画像は表示位置に置かれます。`include.markdown` のときのみ。 |
| `rawResponse` | array | 解析済みのストリームイベント。`include.rawResponse` のときのみ。 |

`images` と `videos` では、`url` は項目の掲載ページ、`image` は画像そのものです。

例:

```json theme={"theme":"css-variables"}
{
  "text": "HubSpot CRM and Pipedrive are the most common choices for small teams ...",
  "sources": [
    { "position": 1, "url": "https://www.example.com/crm-review", "label": "Best CRM for small teams", "description": "..." }
  ],
  "related_queries": ["Is HubSpot CRM free?"],
  "search_model_queries": [{ "query": "best CRM small team", "engine": "web", "limit": 8 }],
  "searchQueries": ["best CRM small team"]
}
```

`related_queries` はユーザー向けの提案です。`search_model_queries` と `searchQueries` は Perplexity が実際に検索した内容です。

## includeフラグ

| フラグ | 効果 |
| - | - |
| `markdown` | `markdown` を追加します。 |
| `searchQueries` | `searchQueries` を追加します。 |
| `rawResponse` | `rawResponse` を追加します。 |
| `html` | Perplexity が表示した画面である `html` を追加します。ページが保存された場合は0.25クレジット。[HTMLページ](/ja/engines/html-pages.md)を参照してください。 |
| `analysis` | `analysis` を追加します。1クレジット。[回答の分析](/ja/engines/answer-analysis.md)を参照してください。 |
| `citationAnalysis` | 回答に対して[Citation Analysis](/ja/research/citation-analysis.md)を実行します。 |

`ads` と `shopping` は効果がありません。[Markdownと生のレスポンス](/ja/engines/response-options.md)を参照してください。

## 関連ページ

* [Perplexity製品ページ](https://querying.ai/ja/engines/perplexity)
* [エンジンの概要](/ja/engines/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.