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

# Fetch

> Fetch webpage contents

Retrieve content from a URL in markdown format.

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.keenable.ai/v1/fetch?url=https://example.com/ts-best-practices" \
    -H "X-API-Key: <YOUR_API_KEY>"
  ```

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

  r = requests.get(
      "https://api.keenable.ai/v1/fetch",
      headers={"X-API-Key": "<YOUR_API_KEY>"},
      params={"url": "https://example.com/ts-best-practices"},
  )
  print(r.json()["content"])
  ```

  ```typescript TypeScript theme={null}
  const url = "https://example.com/ts-best-practices";
  const r = await fetch(
    `https://api.keenable.ai/v1/fetch?url=${encodeURIComponent(url)}`,
    { headers: { "X-API-Key": "<YOUR_API_KEY>" } },
  );
  const { content } = await r.json();
  ```
</CodeGroup>

<Warning>
  Only URLs that Keenable indexes are supported in this API. Attempting to fetch a document that is not index results in an error.
</Warning>

## Request

<ParamField query="url" type="string" required>
  URL to fetch.
</ParamField>

## Response

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

<ResponseField name="title" type="string">
  Page title (if available).
</ResponseField>

<ResponseField name="content" type="string">
  Extracted page content in markdown.
</ResponseField>

### Example

```json theme={null}
{
  "url": "https://example.com/ts-best-practices",
  "title": "TypeScript Best Practices 2026",
  "content": "# TypeScript Best Practices 2026\n\nUse strict mode, prefer interfaces over type aliases for object shapes..."
}
```
