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

> ## Agent Instructions
> The Zenrows HTTP API serves Fetch and Extract (extract=auto) at https://api.zenrows.com/v1/, Crawl at https://api.zenrows.com/v1/crawls, and Batch at https://async.api.zenrows.com/v1. Fetch, Extract, Crawl and Batch are described in OpenAPI 3.1 at https://www.zenrows.com/openapi.json and listed in the RFC 9727 API catalog at https://www.zenrows.com/.well-known/api-catalog. Every endpoint also has its own page under /api-reference with its schema. Use the spec for exact parameter names and types. Crawl's endpoints, parameters and errors are also at https://docs.zenrows.com/crawl/endpoints.md. To call Zenrows from an agent, connect the MCP server at https://mcp.zenrows.com/mcp. To search these docs from an agent, connect the docs MCP server at https://docs.zenrows.com/mcp. Agent skills for Zenrows are published at https://github.com/ZenRows/cli and install with `npx skills add ZenRows/cli`.

# Get structured JSON from any page

> Turn product, listing and article pages into clean JSON with Zenrows Extract, and keep only the fields you need.

Add `extract=auto` to a Fetch request and Zenrows returns the page's data as JSON: names, prices, availability, images, breadcrumbs and more, with no selectors to write or maintain. Reach for it whenever you want fields, not HTML.

