Documentation Index
Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt
Use this file to discover all available pages before exploring further.
Equity Research Brief
A command-line tool that generates a structured equity research brief for any public ticker using Perplexity’s Agent API and the built-infinance_search tool.
finance_search returns structured market data — quotes, financials, earnings transcripts, peer comparisons, analyst estimates — so the model can compose a report grounded in numbers, not just narrative. The tool is purpose-built for agentic investor workflows.
Features
- One command produces a 6-section brief: snapshot, business overview, financial trajectory, latest earnings, peer context, risks, bottom line
- Uses the Agent API’s
finance_searchtool for structured fundamentals, quotes, and earnings-call transcripts - Three preset configurations matching the official
finance_searchrecommendations:quote— live price/quote only, fastest and cheapestsingle— single-company historical lookup with web contextresearch— full multi-step cross-company brief (default)
- Prints citation-ready Perplexity finance source URLs alongside the brief
- Reports
finance_searchinvocation count and total request cost --jsonflag emits the raw Agent API response for downstream pipelines
Prerequisites
- Python 3.9+
- A Perplexity API key with Agent API access.
finance_searchis currently in beta — see the Finance Search docs for availability.
Installation
API Key Setup
--api-key, or place it in a .pplx_api_key file in the working directory.
Quick Start
Generate a full research brief on NVIDIA:Usage
Just a live quote (cheapest, ~1 tool call)
Single-company historical lookup with web context
Full multi-step research brief (default)
Emit raw Agent API JSON
Configuration Reference
| Config | Model | Tools | Max steps | Best for |
|---|---|---|---|---|
quote | perplexity/sonar | finance_search | 1 | Live prices, quotes, fastest path |
single | openai/gpt-5.5 | web_search + finance_search + fetch_url | 5 | One-company historical fundamentals |
research | anthropic/claude-opus-4-7 | web_search + finance_search + fetch_url | 10 | Multi-company comparisons, full brief |
finance_search recommended configurations.
Example Output (truncated)
Code Walkthrough
The script does three things: 1. Issue a single Agent API call withfinance_search enabled.
finance_search categories to fetch (quote, financials, transcript, etc.) based on the prompt. You don’t need to hand-pick fields.
2. Walk response.output to extract both the assistant text and the structured finance_results blocks.
result.sources are stable, citation-ready links — useful when the brief is consumed by humans or by a downstream RAG pipeline.
Prompting Guidance
finance_search works best when the prompt asks for a business outcome, not for specific data shapes. The system prompt instructs the model to:
- be quantitative and attribute numbers to the right period (e.g.
FY2025,Q3 FY26) - never invent numbers — if
finance_searchdoesn’t return a field, say so explicitly - format the output in clean Markdown
Pricing
finance_search is billed at $5 per 1,000 invocations, separate from model token usage. Each preset has different cost characteristics:
quote: typically 1 invocation, ~$0.007 per briefsingle: 1–3 invocations + GPT-5.5 tokensresearch: 3–6 invocations + Claude Opus tokens
Limitations
finance_searchis currently in beta and may not be enabled on all API keys- Results depend on Perplexity’s finance data coverage; obscure or non-US tickers may return less structured data
- This is not investment advice. The “Bottom line” section is explicitly framed as analytical opinion, not a recommendation