Skip to main content

Overview

This page covers the choices that most affect Search API results and throughput: how you write queries, when to send several queries, when to use filters, how many results to request, and how to handle HTTP 429. For the request and response format, start with the quickstart.

Write short, specific queries

Name the entities, terms, and constraints you care about, in a few keywords. A specific query returns more relevant results than a vague one, and a short keyword query usually works better than a full question.
Put time limits in the date and time filters instead of adding a year to the query. A year in the query is only another keyword and does not restrict publication dates.

Split broad topics into several queries

For a topic with several angles, send query as an array of up to five short queries instead of one long query. Break comparisons into one query per entity, for example ["Brand A protein powder review", "Brand B protein powder review"] instead of "Brand A vs Brand B protein powder review". max_results caps the combined list across all queries, so raise it when you send several queries, and dedupe by url. A request with several queries is billed once and uses one rate-limit unit per query. See Several queries in one request for an example with a recorded response.

Use filters instead of query words

When a constraint is about the source rather than the topic, such as the site, date, or language, use a filter instead of adding words to the query.

Request only the results you use

max_results defaults to 10 and accepts 1 to 20 for web and Fast Search, or 1 to 50 for People Search. Set it to the number of results your code or model will read. Fewer results keep tool output small when you pass results to a model.

Handle rate limits

The Search API allows 50 query units per second, and each query in a request uses one unit. Responses carry x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, and x-ratelimit-used headers, so you can slow down before you reach the limit. A request over the limit returns HTTP 429 and is not billed. See Search API rate limits. The Perplexity Python library and the TypeScript SDK retry 429 responses twice by default and wait for Retry-After when the server sends it. To retry more, set max_retries (Python) or maxRetries (TypeScript) on the client, as shown in Configuration, or write your own backoff as shown in Exponential backoff for rate limits. To run many searches concurrently under the limit, see Performance. If your workload repeats the same queries, cache the results for a period that fits how fresh your data needs to be, and check last_updated when freshness matters.

Next Steps

Search SDK

Composable search primitives for agents that write code.

Filters

Restrict results by date, language, and domain.

Error Handling

SDK error types, retries, and backoff.

API Reference

Every request parameter, the response schema, and error responses.