**Uses:** [Extract](https://docs.zenrows.com/extract/setup.md) (`extract=auto`, [`extract_fields`](https://docs.zenrows.com/extract/setup#selecting-the-fields-you-need)), the [Extract endpoints](https://docs.zenrows.com/extract/endpoints.md) and [Adaptive Stealth Mode](https://docs.zenrows.com/fetch/features/adaptive-stealth-mode.md) (`mode=auto`)

## Ask your AI agent

With the [Zenrows MCP server](https://docs.zenrows.com/mcp/overview.md) connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.

```text theme={"theme":"css-variables"}
Use Zenrows to get every product on https://www.scrapingcourse.com/ecommerce/ as JSON
with name, price and URL, plus how many products the store has in total.
```

## Extract a page as JSON

Set `extract=auto` and pair it with `mode=auto`, so Zenrows renders JavaScript and switches to premium proxies when the page needs them. The response is JSON with two fields: `parsed` holds the structured data, `html` holds the raw page for validation.

```python Python (Requests) theme={"theme":"css-variables"}
import json
import requests

params = {
    "apikey": "YOUR_ZENROWS_API_KEY",
    "url": "https://www.scrapingcourse.com/ecommerce/",
    "mode": "auto",
    "extract": "auto",
}

response = requests.get("https://api.zenrows.com/v1/", params=params, timeout=180)
response.raise_for_status()

data = response.json()
print(json.dumps(data["parsed"], indent=2))
```

```javascript Node.js theme={"theme":"css-variables"}
const params = new URLSearchParams({
  apikey: "YOUR_ZENROWS_API_KEY",
  url: "https://www.scrapingcourse.com/ecommerce/",
  mode: "auto",
  extract: "auto",
});

const response = await fetch(`https://api.zenrows.com/v1/?${params}`, {
  signal: AbortSignal.timeout(180_000),
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);

const { parsed } = await response.json();
console.log(JSON.stringify(parsed, null, 2));
```

```bash cURL theme={"theme":"css-variables"}
curl "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&mode=auto&extract=auto"
```

```bash CLI theme={"theme":"css-variables"}
zenrows extract https://www.scrapingcourse.com/ecommerce/
```

The CLI prints `parsed` directly. Its `zenrows extract` command sends `extract=auto` with `mode=auto` by default. When a domain isn't prepared yet, it fails with `EXTRACT_DOMAIN_NOT_PREPARED` and prints the `zenrows extract prepare` command to run. It never falls back to `autoparse`. See the [CLI guide](https://docs.zenrows.com/cli/extract/introduction.md).

## Example output

The `parsed` field for the catalog page, trimmed to two products:

```json theme={"theme":"css-variables"}
{
  "page_context": {
    "current_page": 1,
    "results_per_page": 69,
    "total_pages": 12,
    "total_results": 188
  },
  "products": [
    {
      "availability": "in_stock",
      "currency": "USD",
      "image_url": "https://www.scrapingcourse.com/ecommerce/wp-content/uploads/2024/03/mh09-blue_main.jpg",
      "name": "Abominable Hoodie",
      "price": 69,
      "product_id": "246",
      "product_type": "variable",
      "product_url": "https://www.scrapingcourse.com/ecommerce/product/abominable-hoodie/",
      "sku": "MH09"
    },
    {
      "availability": null,
      "currency": "USD",
      "image_url": "https://www.scrapingcourse.com/ecommerce/wp-content/uploads/2024/03/wj08-gray_main.jpg",
      "name": "Adrienne Trek Jacket",
      "price": 57,
      "product_id": "1864",
      "product_type": "variable",
      "product_url": "https://www.scrapingcourse.com/ecommerce/product/adrienne-trek-jacket/",
      "sku": "WJ08"
    }
  ]
}
```

A field the page leaves empty comes back as `null`. Field names follow what each website exposes and stay stable for that website. New fields arrive as extraction grows, so read the fields you use and let the rest pass through.

## Keep just the fields you need

Add `extract_fields` with a comma-separated list. A bare name (`products`) keeps a whole group, and a dot path (`products.price`) keeps one field inside a group, on every element of a list. Run one request without it first to read the field names the page offers.

```python Python (Requests) theme={"theme":"css-variables"}
import requests

params = {
    "apikey": "YOUR_ZENROWS_API_KEY",
    "url": "https://www.scrapingcourse.com/ecommerce/",
    "mode": "auto",
    "extract": "auto",
    "extract_fields": "products.name,products.price,products.availability,page_context.total_results",
}

response = requests.get("https://api.zenrows.com/v1/", params=params, timeout=180)
response.raise_for_status()
print(response.json()["parsed"])
```

```javascript Node.js theme={"theme":"css-variables"}
const params = new URLSearchParams({
  apikey: "YOUR_ZENROWS_API_KEY",
  url: "https://www.scrapingcourse.com/ecommerce/",
  mode: "auto",
  extract: "auto",
  extract_fields: "products.name,products.price,products.availability,page_context.total_results",
});

const response = await fetch(`https://api.zenrows.com/v1/?${params}`, {
  signal: AbortSignal.timeout(180_000),
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);

const { parsed } = await response.json();
console.log(JSON.stringify(parsed, null, 2));
```

```bash cURL theme={"theme":"css-variables"}
curl "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&mode=auto&extract=auto&extract_fields=products.name%2Cproducts.price"
```

```json Output (trimmed) theme={"theme":"css-variables"}
{
  "page_context": { "total_results": 188 },
  "products": [
    { "availability": "in_stock", "name": "Abominable Hoodie", "price": 69 },
    { "availability": null, "name": "Adrienne Trek Jacket", "price": 57 },
    { "availability": null, "name": "Aeon Capri", "price": 48 }
  ]
}
```

## Extract a page from a major store

The same request works on the hundreds of domains Zenrows has prepared, including Amazon, Walmart, eBay, Best Buy, Zillow and Booking.com. This Walmart product page returns pricing, fulfillment, features and media:

```bash cURL theme={"theme":"css-variables"}
curl "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.walmart.com%2Fip%2FAirPods-Pro-3%2F17835006350&mode=auto&extract=auto"
```

```json Output (parsed, trimmed) theme={"theme":"css-variables"}
{
  "product": {
    "brand": "Apple",
    "name": "Apple AirPods Pro 3",
    "item_id": "17835006350",
    "canonical_url": "https://www.walmart.com/ip/AirPods-Pro-3/17835006350"
  },
  "pricing": {
    "currency": "USD",
    "current_price": 199,
    "original_price": 249,
    "savings_amount": 50,
    "price_qualifier": "Price when purchased online"
  },
  "fulfillment": {
    "pickup_available": true,
    "shipping_available": true,
    "shipping_cost": "Free",
    "shipping_arrival_label": "Arrives tomorrow",
    "sold_by": "Walmart.com"
  },
  "ratings_summary": { "average_rating": 4.4 }
}
```

## Check a domain before you send traffic

`GET /v1/extract/domains` lists every domain Extract serves right now. It's free, so check it before you send traffic to a new site:

```python Python (Requests) theme={"theme":"css-variables"}
import requests

response = requests.get(
    "https://api.zenrows.com/v1/extract/domains",
    headers={"X-API-Key": "YOUR_ZENROWS_API_KEY"},
    timeout=30,
)
response.raise_for_status()

covered = {entry["domain"]: entry["verticals"] for entry in response.json()["domains"]}
for domain in ["walmart.com", "zillow.com", "example-shop.com"]:
    print(domain, "->", "ready" if domain in covered else "prepare it")
```

```text Output theme={"theme":"css-variables"}
walmart.com -> ready
zillow.com -> ready
example-shop.com -> prepare it
```

## Prepare a new domain

For a domain that isn't on the list yet, ask Zenrows to prepare it. Send 1 to 5 example URLs. One works; we recommend 3 or more of the same page type (e.g. 3 product pages), because Extract compares pages of one type to check the fields it found and fill in fields one page is missing. Several page types can share the 5 (e.g. 3 product pages + 2 search-result pages). Then poll until `status` is `ready`. Preparation usually takes minutes, and every Zenrows API key can use the domain once it's ready.

```python Python (Requests) theme={"theme":"css-variables"}
import time
import requests

headers = {"X-API-Key": "YOUR_ZENROWS_API_KEY"}
base = "https://api.zenrows.com/v1/extract/prepared-domains"

# 1. Ask for the domain
response = requests.post(
    base,
    headers=headers,
    json={
        "domain": "example-shop.com",
        "example_urls": [
            "https://www.example-shop.com/product/blue-shirt",
            "https://www.example-shop.com/product/red-shirt",
            "https://www.example-shop.com/product/green-shirt",
        ],
    },
    timeout=30,
)
print(response.status_code, response.json()["state"])  # 202 received

# 2. Poll until it is ready
while True:
    body = requests.get(f"{base}/example-shop.com", headers=headers, timeout=30).json()
    if body["status"] != "preparing":
        break
    time.sleep(30)

print(body["status"])  # ready, or failed with a failure block that says what to do
```

Branch on `status`: `preparing`, `ready` or `failed`. A failed preparation carries `failure.code`, and the [endpoint reference](https://docs.zenrows.com/extract/endpoints.md#when-a-preparation-fails) maps each code to the next step.

## Use the Zenrows SDKs

Both SDKs have an `extract()` method that sends `extract=auto` plus `mode=auto` for you. Pass `extract_fields` like any other parameter. When Extract refuses the page, `extract()` returns the `REQS007` response and never retries with `autoparse`. The `fallback_to_autoparse` (Python) and `fallbackToAutoparse` (Node.js) options are deprecated and have no effect. Read the response's `reason`: on `domain_not_prepared`, [prepare the domain](#prepare-a-new-domain) and retry once it reads `ready`. See [Troubleshooting](#troubleshooting) for the other reasons.

```python Python (SDK) theme={"theme":"css-variables"}
# pip install zenrows
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")

response = client.extract(
    "https://www.scrapingcourse.com/ecommerce/",
    params={"extract_fields": "products.name,products.price"},
    timeout=180,
)
response.raise_for_status()
print(response.json()["parsed"])
```

```javascript Node.js (SDK) theme={"theme":"css-variables"}
// npm install zenrows
import { ZenRows } from "zenrows";

const client = new ZenRows("YOUR_ZENROWS_API_KEY");

const response = await client.extract(
  "https://www.scrapingcourse.com/ecommerce/",
  { extract_fields: "products.name,products.price" },
);
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);

const { parsed } = await response.json();
console.log(parsed);
```

```text Output (trimmed) theme={"theme":"css-variables"}
{'products': [{'name': 'Abominable Hoodie', 'price': 69}, {'name': 'Adrienne Trek Jacket', 'price': 57}, {'name': 'Aeon Capri', 'price': 48}, ...]}
```

## Customize it

| Change | How |
| - | - |
| The same field names across websites (real estate) | `extract=standard`, see [Extraction modes](https://docs.zenrows.com/extract/setup.md#extraction-modes) and [Extract real estate listings](https://docs.zenrows.com/academy/extract-property-data.md) |
| Content from a specific country | Add `proxy_country=us` (any ISO code), see [Proxy country](https://docs.zenrows.com/fetch/features/proxy-country.md) |
| Data that loads late | Use `js_render=true` with `wait=3000` instead of `mode=auto`, see [Combining with other features](https://docs.zenrows.com/extract/setup.md#combining-with-other-features) |
| Fields you define with selectors | Use `css_extractor`, see [Extract data with CSS selectors](https://docs.zenrows.com/academy/how-to-extract-data.md) |
| Thousands of pages | Put `"extract": "auto"` in a Batch job's `zenrows_params`, see [Scrape a list of URLs](https://docs.zenrows.com/academy/scrape-from-a-list-of-urls.md) |

## Troubleshooting

* **`403` with `REQS007`**: Extract refused the page, and the request isn't charged. The response's `reason` says why. Until the API sends `reason`, tell the cases apart by the `title`; see [REQS007](https://docs.zenrows.com/api-error-codes.md#REQS007).
  * `domain_not_prepared`: the domain isn't prepared yet. [Prepare the domain](#prepare-a-new-domain) with that URL in `example_urls` (we recommend 3 or more of the same page type, so add 2 more when you can), then retry once it reads `ready`.
  * `page_not_recognised`: the domain is prepared, but this page may have nothing to extract, such as a home page. Try a product, article or listing page instead, or retry once in a few minutes. Preparing again does not change it.
  * `domain_not_enabled`: Extract is not enabled for this site, and preparing does not help. Use `css_extractor`.
* **`400` with `REQS004` naming `extract_fields`**: none of the names you asked for exist on this page. The error lists the fields the page offers; copy names from there, or omit `extract_fields`.
* **`422` with `no_data_extracted`**: Extract knows the page type, and the fields came back empty, usually because the page hadn't finished loading. The request isn't charged. Retry with `js_render=true&wait=3000` (and `premium_proxy=true` for protected sites), or drop `extract_fields` to see every field.
* **A preparation ends `failed` with `unpreparable`**: the example URLs returned no usable HTML. Send other example URLs from the same site.
* **The request takes long to return**: set your HTTP client timeout to 180 seconds or more so `mode=auto` has time to escalate.

## Related recipes

> [card] [Extract real estate listings and property data](https://docs.zenrows.com/academy/extract-property-data.md)
>
> One schema for Zillow, Redfin and Idealista, from search to every listing.

> [card] [Extract data with CSS selectors](https://docs.zenrows.com/academy/how-to-extract-data.md)
>
> Pick exact elements with css\_extractor, or parse the HTML yourself.

> [card] [Scrape a list of URLs](https://docs.zenrows.com/academy/scrape-from-a-list-of-urls.md)
>
> Run Extract on thousands of pages as one Batch job.

> [card] [Turn any web page into LLM-ready markdown](https://docs.zenrows.com/academy/fetch/markdown-for-llms.md)
>
> Get the whole page as clean markdown instead of fields.


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