---
ref: tool:perplexity/search-web
name: Search the web
company: company:perplexity
workflows: []
access: [mcp, cli, api]
tags: [capability:research-accounts, category:web-search, has:api, has:cli, has:mcp]
docs: https://docs.perplexity.ai/api-reference/search-post
updated: 2026-09-27
---

# Search the web

Returns ranked web results for a query, each with its title, URL, snippet and dates, optionally limited to domains or a date range.

On the CLI, `-n` sets the number of results (10 by default), and `--domains`,
`--recency-filter`, the date flags and `--country` apply the Search API's
filters. Extra queries on the CLI are rephrasings of one question, not separate
searches, and come back as a single ranked list.

## Set up

Use the first option your agent supports.

### MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

```json
{ "mcpServers": { "perplexity": { "url": "https://api.perplexity.ai/mcp" } } }
```

Call the MCP tool `perplexity_search`.

Server URL: https://api.perplexity.ai/mcp

### CLI (official)

Install the command, then confirm it runs.

```sh
curl -fsSL https://github.com/perplexityai/perplexity-cli/releases/latest/download/install.sh | sh
pplx --version
```

Run `pplx search web`.

Set `$PERPLEXITY_API_KEY` in your environment first (get a key: https://console.perplexity.ai/project/keys).

### API (official)

- Base URL: https://api.perplexity.ai
- Endpoint: `POST /search`
- Auth: send the header `Authorization: Bearer $PERPLEXITY_API_KEY`
- Get a key: https://console.perplexity.ai/project/keys
- Docs: https://docs.perplexity.ai/docs/getting-started/overview

Before doing anything else, make one read-only call to confirm access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
