Search the web and return ranked results with extracted page content. Perplexity Search API-compatible.

post/v1/search

Request

  • Base URL
    https://api.llmgateway.io
  • Auth
    HTTP bearer

Request body

modelstring

ID of the search model to use, or "auto" for the cheapest active search model (matching search_type when set). Defaults to perplexity/perplexity-search, or perplexity/perplexity-search-fast when search_type is fast.

search_type'web' | 'fast' | 'people'

Perplexity search type. "web" and "fast" select perplexity-search and perplexity-search-fast; "people" is not supported yet.

max_resultsinteger

Maximum number of results to return. Defaults to 10.

max_tokensinteger

Maximum total tokens of extracted content across all results.

max_tokens_per_pageinteger

Maximum tokens of extracted content per result.

search_context_size'low' | 'medium' | 'high'

How much page content to extract per result.

countrystring

ISO 3166-1 alpha-2 country code for regional results.

search_language_filterstring[]

ISO 639-1 language codes to restrict results to.

search_domain_filterstring[]

Domains to restrict results to, or to exclude with a "-" prefix.

search_recency_filter'hour' | 'day' | 'week' | 'month' | 'year'

Only return results published within this period.

search_after_date_filterstring
search_before_date_filterstring
last_updated_after_filterstring
last_updated_before_filterstring

Example request

{
  "model": "perplexity/perplexity-search",
  "search_type": "web",
  "max_results": 5,
  "country": "US",
  "search_domain_filter": [
    "arxiv.org",
    "nature.com"
  ]
}

Response

Search response with ranked web results.

idstring
modelstring required
server_timestring nullable

Changes