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

# Examples Overview

> Runnable projects covering the Agent API, Search API, and Embeddings API

# Examples Overview

Ready-to-run projects that demonstrate real-world use cases across every Perplexity API. Each example includes complete setup instructions and working code.

## Choosing the Right Example

| If you want to... | Use this example | API | Language |
| - | - | - | - |
| Conduct deep web research | [Agent Research Assistant](https://docs.perplexity.ai/docs/cookbook/examples/agent-research-assistant/README.md) | Agent API | Python, TypeScript |
| Compare models across providers | [Model Comparison](https://docs.perplexity.ai/docs/cookbook/examples/model-comparison/README.md) | Agent API | Python |
| Monitor news topics in real time | [Search News Monitor](https://docs.perplexity.ai/docs/cookbook/examples/search-news-monitor/README.md) | Search API | Python, TypeScript |
| Build a document Q\&A system | [Document Q\&A](https://docs.perplexity.ai/docs/cookbook/examples/document-qa/README.md) | Embeddings + Agent API | Python |
| Build a TypeScript CLI agent | [TypeScript Agent CLI](https://docs.perplexity.ai/docs/cookbook/examples/typescript-agent-cli/README.md) | Agent API | TypeScript |
| Analyze images with web context | [Image Analysis](https://docs.perplexity.ai/docs/cookbook/examples/image-analysis/README.md) | Agent API | Python, TypeScript |
| Ask questions about uploaded files | [File Attachment Q\&A](https://docs.perplexity.ai/docs/cookbook/examples/file-attachment-qa/README.md) | Agent API | Python |
| Search SEC filings for financial data | [SEC Filing Search](https://docs.perplexity.ai/docs/cookbook/examples/sec-filing-search/README.md) | Agent API | Python |
| Run code and build a PDF in a sandbox | [Competitor Buzz Tracker](https://docs.perplexity.ai/docs/cookbook/examples/competitor-buzz-tracker/README.md) | Agent API | Python |
| Source candidates for a hiring brief | [Talent Sourcer](https://docs.perplexity.ai/docs/cookbook/examples/talent-sourcer/README.md) | Agent API | Python |
| Enrich a customer row with validated professional evidence | [Enrich Customer Data with Agent API](https://docs.perplexity.ai/docs/cookbook/examples/customer-enrichment-agent-api/README.md) | Agent API | Python |
| Pick an open model via an MCP server | [Model Picker](https://docs.perplexity.ai/docs/cookbook/examples/model-picker/README.md) | Agent API | Python |

## By API

### Agent API

> [card] [Agent Research Assistant](https://docs.perplexity.ai/docs/cookbook/examples/agent-research-assistant/README.md)
>
> Deep web research using the `medium` effort level with structured report output.

> [card] [Model Comparison](https://docs.perplexity.ai/docs/cookbook/examples/model-comparison/README.md)
>
> Compare responses from 5 providers side-by-side — quality, latency, and cost.

> [card] [TypeScript Agent CLI](https://docs.perplexity.ai/docs/cookbook/examples/typescript-agent-cli/README.md)
>
> Interactive TypeScript CLI with streaming, model selection, and web search.

> [card] [Image Analysis](https://docs.perplexity.ai/docs/cookbook/examples/image-analysis/README.md)
>
> Vision + web search for context-enriched image analysis.

> [card] [File Attachment Q\&A](https://docs.perplexity.ai/docs/cookbook/examples/file-attachment-qa/README.md)
>
> Upload documents and ask questions about them with optional web search enrichment.

> [card] [Competitor Buzz Tracker](https://docs.perplexity.ai/docs/cookbook/examples/competitor-buzz-tracker/README.md)
>
> Two chained agent requests: the sandbox searches and counts each brand's share of voice, then renders a downloadable bar-chart PDF.

> [card] [Talent Sourcer](https://docs.perplexity.ai/docs/cookbook/examples/talent-sourcer/README.md)
>
> Wide search in a sandbox: source engineers by skill, location, and tenure, verify each, and rank them with their GitHub and profile links into an HTML shortlist.

> [card] [Customer Enrichment](https://docs.perplexity.ai/docs/cookbook/examples/customer-enrichment-agent-api/README.md)
>
> Read one ClickHouse customer row, validate the selected People Search result ID, and append a source-backed enrichment run.

> [card] [Model Picker](https://docs.perplexity.ai/docs/cookbook/examples/model-picker/README.md)
>
> Connect the Hugging Face MCP server and web search in one request: find open models on the live Hub, verify their downloads and license, and check benchmarks before recommending one.

### Search API

> [card] [Search News Monitor](https://docs.perplexity.ai/docs/cookbook/examples/search-news-monitor/README.md)
>
> Multi-topic news monitoring with domain filtering and recency control.

> [card] [SEC Filing Search](https://docs.perplexity.ai/docs/cookbook/examples/sec-filing-search/README.md)
>
> Search SEC.gov and EDGAR for financial filings with structured data extraction.

### Embeddings API

> [card] [Document Q\&A](https://docs.perplexity.ai/docs/cookbook/examples/document-qa/README.md)
>
> Self-contained RAG system with contextualized embeddings and Agent API answer generation.

## API Key Setup

All examples require a Perplexity API key. Set it as an environment variable:

```bash theme={null}
export PERPLEXITY_API_KEY="your-api-key-here"
```

> [!TIP]
>
> Get your API key at [console.perplexity.ai/project/keys](https://console.perplexity.ai/project/keys).

## Common Requirements

* **Python 3.9+** or **Node.js 18+** (depending on the example)
* **Perplexity API Key**
* **Internet connection** for API calls

Additional requirements vary by example and are listed in each project's documentation.

## Contributing

Found a bug or want to add an example? See our [Contributing Guidelines](https://github.com/ppl-ai/api-cookbook/blob/main/CONTRIBUTING.md).
