# Overview

Live Web Data API turns any public URL into clean Markdown, text or HTML — fetched live through our fetch network.

## What it does

You send up to 10 URLs (and optionally a country). We fetch each page through a residential or mobile connection, extract the main content and return it in the format your agent or pipeline needs. A standard page costs 1 credit, a retried or rendered page more (see [Credits](https://livewebdata.com/docs/api-reference#credits)); failures cost nothing.

| | Value |
| --- | --- |
| Base URL | `https://livewebdata.com/api` |
| Endpoints | `POST /v1/contents`, `GET /v1/account` |
| Formats | markdown and text by default; html with `html: true` |
| OpenAPI | [`/openapi.json`](https://livewebdata.com/openapi.json) · [`/openapi.yaml`](https://livewebdata.com/openapi.yaml) |
| Fetch strategy (v1) | static fetch (`fast`), a retry through another connection (`retry`), or a real browser (`browser`): the browser fallback is on by default (`renderFallback: false` turns it off), `render: true` renders every URL |

## Authentication

Create a key in the dashboard under [API keys](https://livewebdata.com/dashboard/keys) and send it as a bearer token. Keys start with `1337_live_` (test keys with `1337_test_`) and are shown only once. Keep them in an environment variable such as `LIVE_WEB_DATA_API_KEY` — never in client-side code or repositories.

```bash title="Headers"
Authorization: Bearer 1337_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
```

## Quickstart

Fetch a page as Markdown:

```bash title="cURL"
curl -X POST https://livewebdata.com/api/v1/contents \
  -H "Authorization: Bearer $LIVE_WEB_DATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://en.wikipedia.org/wiki/Web_scraping"]}'
```

The response contains one entry in `results` per successful page and one entry in `statuses` per requested URL. The page HTML is included only when you send `"html": true`:

```json title="Response (abridged)"
{
  "requestId": "req_01J…",
  "results": [{
    "id": "https://en.wikipedia.org/wiki/Web_scraping",
    "url": "https://en.wikipedia.org/wiki/Web_scraping",
    "title": "Web scraping - Wikipedia",
    "markdown": "# Web scraping - Wikipedia\n\n…",
    "text": "Web scraping - Wikipedia\n\n…"
  }],
  "statuses": [{
    "id": "https://en.wikipedia.org/wiki/Web_scraping",
    "status": "success",
    "source": "livecrawled",
    "fetchedAt": "2026-11-12T09:30:02.118Z",
    "httpStatusCode": 200,
    "strategy": "fast",
    "credits": 1,
    "error": null
  }],
  "searchTime": 1240
}
```

When `text` or `markdown` was cut at `text.maxCharacters`, `results[].textTruncated` is `true`. `results[].warnings` (absent when empty) flags pages that could only be partly retrieved (`PAGE_TRUNCATED`), probably need `render: true` (`THIN_CONTENT`), were converted as plain text (`EXTRACTION_FALLBACK`) or lost their `html` (and maybe part of their text) to the response's 24 MiB size limit (`RESPONSE_SIZE_LIMIT`).

See the [API reference](https://livewebdata.com/docs/api-reference) for every parameter, or try it without code in the dashboard [playground](https://livewebdata.com/dashboard/playground).

## SDKs

Thin, typed clients for JavaScript/TypeScript and Python with built-in retries and typed errors. See [SDKs](https://livewebdata.com/docs/sdks).

```javascript title="JS SDK"
import { Client } from "web-contents";

const client = new Client({
  apiKey: process.env.LIVE_WEB_DATA_API_KEY,
  baseUrl: "https://livewebdata.com/api",
});

const res = await client.contents({
  urls: ["https://en.wikipedia.org/wiki/Web_scraping"]
});
for (const s of res.statuses) console.log(s.id, s.status, s.error?.tag ?? "");
console.log(res.results[0]?.markdown);
```

```python title="Python SDK"
import os
from web_contents import Client

client = Client(
    api_key=os.environ["LIVE_WEB_DATA_API_KEY"],
    base_url="https://livewebdata.com/api",
)

res = client.contents(
    urls=["https://en.wikipedia.org/wiki/Web_scraping"],
)
for s in res["statuses"]:
    print(s["id"], s["status"], (s["error"] or {}).get("tag", ""))
print(res["results"][0]["markdown"] if res["results"] else "")
```

## Live fetching

Every request is fetched live; there is no cache.

## Geotargeting

Set `countryCode` to an ISO-3166-1 alpha-2 code (for example `de`, `jp`, `br`) to fetch the page as seen from that country. The default is `us`.

```bash title="cURL"
curl -X POST https://livewebdata.com/api/v1/contents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "urls": [
    "https://example.com/pricing"
  ],
  "countryCode": "de"
}'
```

```python title="Python"
import requests

response = requests.post(
    "https://livewebdata.com/api/v1/contents",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "urls": ["https://example.com/pricing"],
        "countryCode": "de"
    },
    timeout=60,
)
data = response.json()
print(data["results"][0]["markdown"])
```

```javascript title="JavaScript"
const response = await fetch("https://livewebdata.com/api/v1/contents", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "urls": [
      "https://example.com/pricing"
    ],
    "countryCode": "de"
  }),
});
const data = await response.json();
console.log(data.results[0]?.markdown);
```

## Multiple URLs

Send up to 10 URLs in one request. They are processed in parallel; `statuses` has one entry per URL (matched by `id`) and credits are charged per successful URL. A restricted URL gets a per-URL `RESTRICTED_TARGET` status, and an invalid one (longer than 8,192 characters, malformed or not http/https) a per-URL `INVALID_URL` status, instead of failing the whole request. More than 10 URLs return `400 TOO_MANY_URLS`. Rate limits count URLs, not HTTP requests.

```bash title="cURL"
curl -X POST https://livewebdata.com/api/v1/contents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "urls": [
    "https://example.com/a",
    "https://example.com/b",
    "https://example.com/blocked"
  ]
}'
```

```python title="Python"
import requests

response = requests.post(
    "https://livewebdata.com/api/v1/contents",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "urls": ["https://example.com/a", "https://example.com/b", "https://example.com/blocked"]
    },
    timeout=60,
)
data = response.json()
print(data["results"][0]["markdown"])
```

```javascript title="JavaScript"
const response = await fetch("https://livewebdata.com/api/v1/contents", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "urls": [
      "https://example.com/a",
      "https://example.com/b",
      "https://example.com/blocked"
    ]
  }),
});
const data = await response.json();
console.log(data.results[0]?.markdown);
```

## Restricted targets

Some domain categories are blocked for legal and regulatory reasons. Requests are rejected with `451` and cost no credits. Repeated attempts lead to automatic key suspension. Report abuse to report.abuse@livewebdata.com.

## MCP for agents

Agents can use the API as a tool over MCP with your existing key — two tools, `get_page_contents` and `get_account_status`. Setup for Claude Code, Cursor, VS Code and Claude Desktop: [MCP for agents](https://livewebdata.com/docs/mcp).

## For AI coding agents

Every docs page is also available as plain Markdown by appending `.md` to its URL (e.g. [`/docs/api-reference.md`](https://livewebdata.com/docs/api-reference.md)). An index for LLMs lives at [`/llms.txt`](https://livewebdata.com/llms.txt) and the full docs in one file at [`/llms-full.txt`](https://livewebdata.com/llms-full.txt).
