Skip to main content

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

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 exampleAPILanguage
Conduct deep web researchAgent Research AssistantAgent APIPython, TypeScript
Compare models across providersModel ComparisonAgent APIPython
Monitor news topics in real timeSearch News MonitorSearch APIPython, TypeScript
Build a document Q&A systemDocument Q&AEmbeddings + Agent APIPython
Build a TypeScript CLI agentTypeScript Agent CLIAgent APITypeScript
Analyze images with web contextImage AnalysisAgent APIPython, TypeScript
Ask questions about uploaded filesFile Attachment Q&AAgent APIPython
Search SEC filings for financial dataSEC Filing SearchAgent APIPython

By API

Agent API

Agent Research Assistant

Deep web research using the deep-research preset with structured report output.

Model Comparison

Compare responses from 5 providers side-by-side — quality, latency, and cost.

TypeScript Agent CLI

Interactive TypeScript CLI with streaming, model selection, and web search.

Image Analysis

Vision + web search for context-enriched image analysis.

File Attachment Q&A

Upload documents and ask questions about them with optional web search enrichment.

Search API

Search News Monitor

Multi-topic news monitoring with domain filtering and recency control.

SEC Filing Search

Search SEC.gov and EDGAR for financial filings with structured data extraction.

Embeddings API

Document Q&A

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:
export PERPLEXITY_API_KEY="your-api-key-here"
Get your API key at perplexity.ai/account/api.

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.