Perplexity Deep Search
AI-powered web search with three modes for different depth levels.
Quick Start
CODEBLOCK0
Modes
| Mode | Model | Best For | Cost |
|---|
| INLINECODE0 (default) | INLINECODE1 | Quick facts, summaries, current events | Low |
| INLINECODE2 |
sonar-reasoning-pro | Complex analysis, comparisons, problem-solving | Medium |
|
research |
sonar-deep-research | In-depth reports, market analysis, literature reviews | High |
Options
| Flag | Description | Default |
|---|
| INLINECODE6 | INLINECODE7 , reason, INLINECODE9 | INLINECODE10 |
| INLINECODE11 |
hour,
day,
week,
month | — |
|
--domains | Comma-separated domain filter | — |
|
--lang | Language code (
pt,
en,
es, etc.) | — |
|
--json | Raw JSON output | off |
Examples
CODEBLOCK1
API Key
Set PERPLEXITY_API_KEY env var, or store it in a file:
CODEBLOCK2
The script checks the env var first, then falls back to the file.
Pricing Reference
- - Search (sonar-pro): ~$0.01/query
- Reasoning (sonar-reasoning-pro): ~$0.02/query
- Deep Research (sonar-deep-research): ~$0.40/query (uses many searches + reasoning)
Use search for everyday queries. Reserve research for when you truly need exhaustive analysis.
Perplexity 深度搜索
支持三种不同深度级别的AI驱动网络搜索。
快速开始
bash
快速搜索(sonar)—— 事实、摘要、时事
{baseDir}/scripts/search.sh 最新AI新闻
推理搜索(sonar-reasoning-pro)—— 复杂分析、多步骤推理
{baseDir}/scripts/search.sh --mode reason 对比React与Vue在企业应用中的表现
深度研究(sonar-deep-research)—— 完整报告、全面分析
{baseDir}/scripts/search.sh --mode research 2025年AI在医疗领域的市场分析
搜索模式
| 模式 | 模型 | 最佳适用场景 | 成本 |
|---|
| search(默认) | sonar-pro | 快速查询事实、摘要、时事 | 低 |
| reason |
sonar-reasoning-pro | 复杂分析、对比、问题解决 | 中 |
| research | sonar-deep-research | 深度报告、市场分析、文献综述 | 高 |
选项参数
| 参数 | 说明 | 默认值 |
|---|
| --mode | search、reason、research | search |
| --recency |
hour、day、week、month | — |
| --domains | 逗号分隔的域名过滤 | — |
| --lang | 语言代码(pt、en、es等) | — |
| --json | 输出原始JSON格式 | 关闭 |
使用示例
bash
按时间范围搜索
{baseDir}/scripts/search.sh --recency week OpenAI最新公告
限定特定域名搜索
{baseDir}/scripts/search.sh --domains arxiv.org,nature.com Transformer架构最新进展
葡萄牙语搜索
{baseDir}/scripts/search.sh --lang pt 巴西人工智能发展
深度研究并输出JSON格式
{baseDir}/scripts/search.sh --mode research --json 企业AI应用趋势
API密钥配置
设置PERPLEXITYAPIKEY环境变量,或将其存储在文件中:
bash
mkdir -p ~/.config/perplexity
echo yourkeyhere > ~/.config/perplexity/api_key
chmod 600 ~/.config/perplexity/api_key
脚本会优先检查环境变量,若未设置则读取文件中的密钥。
价格参考
- - 搜索(sonar-pro): 约$0.01/次查询
- 推理(sonar-reasoning-pro): 约$0.02/次查询
- 深度研究(sonar-deep-research): 约$0.40/次查询(包含多次搜索+推理)
日常查询请使用search模式。仅在确实需要全面分析时,再使用research模式。