Skip to main content

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

By API

Agent API

Agent Research Assistant

Deep web research using the medium 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.

Competitor Buzz Tracker

Two chained agent requests: the sandbox searches and counts each brand’s share of voice, then renders a downloadable bar-chart PDF.

Talent Sourcer

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.

Model Picker

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

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