> ## 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 returns any web page as clean markdown, or only the part you ask for with a prompt. Sample code, cost per call, key parameters and gotchas.

Fetch returns a web page as clean markdown, with navigation and boilerplate stripped.

## Fetch a page

This sample fetches one page without a key and prints its title and the first 300 characters of its content:

```python Python theme={"system"}
from keenable import Keenable

client = Keenable()  # keyless: no API key needed to try it
page = client.fetch("https://keenable.ai")
print(page.title)
print(page.content[:300])
```

```typescript TypeScript theme={"system"}
import { Keenable } from "keenable";

async function main() {
  const client = new Keenable(); // keyless: no API key needed to try it
  const page = await client.fetch("https://keenable.ai");
  console.log(page.title);
  console.log(page.content.slice(0, 300));
}

main();
```

```go Go theme={"system"}
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/keenableai/keenable-sdk/go"
)

func main() {
	client, err := keenable.New(nil) // keyless: no API key needed to try it
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	page, err := client.Fetch(context.Background(), "https://keenable.ai")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(page.Title)

	content := []rune(page.Content)
	if len(content) > 300 {
		content = content[:300]
	}
	fmt.Println(string(content))
}
```

```bash curl theme={"system"}
curl "https://api.keenable.ai/v1/fetch/public?url=https://keenable.ai" \
  -H "X-Keenable-Title: My App"
```

You see the page title, then the start of the page as markdown:

```text Example output · results vary theme={"system"}
Keenable.ai — Independent Web Search API for AI
[Keenable raises $26M from Accel and Conviction. Techcrunch](https://techcrunch.com/2026/08/25/accel-backed-keenable-is-indexing-the-web-for-ai-agents/)

[Pricing](https://keenable.ai/pricing)

[About](https://keenable.ai/about)
…
```

## Cost

Each fetch is billed by where the page came from. Keyless calls cost no credits. [Rate limits](https://docs.keenable.ai/rate-limits.md) cap them instead.

| Request | What you get | SKU |
| - | - | - |
| Default | Keenable's indexed copy of the page | `fetch` |
| `live=true` | The page fetched live from the source | `fetch.live` |

Prices are per organization. Read what a call cost from the `usage` object in the response. See [Credits](https://docs.keenable.ai/credits.md#what-a-call-costs) for the allowance and how usage is reported.

## Key parameters

| Parameter | What it does | Example |
| - | - | - |
| `url` | The URL to fetch. Required. | `"https://keenable.ai"` |
| `max_chars` | Maximum characters of content to return. Longer content is truncated. Defaults to 50000. | `10000` |
| `live` | Fetches the page live from the source instead of the indexed copy. Use it for URLs that are not indexed. Defaults to `false`. | `true` |
| `prompt` | An extraction instruction of at most 2000 characters. An LLM reads the page and `content` holds only its answer. | `"List all pricing tiers with their monthly prices"` |

This request fetches a page live and returns only the answer to a prompt. It calls the HTTP API directly, because SDK 0.1.x does not send `live`, `prompt` or `max_chars` yet.

```bash curl theme={"system"}
curl -G "https://api.keenable.ai/v1/fetch/public" \
  -H "X-Keenable-Title: Keenable docs" \
  --data-urlencode "url=https://example.com" \
  --data-urlencode "live=true" \
  --data-urlencode "prompt=Summarize this page in one sentence"
```

```python Python theme={"system"}
import requests

r = requests.get(
    "https://api.keenable.ai/v1/fetch/public",
    headers={"X-Keenable-Title": "Keenable docs"},
    params={
        "url": "https://example.com",
        "live": "true",
        "prompt": "Summarize this page in one sentence",
    },
)
print(r.json()["content"])
```

```typescript TypeScript theme={"system"}
const params = new URLSearchParams({
  url: "https://example.com",
  live: "true",
  prompt: "Summarize this page in one sentence",
});
const r = await fetch(`https://api.keenable.ai/v1/fetch/public?${params}`, {
  headers: { "X-Keenable-Title": "Keenable docs" },
});
const { content } = await r.json();
console.log(content);
```

```go Go theme={"system"}
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"net/url"
)

func main() {
	params := url.Values{}
	params.Set("url", "https://example.com")
	params.Set("live", "true")
	params.Set("prompt", "Summarize this page in one sentence")

	req, err := http.NewRequest("GET", "https://api.keenable.ai/v1/fetch/public?"+params.Encode(), nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("X-Keenable-Title", "Keenable docs")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	var page struct {
		Content string `json:"content"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&page); err != nil {
		log.Fatal(err)
	}
	fmt.Println(page.Content)
}
```

`content` holds one sentence instead of the full page:

```json Example output · results vary theme={"system"}
{
  "url": "https://example.com/",
  "title": "Example Domain",
  "content": "This domain is designated strictly for use in documentation examples without requiring permission, and should not be used as a service for testing or monitoring purposes.",
  "description": ""
}
```

## Gotchas

> [!WARNING]
>
> By default, Fetch returns only pages that Keenable has indexed. If the page isn't indexed, the API returns an error. To fetch it from the source, pass `live=true`. A live fetch is billed as `fetch.live`.

Over raw HTTP, `published_at` is Unix seconds on Fetch but an ISO 8601 string on [Search](https://docs.keenable.ai/products/search.md). Parse the two differently if your code reads both responses.

## Next steps

* [Fetch API reference](https://docs.keenable.ai/api-reference/fetch.md): every request parameter and response field.
* [Search](https://docs.keenable.ai/products/search.md): find the pages to fetch.
* [SDKs](https://docs.keenable.ai/sdks.md): install the Python, TypeScript or Go client.
* [Errors](https://docs.keenable.ai/errors.md): what each status code means and how to fix it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.