| name | perplexity-deep-search |
| description | Deep search via Perplexity API. Three modes: search (quick facts), reason (complex analysis), research (in-depth reports). Returns AI-grounded answers with citations. |
| homepage | https://docs.perplexity.ai |
| metadata | {"clawdbot":{"emoji":"🔮","requires":{"bins":["curl","jq"]},"primaryEnv":"PERPLEXITY_API_KEY"}} |
Perplexity Deep Search
AI-powered web search with three modes for different depth levels.
Quick Start
{baseDir}/scripts/search.sh "latest AI news"
{baseDir}/scripts/search.sh --mode reason "compare React vs Vue for enterprise apps"
{baseDir}/scripts/search.sh --mode research "market analysis of AI in healthcare 2025"
Modes
| Mode | Model | Best For | Cost |
|---|
search (default) | sonar-pro | Quick facts, summaries, current events | Low |
reason | 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 |
|---|
--mode | search, reason, research | search |
--recency | hour, day, week, month | — |
--domains | Comma-separated domain filter | — |
--lang | Language code (pt, en, es, etc.) | — |
--json | Raw JSON output | off |
Examples
{baseDir}/scripts/search.sh --recency week "OpenAI latest announcements"
{baseDir}/scripts/search.sh --domains "arxiv.org,nature.com" "transformer architecture advances"
{baseDir}/scripts/search.sh --lang pt "inteligência artificial no Brasil"
{baseDir}/scripts/search.sh --mode research --json "enterprise AI adoption trends"
API Key
Set PERPLEXITY_API_KEY env var, or store it in a file:
mkdir -p ~/.config/perplexity
echo "your_key_here" > ~/.config/perplexity/api_key
chmod 600 ~/.config/perplexity/api_key
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.
Error Handling
| Error | Cause | Solution |
|---|
401 Unauthorized | Invalid or missing API key | Check PERPLEXITY_API_KEY env var is set |
429 Rate Limited | Too many requests | Wait and retry; use search mode instead of research |
500 Server Error | Perplexity outage | Retry after 30s; fall back to web search |
| Empty results | Query too specific | Broaden search terms |
| Timeout | research mode is slow (~3-5 min) | Expected for deep research; use search for quick queries |