> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Search the web and return ranked results

Search the web and return ranked results with URLs, titles, and descriptions.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://api.keenable.ai/v1/search" \
    -H "X-API-Key: <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{ "query": "typescript best practices" }'
  ```

  ```python Python theme={null}
  import requests

  r = requests.post(
      "https://api.keenable.ai/v1/search",
      headers={"X-API-Key": "<YOUR_API_KEY>"},
      json={"query": "typescript best practices"},
  )
  for hit in r.json()["results"]:
      print(hit["title"], hit["url"])
  ```

  ```typescript TypeScript theme={null}
  const r = await fetch("https://api.keenable.ai/v1/search", {
    method: "POST",
    headers: {
      "X-API-Key": "<YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query: "typescript best practices" }),
  });
  const { results } = await r.json();
  ```
</CodeGroup>

## Request

<ParamField body="query" type="string" required>
  The search query.
</ParamField>

## Response

<ResponseField name="results" type="array">
  List of search results.

  <Expandable title="result">
    <ResponseField name="title" type="string">
      Page title.
    </ResponseField>

    <ResponseField name="url" type="string">
      Page URL.
    </ResponseField>

    <ResponseField name="description" type="string">
      Snippet or summary of the page.
    </ResponseField>
  </Expandable>
</ResponseField>

### Example

```json theme={null}
{
  "results": [
    {
      "title": "TypeScript Best Practices 2026",
      "url": "https://example.com/ts-best-practices",
      "description": "A comprehensive guide to modern TypeScript patterns and best practices."
    }
  ]
}
```
