---
title: "Search the Web"
method: POST
path: "/search"
---

# Search the Web

`POST /search`

Search the web and retrieve relevant web page contents.

## Request body

- ApiSearchRequest
  - `query` union, required
    - string
    - string[]
  - `max_tokens` integer
  - `max_tokens_per_page` integer
  - `max_results` integer
  - `search_domain_filter` string[], nullable
  - `search_language_filter` string[], nullable
  - `search_recency_filter` 'hour' | 'day' | 'week' | 'month' | 'year', nullable
  - `search_after_date_filter` string, nullable
  - `search_before_date_filter` string, nullable
  - `last_updated_before_filter` string, nullable
  - `last_updated_after_filter` string, nullable
  - `search_mode` 'web' | 'academic' | 'sec', nullable
  - `country` string, nullable
  - `display_server_time` boolean
  - `search_type` 'web' | 'people', nullable — Search type — "web" for general web search, "people" for people search. max_results above 20 is only supported for people search.
  - `search_context_size` 'low' | 'medium' | 'high' — Controls how much content is retrieved per result. Larger sizes return more page content at higher cost. Defaults to "high". Omit when supplying explicit max_tokens / max_tokens_per_page.

## Response `200`

Successful Response

- ApiSearchResponse
  - `results` ApiSearchPage[], required
    - `title` string, required
    - `url` string, required
    - `snippet` string, required
    - `date` string, nullable
    - `last_updated` string, nullable
  - `id` string, required
  - `server_time` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/perplexityai/apis/perplexity-ai-api.md) · [All operations](https://skmtc.net/perplexityai/apis/perplexity-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/perplexityai/perplexity-ai-api/versions/bcca72d3b564/schema)
