---
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

## Changes

- **2026-06-02** `062c83bf3d10` — 1 info
  - added the new optional request property `search_context_size`
- **2026-05-27** `8ed404f0b14b` — 1 warning
  - removed the request property `search_context_size`
- **2026-05-27** `f1c542c7dab4` — 1 info
  - added the new optional request property `search_context_size`
- **2026-05-13** `7f2ff59879db` — 1 info
  - added the new optional request property `search_type`
- **2025-12-05** `625f4b8c8e07` — 2 info
  - added the new optional request property `last_updated_after_filter`
  - added the new optional request property `last_updated_before_filter`

[Full history](https://skmtc.dev/perplexityai/apis/perplexity-ai-api/changes/search/post.md)

---

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