Skip to main content
Perplexity

Search documentation

Type to search this documentation.

On this pageOverview

Perplexity Search SDK

Traditional search treats retrieval as a monolith: a model issues a query, the search engine runs a predefined pipeline, and the model consumes the processed results. That contract breaks down for agents working on complex, open-ended tasks — it produces coarse context, wastes the model's domain knowledge, and forces naturally parallel work through a serial interface.

Search as Code is Perplexity's answer: expose the search stack as composable primitives that agents orchestrate through generated code. The agent controls retrieval, ranking, filtering, fan-out, and rendering directly, keeps intermediate state in the runtime instead of model context, and consumes only the information that matters.

The Perplexity Search SDK brings this approach to your own agents and applications. It provides the Search API's real-time ranked web results and query-relevant page snippets as Python primitives, with built-in concurrency, provenance, and checkpointing for retrieval-heavy workflows.

The SDK is agents-first: it is designed to be driven by coding agents, not learned from prose documentation. The canonical usage reference is the SDK's Agent Skill, which covers installation, authentication, the full method surface, workflow patterns, and known pitfalls:

pplx-search-sdk Agent Skill

Install this skill into your coding agent and let the agent write the integration.

The source lives at perplexityai/perplexity-search-sdk, and the package is published on PyPI as pplx-srch-sdk.

  • If search is one call inside a broader Perplexity integration, use the Perplexity SDK.
  • For other languages, or when you want a plain HTTP contract, use the Search API directly.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu