---
title: "Search API"
method: POST
path: "/search"
tags: ["Search"]
---

# Search API

`POST /search`

## Request

- Base URL: `https://api.desearch.ai`
- URL: `https://api.desearch.ai/search`
- Auth: API key in header `Authorization`

Search the web and return ranked pages, each with the passage that best matches the query.

Billing metadata: responses include `cost_usd`, `usage_count`, `service`, and `currency` fields in the JSON body.

## Request body

- SearchRequest
  - `query` string, required: Search query.
  - `mode` 'fast' | 'balanced': `fast` returns results sooner. `balanced` favors relevance.
  - `count` integer: Number of results to return: 10, 15 or 20.
  - `start_date` string, date, nullable: Only return pages published on or after this date (YYYY-MM-DD).
  - `end_date` string, date, nullable: Only return pages published on or before this date (YYYY-MM-DD).
  - `highlights` boolean: Include the passage that best matches the query.
  - `page_text` boolean: Include the full page text.

## Response `200`

Ranked results and the cost of the request.

- SearchResponse
  - `results` SearchResult[], required
    - `url` string, required
    - `title` string, required
    - `published_date` string, nullable: Publication date (YYYY-MM-DD) when known.
    - `highlights` string[], nullable: Returned unless the request sets `highlights: false`.
    - `page_text` string, nullable: Returned only when the request sets `page_text: true`.
  - `cost_usd` number, required: Cost charged for this request in USD.
  - `usage_count` integer, required: Billable usage units for this request.
  - `service` string, required: Pricing service used for the charge.
  - `currency` string, required: Currency of `cost_usd`.

## Other responses

- `400`: Invalid JSON body
- `401`: Unauthorized
- `422`: Validation Error
- `429`: Too Many Requests
- `500`: Internal Server Error
- `503`: Search unavailable

---

[API](https://skmtc.dev/desearch/apis/desearch-api.md) · [All operations](https://skmtc.dev/desearch/apis/desearch-api/llms.txt) · [OpenAPI document](https://skmtc.dev/desearch/apis/desearch-api/revisions/c2d7648859bd?raw)
