实时网络搜索,按域,语言,日期等进行过滤. 返回搜索结果,而不是 LLM 回复; 没有文件上传 。
也称为 Perplexity-Search
perplexity-search/v1/search来自 EmpirioLabs 目录的实时按量计费价格。只为实际用量付费,没有月度最低消费。
Perplexity Search 通过 POST /v1/search 回答实时查询。连同模型 ID perplexity-search 发送搜索词,并从响应中读取结构化结果。 在EmpirioLabs 控制台获取 API 密钥。
curl https://api.empiriolabs.ai/v1/search \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "perplexity-search",
"query": "latest developments in solid-state batteries"
}'import requests
response = requests.post(
"https://api.empiriolabs.ai/v1/search",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
json={
"model": "perplexity-search",
"query": "latest developments in solid-state batteries",
},
)
print(response.json())EmpirioLabs 上 Perplexity Search API 支持的请求参数。省略字段时使用默认值。
| 参数 | 类型 | 默认值 | 范围 / 值 | 描述 |
|---|---|---|---|---|
| query | string | - | - | 自然语言搜索查询。 |
| max_results | number | 10 | 1 到 20 | 返回的最高结果数。 |
| max_tokens | number | 1000000 | 1 到 1000000 | 所有结果中提取的最大代币。 |
| max_tokens_per_page | number | 4096 | 1 到 16384 | 每个结果页提取的最大代币数。 |
| multi_query_mode | boolean | false | - | 让 Perplexity 将查询扩展为多个并行搜索以实现更广泛的覆盖范围。 |
| search_domain_filter | string | - | - | 逗号分隔域。前缀为“-”以排除。最多20。 |
| search_language_filter | string | - | - | 逗号分隔的ISO 639-1代码(2个字母)。最多10。 |
| search_recency_filter | enum | none | none, hour, day, week, month, year | 相对时间过滤器(小时 | 天 | 周 | 月 | 年)。 |
| search_after_date_filter | string | - | - | 用 YYYY-MM-DD。仅包含此日期之后的来源。 |
| search_before_date_filter | string | - | - | 用 YYYY-MM-DD。仅包含此日期之前的来源。 |
| last_updated_after_filter | string | - | - | 用 YYYY-MM-DD。仅包含此日期之后的来源。 |
| last_updated_before_filter | string | - | - | 用 YYYY-MM-DD。仅包含此日期之前的来源。 |
| country | string | - | - | ISO 3166-1 的两个字母代码(美国、英国等),用于将结果偏向某一国家。 |
| display_server_time | boolean | false | - | 在响应负载中包含服务器时间戳。 |
返回 title/url /片段只 - - 没有 LLM 风格的答案. 通过新线分隔的 multi_query 最多5次查询.
在 EmpirioLabs,Perplexity Search 按量计费:搜索请求 $0.0060 每个请求。本页的实时价格表始终与 API 的实际计费一致。
Perplexity Search 通过 api.empiriolabs.ai 上的 POST /v1/search 提供,使用标准的 Bearer 令牌认证。
可以。EmpirioLabs Playground在浏览器中以与 API 相同的参数运行 Perplexity Search,你可以在写代码之前先测试提示词。
创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。