Search the Web
Search the web and retrieve relevant web page contents.
Documentation Index
Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt
Use this file to discover all available pages before exploring further.
- Search API — Returns structured JSON
results[]withtitle,url,snippet,date, andlast_updated. Callhttps://api.perplexity.ai/searchdirectly — no router required. - Sonar — Chat completions with built-in web search. Returns a prose answer with citations, not a results array.
Response Shape
The Search API returns a rankedresults[] array. Each result includes title, url, snippet, and optional date and last_updated fields:
Example Response
Example Response
Direct Call
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Search query (required)
ISO 3166-1 alpha-2 country code
2Maximum number of results to return
1 <= x <= 20Controls how much content is extracted from result pages.
low— short passages most relevant to the query.medium— a balanced amount of content per document.high(default) — detailed content relevant to the query.
Omit when using max_tokens or max_tokens_per_page.
Maximum total webpage content tokens to return across all search results
1 <= x <= 1000000Maximum webpage content tokens to extract from each result page
1 <= x <= 1000000ISO 639-1 language codes (2-character max)
202Limit search results to specific domains (max 20)
20253Return results updated after this date (MM/DD/YYYY)
Return results updated before this date (MM/DD/YYYY)
Return results published after this date (MM/DD/YYYY)
Return results published before this date (MM/DD/YYYY)
Filter by publication recency (hour/day/week/month/year)
hour, day, week, month, year