> ## 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.

# Perplexity Search SDK

> An agents-first Python SDK that brings Perplexity's Search as Code approach to your applications: composable retrieval primitives that agents orchestrate in code.

## Search as code

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](https://research.perplexity.ai/articles/rethinking-search-as-code-generation) 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](/docs/search/quickstart)'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.

## Built for agents

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:

<Card title="pplx-search-sdk Agent Skill" icon="github" horizontal="true" arrow="true" href="https://github.com/perplexityai/api-platform-developers/tree/main/skills/pplx-search-sdk">
  Install this skill into your coding agent and let the agent write the integration.
</Card>

The source lives at [perplexityai/perplexity-search-sdk](https://github.com/perplexityai/perplexity-search-sdk), and the package is published on PyPI as [pplx-srch-sdk](https://pypi.org/project/pplx-srch-sdk/).

## Related products

* If search is one call inside a broader Perplexity integration, use the [Perplexity SDK](/docs/sdk/overview).
* For other languages, or when you want a plain HTTP contract, use the [Search API](/docs/search/quickstart) directly.
