Skip to main content
POST
/
search
Search the Web
curl --request POST \
  --url https://api.perplexity.ai/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>"
}
'
{
  "results": [
    {
      "title": "<string>",
      "url": "<string>",
      "snippet": "<string>",
      "date": "<string>",
      "last_updated": "<string>"
    }
  ],
  "id": "<string>",
  "server_time": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
required

Search query (required)

country
string

ISO 3166-1 alpha-2 country code

Required string length: 2
max_results
integer
default:10

Maximum number of results to return

Required range: 1 <= x <= 20
max_tokens
integer
default:10000

Maximum tokens for context

Required range: 1 <= x <= 1000000
max_tokens_per_page
integer
default:4096

Maximum tokens per page

Required range: 1 <= x <= 1000000
search_language_filter
string[]

ISO 639-1 language codes (2-character max)

Maximum array length: 20
Required string length: 2
search_domain_filter
string[]

Limit search results to specific domains (max 20)

Maximum array length: 20
Maximum string length: 253
last_updated_after_filter
string

Return results updated after this date (MM/DD/YYYY)

last_updated_before_filter
string

Return results updated before this date (MM/DD/YYYY)

search_after_date_filter
string

Return results published after this date (MM/DD/YYYY)

search_before_date_filter
string

Return results published before this date (MM/DD/YYYY)

search_recency_filter
enum<string>

Filter by publication recency (hour/day/week/month/year)

Available options:
hour,
day,
week,
month,
year

Response

Successful Response

results
ApiSearchPage · object[]
required
id
string
required
server_time
string | null