|
1 | 1 | ---
|
2 | 2 | slug: /
|
3 | 3 | title: Perplexity Sonar API Cookbook
|
4 |
| -description: A comprehensive collection of practical applications, tutorials, and integration guides for Perplexity's Sonar API |
| 4 | +description: A collection of practical examples and guides for building with Perplexity's Sonar API |
5 | 5 | keywords: [perplexity, sonar, api, cookbook, examples, tutorials]
|
6 | 6 | ---
|
7 | 7 |
|
8 |
| -**Build with the best AI answer engine.** A comprehensive collection of practical applications, tutorials, and integration guides built with [**Perplexity's Sonar API**](https://sonar.perplexity.ai/) - the fastest, most cost-effective grounded search APIs with unparalleled real-time, web-wide research and Q&A capabilities. |
| 8 | +# Perplexity Sonar API Cookbook |
9 | 9 |
|
10 |
| -## 🌟 Why Sonar API? |
| 10 | +A collection of practical examples and guides for building with [**Perplexity's Sonar API**](https://sonar.perplexity.ai/) - the fastest, most cost-effective AI answer engine with real-time search capabilities. |
11 | 11 |
|
12 |
| -Based on [Perplexity's Sonar platform](https://sonar.perplexity.ai/), this cookbook demonstrates how to leverage: |
| 12 | +## Quick Start |
13 | 13 |
|
14 |
| -- **⚡ Fastest Performance** - Outperforms the competition with industry-leading speed |
15 |
| -- **💰 Most Affordable** - Sonar's grounding request pricing beats the competition |
16 |
| -- **🔒 Private & Secure** - No LLM training on your data |
17 |
| -- **🌐 Real-time Search** - Unparalleled web-wide research capabilities |
18 |
| -- **📚 Multiple Models** - From lightweight Sonar to premier Sonar Pro and Deep Research |
| 14 | +To get started with any project in this cookbook: |
19 | 15 |
|
20 |
| -## 🚀 Getting Started |
| 16 | +1. **Browse examples** - Find the use case that matches your needs |
| 17 | +2. **Follow the guide** - Each example includes complete setup instructions |
| 18 | +3. **Get the code** - Full implementations are available in our [GitHub repository](https://github.com/ppl-ai/api-cookbook) |
| 19 | +4. **Build and customize** - Use the examples as starting points for your projects |
21 | 20 |
|
22 |
| -To use any project in this cookbook, you'll need: |
| 21 | +## What's Inside |
23 | 22 |
|
24 |
| -1. **Perplexity API Key** - [Get started here](https://docs.perplexity.ai/home) |
25 |
| -2. **Python 3.7+** - For running the examples |
26 |
| -3. **Basic familiarity** with REST APIs and Python |
| 23 | +### [Examples](/examples) |
| 24 | +Ready-to-run projects that demonstrate specific use cases and implementation patterns. |
27 | 25 |
|
28 |
| -Each example includes its own setup guide and documentation. |
| 26 | +### [Showcase](/showcase) |
| 27 | +Community-built applications that demonstrate real-world implementations of the Sonar API. |
29 | 28 |
|
30 |
| ---- |
31 |
| - |
32 |
| -## 🔧 Examples |
33 |
| - |
34 |
| -### [🔍 Fact Checker CLI](cookbook/examples/fact-checker-cli/) |
35 |
| -Command-line tool that analyzes claims and articles for factual accuracy using Sonar's grounded search. |
36 |
| -- Structured claim analysis with confidence ratings |
37 |
| -- Source citation tracking and verification |
38 |
| -- JSON output for automation workflows |
39 |
| -- Professional fact-checking capabilities |
40 |
| - |
41 |
| -### [🤖 Daily Knowledge Bot](cookbook/examples/daily-knowledge-bot/) |
42 |
| -Automated system delivering interesting facts using Perplexity's AI-powered research. |
43 |
| -- Topic rotation and scheduling support |
44 |
| -- Persistent storage and configuration |
45 |
| -- Educational content generation |
46 |
| -- Customizable knowledge domains |
47 |
| - |
48 |
| -### [🏥 Disease Information App](cookbook/examples/disease-qa/) |
49 |
| -Interactive web application providing structured medical information with Sonar's real-time search. |
50 |
| -- Browser-based interactive interface |
51 |
| -- Structured knowledge cards with citations |
52 |
| -- Medical information lookup and research |
53 |
| -- Standalone deployment ready |
54 |
| - |
55 |
| -### [📚 Academic Research Finder](cookbook/examples/research-finder/) |
56 |
| -CLI tool for discovering and summarizing academic literature with Sonar's research capabilities. |
57 |
| -- Academic source prioritization |
58 |
| -- Citation extraction with DOI tracking |
59 |
| -- Research workflow optimization |
60 |
| -- Literature review automation |
61 |
| - |
62 |
| -## 📖 Integration Guides |
63 |
| - |
64 |
| -In-depth tutorials for advanced implementations: |
65 |
| - |
66 |
| -### [🔗 OpenAI Agents Integration](cookbook/articles/openai-agents-integration/) |
67 |
| -Complete guide for integrating Sonar API with OpenAI Agents SDK. |
68 |
| -- Custom client configuration patterns |
69 |
| -- Async integration examples |
70 |
| -- Function tool implementations |
71 |
| -- Production deployment strategies |
72 |
| - |
73 |
| -### [🧠 Memory Management](cookbook/articles/memory-management/) |
74 |
| -Advanced conversation memory solutions using LlamaIndex with Sonar. |
75 |
| -- Token-aware summarization techniques |
76 |
| -- Vector-based persistence systems |
77 |
| -- Cross-session continuity patterns |
78 |
| -- Production-scalable architectures |
79 |
| - |
80 |
| -## 🎯 Use Cases Covered |
81 |
| - |
82 |
| -This cookbook provides solutions for: |
83 |
| - |
84 |
| -- **🔍 Content Verification** - Fact-checking for journalism and research |
85 |
| -- **📚 Educational Tools** - Knowledge distribution and learning systems |
86 |
| -- **🏥 Information Lookup** - Medical, academic, and professional research |
87 |
| -- **🤖 Conversational AI** - Context-aware chatbots with long-term memory |
88 |
| -- **🔗 API Integration** - Connecting Sonar with existing tools and workflows |
89 |
| -- **📊 Research Automation** - Literature reviews and data synthesis |
90 |
| - |
91 |
| -## 🏢 Trusted by Industry Leaders |
92 |
| - |
93 |
| -Sonar powers products for companies like: |
94 |
| -- **Zoom** - AI Companion 2.0 supercharged with Perplexity's API |
95 |
| -- **Copy.ai** - 8-hour research time savings per rep, 20% throughput increase |
96 |
| -- **Doximity** - Up-to-the-minute clinical answers for physicians |
97 |
| - |
98 |
| -*Source: [Sonar customer stories](https://sonar.perplexity.ai/)* |
99 |
| - |
100 |
| -## 🌐 Sonar API Models |
101 |
| - |
102 |
| -Choose the right model for your use case: |
103 |
| - |
104 |
| -| Model | Best For | Features | |
105 |
| -|-------|----------|----------| |
106 |
| -| **Sonar** | Quick lookups | Lightweight, fast, affordable | |
107 |
| -| **Sonar Pro** | Complex research | Advanced queries, follow-ups | |
108 |
| -| **Reasoning Pro** | Deep analysis | DeepSeek R1 powered reasoning | |
109 |
| -| **Deep Research** | Comprehensive reports | Expert-level research synthesis | |
110 |
| - |
111 |
| -*Learn more: [Sonar API Documentation](https://docs.perplexity.ai/home)* |
| 29 | +### [Integration Guides](/articles) |
| 30 | +In-depth tutorials for advanced implementations and integrations with other tools. |
112 | 31 |
|
113 |
| -## 🤝 Contributing |
| 32 | +> **Note**: All complete code examples, scripts, and project files can be found in our [GitHub repository](https://github.com/ppl-ai/api-cookbook). The documentation here provides guides and explanations, while the repository contains the full runnable implementations. |
114 | 33 |
|
115 |
| -We welcome contributions to expand this cookbook! Whether you want to: |
| 34 | +## Contributing |
116 | 35 |
|
117 |
| -- 🐛 Fix bugs in existing examples |
118 |
| -- ✨ Add new features to current tools |
119 |
| -- 🆕 Contribute entirely new Sonar API applications |
120 |
| -- 📚 Improve documentation and tutorials |
| 36 | +Have a project built with Sonar API? We'd love to feature it! Check our [Contributing Guidelines](https://github.com/ppl-ai/api-cookbook/blob/main/CONTRIBUTING.md) to learn how to: |
121 | 37 |
|
122 |
| -Please check our [Contributing Guidelines](https://github.com/ppl-ai/api-cookbook/blob/main/CONTRIBUTING.md) for details. |
| 38 | +- Submit example tutorials |
| 39 | +- Add your project to the showcase |
| 40 | +- Improve existing content |
123 | 41 |
|
124 |
| -## 📄 License |
| 42 | +## Resources |
125 | 43 |
|
126 |
| -This project is licensed under the [MIT License](https://github.com/ppl-ai/api-cookbook/blob/main/LICENSE). |
| 44 | +- [Sonar API Documentation](https://docs.perplexity.ai/home) |
| 45 | +- [API Playground](https://perplexity.ai/account/api/playground) |
| 46 | +- [GitHub Repository](https://github.com/ppl-ai/api-cookbook) |
127 | 47 |
|
128 | 48 | ---
|
129 | 49 |
|
130 |
| -**Maintained by the Perplexity community** |
131 |
| -*Powered by [Sonar API](https://sonar.perplexity.ai/) - Where Knowledge Begins* |
| 50 | +*Maintained by the Perplexity community* |
0 commit comments