What you get
The Search API is one endpoint,POST https://api.perplexity.ai/search. You send a query and get back ranked web results as structured data for your own code to filter, store, or hand to a model. There is no generated answer and no token billing.
Each result has:
The response also carries a request
id. A server_time field is present and may be null.
snippet.
Response
Controls
Full parameter reference: POST /search. Agent API fields such as
model, effort, instructions, and tools are not part of a search request.
Use these results in your own agent
Everything your agent needs from a Search response istitle, url, and snippet. Install the Perplexity Python library (pip install perplexityai, imported as perplexity) or the TypeScript SDK (npm install @perplexity-ai/perplexity_ai), set PERPLEXITY_API_KEY in the environment, and the client picks the key up. Then:
- Cap the text you hand the model with
max_tokens_per_page(per result) andmax_tokens(whole response). These change what comes back, not the price. - Pass
queryas an array of up to five related queries to fan out in one request. Five is the limit, so check the length before you send. The request is billed once but uses one rate-limit unit per query. Each query is processed independently and the results come back in oneresultslist. Dedupe byurlbefore you hand them to the model. - Skip results whose
snippetis empty. Keep theurlso the model can cite it.
- OpenAI SDK, Anthropic SDK, and Gemini SDK: Search as a function tool in your own agent loop.
- Perplexity API MCP server: the
perplexity_searchtool for Claude Code, Cursor, VS Code, and other MCP clients, with no handler to write. - Perplexity CLI:
pplx search webreturns the same JSON from a shell, for coding agents that run commands. - Search SDK: a Python library that adds built-in concurrency, provenance, and checkpointing on top of the same Search results and page snippets.
Price and rate limit
Details: Search API pricing and Search API rate limits.
Search API or Agent API
Extracted text, not page reading
POST /search takes queries, not URLs. Each result’s snippet is text extracted from that page that is relevant to your query, cut to max_tokens_per_page. It is not the full page, and there is no parameter to re-fetch a page live or to control cache age. search_recency_filter, the date filters, and the date and last_updated fields on each result are how you select and check freshness.
To get text from URLs you already have:
- Perplexity CLI:
pplx content snippets "<query>" <url> [<url> ...]returns query-relevant passages from up to 50 URLs you name, with total and per-page token budgets and failures reported per URL. - Search SDK:
pplx_srch_sdk.content.snippets(query=..., urls=[...])does the same from Python, one result per URL, each withtextor anerror. - Agent API
fetch_urltool: a hosted model fetches and reads a URL during an Agent API run. It is a tool inside that run, billed with the run, not a standalone endpoint you call with a URL.
Ways to call it
- Quickstart with the Perplexity Python library, the TypeScript SDK, and cURL
- Perplexity CLI for the same ranked results as JSON from a shell
- As a function tool in the OpenAI, Anthropic, and Gemini SDKs
- Search SDK, a Python library for composing multi-step retrieval in code
- Interactive Playground, no API key required