# Fetch and scrape

> A page or a PDF comes back as markdown, with page markers and ruled tables. Pass a question and you get only the passages that answer it, each with its heading and offset.

Canonical page: https://clawifi.dev/docs/fetch

## Recorded response

**Response (recorded playground run, trimmed)**

```json
{
  "url": "https://docs.python.org/3/library/asyncio.html",
  "title": "asyncio — Asynchronous I/O — Python 3.15.0 documentation",
  "markdown": "# `asyncio` — Asynchronous I/O[¶](#module-asyncio)\n\nasyncio is a library to write **concurrent** code using\nthe **async/await** syntax.\n\nasyncio is used as a foundation for multiple Python asynchronous frameworks that provide high-performan…"
}
```

## POST /fetch

Fetch Url. Full parameters on the [endpoint page](https://clawifi.dev/docs/api/post-fetch).

**cURL**

```sh
curl -X POST https://api.clawifi.dev/fetch \
  -H "Authorization: Bearer $CLAWIFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

**Python**

```python
from clawifi import Clawifi

client = Clawifi()  # reads CLAWIFI_API_KEY
result = client.fetch("https://example.com")
```

**MCP**

```text
fetch_url(url="https://example.com")
```

## POST /scrape

Scrape Url. Full parameters on the [endpoint page](https://clawifi.dev/docs/api/post-scrape).

**cURL**

```sh
curl -X POST https://api.clawifi.dev/scrape \
  -H "Authorization: Bearer $CLAWIFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

**Python**

```python
from clawifi import Clawifi

client = Clawifi()  # reads CLAWIFI_API_KEY
result = client.scrape("https://example.com")
```

**MCP**

```text
scrape_url(url="https://example.com")
```

## POST /extract

Extract Url. Full parameters on the [endpoint page](https://clawifi.dev/docs/api/post-extract).

**cURL**

```sh
curl -X POST https://api.clawifi.dev/extract \
  -H "Authorization: Bearer $CLAWIFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

**Python**

```python
from clawifi import Clawifi

client = Clawifi()  # reads CLAWIFI_API_KEY
result = client.extract("https://example.com")
```

**MCP**

```text
extract_url(url="https://example.com")
```
