> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Decodo for AI agents

> Instructions for AI agents and coding assistants: how to use the Decodo Web Data API, which endpoint to call for each task, authentication, and where to find the right docs page.

This file is written for AI agents and coding assistants. If you're a person, see [Web Data API for Agents](https://help.decodo.com/docs/web-data-api-for-agents.md).

## What Decodo does

Decodo's Web Data API gets public web data for you. It handles proxy rotation, JavaScript rendering, CAPTCHAs, and anti-bot protection. Use it when a plain HTTP fetch fails, gets blocked, returns an empty JavaScript shell, or needs a specific country.

* Base URL: `https://data.decodo.com/v1`
* Authentication: `Authorization: Bearer <API_KEY>` on every request
* The user gets an API key from [https://dashboard.decodo.com/web-data/playground](https://dashboard.decodo.com/web-data/playground). A free plan with up to 10K requests per month is at [https://dashboard.decodo.com/register?planId=922406](https://dashboard.decodo.com/register?planId=922406)
* Never invent or hardcode a key. Read it from the `DECODO_API_KEY` environment variable or ask the user.

## Which endpoint to call

| Task | Endpoint | Mode |
| :- | :- | :- |
| Read one page you have the URL for | `POST /scrape` | Synchronous |
| Get parsed data from Google, Amazon, Walmart, or another supported site | `POST /scrape` with a target template | Synchronous, asynchronous, or batch |
| Find pages on a topic | `POST /search` | Synchronous |
| List a site's URLs without reading them | `POST /map` | Synchronous |
| Read many pages from one site (up to 10,000) | `POST /crawl` | Asynchronous: start, poll status, fetch results |

Map a site before you crawl it, then crawl only the paths you need.

## Minimal request

```bash theme={null}
curl --request POST \
  --url https://data.decodo.com/v1/scrape \
  --header "Authorization: Bearer $DECODO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url": "https://ip.decodo.com"}'
```

For request parameters, read the endpoint's docs page before you build the request. Don't guess parameter names.

## Prefer a ready-made tool

If one of these is available in your environment, use it instead of raw HTTP:

* MCP Server: `https://mcp.decodo.com/mcp` (tools include `scrape_as_markdown`, `search`, `map`, `crawl_start`, `crawl_status`, `crawl_results`). Docs: [https://help.decodo.com/docs/mcp.md](https://help.decodo.com/docs/mcp.md)
* CLI: `npx @decodo/cli` or `decodo` (commands `scrape`, `search`, `map`, `crawl`). Use `--format ndjson --full` to parse output. Docs: [https://help.decodo.com/docs/cli.md](https://help.decodo.com/docs/cli.md)
* Python SDK: `pip install decodo-sdk`. Docs: [https://help.decodo.com/docs/python-sdk.md](https://help.decodo.com/docs/python-sdk.md)
* TypeScript SDK. Docs: [https://help.decodo.com/docs/typescript-sdk.md](https://help.decodo.com/docs/typescript-sdk.md)
* Go SDK: `go get github.com/decodo/sdk-go`. Docs: [https://help.decodo.com/docs/go-sdk.md](https://help.decodo.com/docs/go-sdk.md)
* Agent Skills: [https://help.decodo.com/docs/agent-skills.md](https://help.decodo.com/docs/agent-skills.md)

## When a result comes back empty

JavaScript rendering is off by default - `headless` is not set. A JavaScript-heavy page answers a plain fetch with `200` and an empty shell rather than an error, so an empty result is not a failure you can detect from the status code.

If the result is empty, much shorter than expected, or missing the data you were asked for, send the same request again with `"headless": "html"`:

```bash theme={null}
curl --request POST \
  --url https://data.decodo.com/v1/scrape \
  --header "Authorization: Bearer $DECODO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url": "https://example.com", "headless": "html"}'
```

Retry once, not in a loop. If you already know the page renders its content client-side, set `"headless": "html"` on the first request instead - one rendered request costs less than an empty request plus a retry.

On `/crawl` use `"JS_retry": true`, which retries a failed page once with rendering. On `/map` use `"JS_rendering": true`. Docs: [https://help.decodo.com/docs/web-data-api-scrape-javascript-rendering.md](https://help.decodo.com/docs/web-data-api-scrape-javascript-rendering.md)

## Rules

* Only collect publicly accessible data. Don't scrape post-login pages, private user information, or other non-public data.
* `/search`, `/map`, and `/crawl` need a Web Data API key. A basic authentication token from an older plan only works for scraping.
* Requests are billed per successful request. Only `500`, `524` and `613` aren't charged - an empty `200` counts as successful and is billed, so a retry with `headless` costs a second request. Set a `limit` on search, map, and crawl so you don't use more requests than the task needs.
* Ask for Markdown output when the result goes into your context window.
* On an authentication error, tell the user to check their API key. Don't retry in a loop.

## Key docs pages

Every docs page is available as Markdown by adding `.md` to its URL.

* Web Data API introduction: [https://help.decodo.com/docs/web-data-api-introduction.md](https://help.decodo.com/docs/web-data-api-introduction.md)
* /scrape quick start: [https://help.decodo.com/docs/web-data-api-scrape-quick-start.md](https://help.decodo.com/docs/web-data-api-scrape-quick-start.md)
* Target templates: [https://help.decodo.com/docs/web-scraping-api-targets.md](https://help.decodo.com/docs/web-scraping-api-targets.md)
* Response codes: [https://help.decodo.com/docs/web-data-api-response-codes.md](https://help.decodo.com/docs/web-data-api-response-codes.md)
* Billing: [https://help.decodo.com/docs/web-data-api-billing.md](https://help.decodo.com/docs/web-data-api-billing.md)
* Migrating from Web Scraping API: [https://help.decodo.com/docs/web-data-api-migration-guide.md](https://help.decodo.com/docs/web-data-api-migration-guide.md)
* Docs index: [https://help.decodo.com/llms.txt](https://help.decodo.com/llms.txt)
* Full docs in one file: [https://help.decodo.com/llms-full.txt](https://help.decodo.com/llms-full.txt)
* Search the docs live over MCP: `https://help.decodo.com/mcp`


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