Perplexity スクレイパー
scraper.perplexity actor は、Perplexity の回答に関連質問、引用、メディア情報を付与して返します。これにより各国での応答内容を比較できます。
リクエスト例
curl '{api_host}/api/v2/scraper/request' \
--header 'Content-Type: application/json' \
--header 'x-api-token: {you_api_key}' \
--data '{
"actor": "scraper.perplexity",
"input": {
"prompt": "Recommended attractions in New York",
"country": "US",
"web_search": true
},
"webhook": {
"url": "http://www.youwebhook.com"
}
}'Body パラメーター
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
prompt | string | はい | Perplexity へ送信する prompt。 |
country | string | はい | 国・地域コード。 |
web_search | boolean | いいえ | Web 検索の有無。 |
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|---|---|
prompt | string | 元の prompt。 |
result_text | string | Perplexity の Markdown 回答。 |
related_prompt | array | 関連質問の配列。 |
web_results | array | 参照された Web 検索データ。 |
web_results.name | string | ソースタイトル。 |
web_results.url | string | ソース URL。 |
web_results.snippet | string | 簡易説明。 |
media_items | array | メディア項目。 |
media_items.medium | string | メディアタイプ(map、video など)。 |
media_items.url | string | リソース URL。 |
media_items.image | string | プレビュー画像。 |
media_items.source | string | 取得元(web、youtube)。 |
media_items.thumbnail | string | サムネイル。 |
media_items.locations | array | map メディアの位置情報。 |
media_items.locations.lat | float | 緯度。 |
media_items.locations.lng | float | 経度。 |
media_items.locations.name | string | 地名。 |
media_items.locations.description | string | 説明。 |
media_items.locations.image_url | string | 画像リンク。 |
media_items.locations.num_reviews | int | レビュー数。 |
media_items.locations.url | string | リンク。 |
media_items.locations.categories | array | カテゴリ。 |
media_items.locations.address | array | 住所。 |