﻿> ## 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: keen_<your_key>"
  ```

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

  r = requests.get(
      "https://api.keenable.ai/v1/fetch",
      headers={"X-API-Key": "keen_<your_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": "keen_<your_key>" } },
  );
  const { content } = await r.json();
  ```
</CodeGroup>

<Warning>
  By default, only URLs that Keenable indexes are supported, and attempting to fetch a document that is not indexed results in an error. Pass `live=true` to fetch directly from the source, including URLs that are not indexed.
</Warning>

## Request

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

<ParamField query="max_chars" type="integer" default="50000">
  Maximum number of characters of content to return. Longer content is truncated.
</ParamField>

<ParamField query="live" type="boolean" default="false">
  Fetch the page live from the source instead of returning Keenable's indexed copy. Enables fetching URLs that are not indexed.
</ParamField>

<ParamField query="prompt" type="string">
  Optional extraction instruction, at most 2000 characters. When set, an LLM reads the fetched page and `content` contains only the output for this instruction instead of the full page. Example: `List all pricing tiers with their monthly prices`.
</ParamField>

## Response

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

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

<ResponseField name="description" type="string">
  Short summary of the page (if available).
</ResponseField>

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

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

<ResponseField name="published_at" type="integer">
  Publication time as a Unix timestamp in seconds (if available).
</ResponseField>

### Example

```json theme={null}
{
  "url": "https://example.com/ts-best-practices",
  "title": "TypeScript Best Practices 2026",
  "description": "A comprehensive guide to modern TypeScript patterns and best practices.",
  "author": "Jane Doe",
  "published_at": 1768435200,
  "content": "# TypeScript Best Practices 2026\n\nUse strict mode, prefer interfaces over type aliases for object shapes..."
}
```
