Thank you for your interest in contributing to our API Cookbook! We welcome high-quality examples that showcase the capabilities of Perplexity's Sonar API.
This cookbook contains three main sections:
Step-by-step tutorials and example implementations that teach specific concepts or solve common use cases.
Community-built projects that demonstrate real-world applications of the Sonar API.
In-depth integration guides and advanced implementation tutorials for complex use cases and integrations with other tools.
- Clear, educational content that helps developers understand how to use the Sonar API effectively
- Real-world use cases that solve actual problems
- Well-documented code with clear explanations
- Novel applications that showcase unique ways to leverage the API
All contributions should be in MDX format. If your project includes a full application (web app, CLI tool, etc.), host it in a separate public repository and link to it from your MDX file.
Your MDX file should include:
---
title: Your Project Title
description: A concise description of what your project does
sidebar_position: 1
keywords: [relevant, keywords, for, search]
---
# Project Title
Brief introduction explaining what your project does and why it's useful.
## Features
- Key feature 1
- Key feature 2
- Key feature 3
## Prerequisites
What users need before they can use your project.
## Installation
Step-by-step installation instructions.
## Usage
Clear examples of how to use your project.
## Code Explanation
Key code snippets with explanations of how they work.
## Links
- [GitHub Repository](https://github.com/yourusername/yourproject)
- [Live Demo](https://yourproject.com) (if applicable)
## Limitations
Any known limitations or considerations users should be aware of.- Fork this repository
- Create a new directory under
/docs/examples/your-example-name/ - Add your
README.mdxfile following the structure above - Include any necessary code snippets in your MDX file
- Submit a pull request
- Build your project in a separate public repository
- Fork this repository
- Create a new MDX file under
/docs/showcase/your-project-name.mdx - Include screenshots or demos if applicable
- Submit a pull request
- Fork this repository
- Create a new directory under
/docs/articles/your-article-name/ - Add your
README.mdxfile following the structure above - Focus on advanced implementations, integrations, or complex patterns
- Include comprehensive code examples and explanations
- Submit a pull request
When submitting a PR, please use this template:
## Description
Brief description of your contribution
## Type of Contribution
- [ ] Example Tutorial
- [ ] Showcase Project
- [ ] Article/Integration Guide
## Checklist
- [ ] My code follows the cookbook's style guidelines
- [ ] I have included comprehensive documentation
- [ ] I have tested my code and it works as expected
- [ ] I have included all necessary dependencies and setup instructions
- [ ] My MDX file includes proper frontmatter (title, description, keywords)
- [ ] I have linked to any external repositories or live demos
## Project Details
**What problem does this solve?**
**What makes this contribution valuable to other developers?**
**External Links (if applicable):**
- GitHub Repository:
- Live Demo:
- Blog Post/Article: - Use clear, descriptive variable and function names
- Include comments for complex logic
- Follow the language's standard conventions
- Handle errors appropriately
- Include example environment variables (without actual keys)
- Basic "Hello World" examples that don't demonstrate real use cases
- Duplicates of existing cookbook examples
- Projects with security vulnerabilities
- Poorly documented code
If you have questions about contributing, please:
- Check existing examples for reference
- Open an issue for discussion before starting major work
- Contact us at api@perplexity.ai for specific questions
We look forward to seeing your creative applications of the Perplexity Sonar API!