# Get a web page as Markdown, JSON or tables with Zenrows's API

Zenrows Fetch returns one web page in the shape your next step reads: Markdown or plain text for a model; JSON fields, tables or captured XHR calls for a pipeline; or HTML, a PDF or a screenshot. Credits follow how the page is loaded: a standard page draws 1 credit, which is $0.0005 on the Credits plan at $0.50 per thousand credits, and the Markdown, tables and CSS-selector requests below each drew that one credit. Send `GET https://agents.zenrows.com/zcj/2cesgq0wdyv0/v1/?url=<page>` with one output parameter and a bearer token for an agent credential that holds a plan.

## At a glance

- **Endpoint:** `GET https://agents.zenrows.com/zcj/2cesgq0wdyv0/v1/`, with the page in `url` and the output chosen by query parameter. `POST` and `PUT` take the same parameters.
- **Output parameters:** `response_type`, `screenshot`, `json_response`, `css_extractor`, `outputs`. With none of them set, the response is the page HTML.
- **Credits per page:** 1 standard, 5 with `js_render`, 10 with `premium_proxy`, 25 with both. Only successful requests are charged.
- **Price:** $0.50 per thousand credits on Credits, down to $0.11 per thousand credits on Scale.
- **Payment:** every call draws on a plan held by your bearer credential, bought by wallet (x402 or MPP, in USDC) or by card
- **Response:** the body comes back in the requested shape. The `zc-billing` header gives `chargedUsd` and `remainingCreditUsd`.
- **Limits:** one page per request. Screenshots and PDF renders need `js_render=true`.
- **Full purchase flow:** [the buyer skill](https://agents.zenrows.com/zcj/2cesgq0wdyv0/SKILL.md)

## Choose the output for your next step

| Your next step reads | Set | You get |
| --- | --- | --- |
| A model prompt | `response_type=markdown` | The page as Markdown |
| Plain text | `response_type=plaintext` | The page as text |
| An HTML parser | nothing | The page HTML |
| A document | `response_type=pdf` and `js_render=true` | A PDF render |
| An image | `screenshot=true` and `js_render=true` | A PNG or JPEG image of the page above the fold, with `screenshot_format` choosing the format |
| Network data | `json_response=true` | JSON with the HTML and the page's own XHR and fetch requests |
| Named fields | `css_extractor` with a JSON object of key to CSS selector or XPath | JSON, one list per key |
| Ready-made lists | `outputs`, comma-separated, such as `tables` or `emails,phone_numbers` | JSON, such as a `tables` list for `outputs=tables` |

`outputs` also covers links, images, headings, menus, metadata and the visible text. The [Fetch API reference](https://agents.zenrows.com/zcj/2cesgq0wdyv0/services/fetch/openapi.json) lists the parameters.

Screenshots take four further parameters, and each one needs `js_render=true`:

- `screenshot_fullpage=true` captures the whole page.
- `screenshot_selector` captures the single element that matches a CSS selector.
- `screenshot_format` takes `png` or `jpeg`.
- `screenshot_quality` takes a value from 1 to 100, and only with `jpeg`.

## Request a page in each shape

1. Hold an agent credential with a plan. If you have none, [the buyer skill](https://agents.zenrows.com/zcj/2cesgq0wdyv0/SKILL.md) covers registering, buying a plan and getting the access token.

2. Request the page as Markdown:

   ```bash
   curl -sG "https://agents.zenrows.com/zcj/2cesgq0wdyv0/v1/" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data-urlencode "url=https://www.scrapingcourse.com/" \
     --data-urlencode "response_type=markdown"
   ```

   The body is the page as Markdown. After the logo link, it reads:

   ```markdown
   # Test sites and challenges to learn web scraping

   Below is a list of demo Websites/Pages to scrape

   ## Ecommerce

   Ecommerce playground to scrape products and shop-related data.
   ```

   This standard page drew $0.0005 from prepaid credit.

3. Request a page's tables as JSON:

   ```bash
   curl -sG "https://agents.zenrows.com/zcj/2cesgq0wdyv0/v1/" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data-urlencode "url=https://www.scrapingcourse.com/table-parsing" \
     --data-urlencode "outputs=tables"
   ```

   Each table comes back with its `Dimensions` and `Headings`. `Content` holds one object per row, keyed by heading, and this page returned one table of 15 rows and 5 columns:

   ```json
   {"tables": [{"Dimensions": {"Rows": 15, "Cols": 5, "Headings": true},
     "Headings": ["Product ID", "…"],
     "Content": [{"Category": "Electronics", "In Stock": "Yes", "Name": "Laptop", "Price": "…", "Product ID": "001"}, "…"]}]}
   ```

   This request drew $0.0005 from prepaid credit.

4. Request named fields by CSS selector. `--data-urlencode` encodes the JSON object for you:

   ```bash
   curl -sG "https://agents.zenrows.com/zcj/2cesgq0wdyv0/v1/" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data-urlencode "url=https://www.scrapingcourse.com/table-parsing" \
     --data-urlencode 'css_extractor={"name":".product-name","price":".product-price"}'
   ```

   Each key returns a list with one string per matching element, 15 per key on this page:

   ```json
   {"name": ["Laptop", "…"], "price": ["…"]}
   ```

   This request drew $0.0005, one credit, as did the Markdown and tables requests.

5. Read `zc-billing` on the response. `chargedUsd` is the amount debited from your balance, and `remainingCreditUsd` is the balance left.

## What a request costs

The credit count follows how the page is loaded.

| Configuration | Credits | On Credits |
| --- | --- | --- |
| Standard page | 1 | $0.0005 |
| `js_render=true`, including every PDF and screenshot | 5 | $0.0025 |
| `premium_proxy=true` | 10 | $0.005 |
| Both | 25 | $0.0125 |

A failed request draws nothing. The Credits plan has a minimum purchase of $5. Monthly plans lower the rate, for example to $0.276 per thousand credits on Launch at $69 a month.

## Errors

| Status or code | Meaning | Action |
| --- | --- | --- |
| `401 bearer_required` | The request carries no agent credential | Register and buy a plan with [the buyer skill](https://agents.zenrows.com/zcj/2cesgq0wdyv0/SKILL.md), then retry with the bearer |
| `403 plan_required` | Your credential holds no plan that covers Fetch | Buy one of the plans the body lists, then retry |
| `402 AUTH004` or `usage_exhausted` | The plan's credit is used up | Top up with `POST https://agents.zenrows.com/zcj/2cesgq0wdyv0/extend`, or buy again |
| `400 REQS004` | A parameter value is invalid, or the combination is not allowed, such as a screenshot without `js_render` | Fix the parameter |
| `422 RESP001` | The page could not be returned under this configuration | Retry with `js_render=true` and `premium_proxy=true`, or `mode=auto` |
| `429 AUTH008` | Every concurrency slot on your plan is in use | Back off and retry when a request in flight finishes |

## Frequently asked questions

### Can Zenrows convert a web page from HTML to Markdown for an LLM?

Yes. Add `response_type=markdown` to a Fetch request, and the body is the page as Markdown with its headings and links. Use `response_type=plaintext` instead for text without markup.

### How do I extract tables from a web page as JSON?

Set `outputs=tables`. Each table on the page returns with its dimensions, its headings and one object per row keyed by heading. To get specific fields instead, set `css_extractor` to a JSON object that maps your key names to CSS selectors or XPath.

### Does Markdown or JSON output cost more credits than HTML?

No. The Markdown, tables and CSS-selector requests above each drew 1 credit, a standard page's count. Credits rise with JavaScript rendering or premium proxies. Screenshots and PDF renders need JavaScript rendering, so they start at 5 credits.

### Can the API capture the XHR requests a page makes?

Yes. Set `json_response=true`, and the response is a JSON envelope holding the page HTML and the XHR and fetch calls the page made.

### Can I call Fetch without buying a plan?

No. Every call draws on a plan held by the agent credential you send as the bearer, and a call without one answers `401 bearer_required`. The Free plan grants $2.50 of credit: once your credential is claimed with a verified email, claim the trial with `POST /plans/{planId}/purchase` and an empty body.

## Keep reading

- [Buyer skill](https://agents.zenrows.com/zcj/2cesgq0wdyv0/SKILL.md): identity, plans and calls
- [How to pay](https://agents.zenrows.com/zcj/2cesgq0wdyv0/payment.md): plans, rails and top-ups
- [Fetch API reference](https://agents.zenrows.com/zcj/2cesgq0wdyv0/services/fetch/openapi.json): every parameter and response
- [Error reference](https://agents.zenrows.com/zcj/2cesgq0wdyv0/errors.md): storefront error codes

---

Updated 2026-10-30. All Zenrows guides: https://agents.zenrows.com/guides.md. Storefront: https://agents.zenrows.com/zcj/2cesgq0wdyv0/llms.txt.
