# Perplexity Search
> Search the web with real-time results and advanced filtering powered by Perplexity's Search API. Provides ranked search results with domain, language, date range, and recency filters. Supports multi-query searches and regional search results.

- **Package:** @perplexity-ai/ai-sdk
- **Author:** Perplexity
- **Tags:** search, web

## Environment Variables
- `PERPLEXITY_API_KEY`

## Included Tools
- **perplexitySearch:** Search the web with real-time results and advanced filtering options

## Installation
```bash
npm install @perplexity-ai/ai-sdk
```

## Usage
```typescript
import { generateText, stepCountIs } from 'ai';
import { perplexitySearch } from '@perplexity-ai/ai-sdk';

const { text } = await generateText({
  model: 'openai/gpt-5.2',
  prompt: 'What are the latest AI developments? Use search to find current information.',
  tools: {
    search: perplexitySearch(),
  },
  stopWhen: stepCountIs(3),
});

console.log(text);
```

## Links
- [Documentation](https://docs.perplexity.ai/guides/search-quickstart)
- [npm](https://www.npmjs.com/package/@perplexity-ai/ai-sdk)

---
[Full Library Index](/library.md)