# JavaScript Page to Markdown: Render JS Web Pages + Screenshot (`publicrecords/js-page-to-markdown`) Actor

Render JavaScript-heavy web pages (React, Vue, Angular, SPAs) in a real Chromium browser and get clean, LLM-ready Markdown with title, metadata and an optional screenshot. Web fetch for RAG and AI agents. Pay per page.

- **URL**: https://apify.com/publicrecords/js-page-to-markdown.md
- **Developed by:** [Public Records](https://apify.com/publicrecords) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 page rendereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## JavaScript Page to Markdown: Render JS Web Pages + Screenshot

JavaScript Page to Markdown opens each URL in a real Chromium browser, lets the page's JavaScript run, and returns the rendered page as clean Markdown. Each row also has the page title, description, language, canonical URL and a token estimate. Turn on screenshots and you get a PNG or JPEG of every page too.

Use it when a plain HTTP fetch comes back empty: React, Vue, Angular, Svelte and Next.js apps, single-page apps, lazy-loaded lists and pages that fill in their content with AJAX.

### Who it's for

- **AI agent and RAG builders** who need the text a person actually sees on a JavaScript page, as Markdown ready for an LLM.
- **Developers** who want rendered page content without running and patching their own headless browser.
- **Analysts and SEO teams** who want page text, metadata and a screenshot of each page in one run.

### Render JavaScript pages to Markdown

- Renders with Playwright and Chromium, waits for the page to settle, then converts the main content to Markdown (headings, lists, tables, links and image links).
- **Wait for CSS selector** waits for content that loads late, such as `.product-list` or `#results`.
- **Scroll to load more** scrolls down first, so infinite-scroll and lazy-loaded items are included.
- **Content to keep** gives you the main content (menus, headers and footers removed) or the full page. **CSS selector to extract** keeps only the part you want.
- `#fragment` URLs are kept, so hash-routed apps open on the right view.

### Website screenshot with every page

Turn on **Save a screenshot of each page** to save a screenshot of each rendered page to the run's key-value store. Choose the first screen or the full page, PNG or JPEG, desktop or mobile view. Each row links to its file in `screenshotKey` and `screenshotUrl`.

### Web fetch for RAG and AI agents

Every row has `markdown`, `chars`, `tokensEstimate` and `truncated`, so you can budget LLM context before you send anything. No outside AI API is used: the page is rendered and converted inside the Actor.

### Sample input

```json
{
  "urls": ["https://quotes.toscrape.com/js/", "https://react.dev/"],
  "waitForSelector": "",
  "scrollToBottom": false,
  "screenshot": false
}
```

### Sample output

One row per rendered page. This is a real row from the default input (Markdown shortened here):

```json
{
  "url": "https://quotes.toscrape.com/js/",
  "finalUrl": "https://quotes.toscrape.com/js/",
  "statusCode": 200,
  "title": "Quotes to Scrape",
  "description": null,
  "language": "en",
  "canonicalUrl": null,
  "publishedAt": null,
  "imageUrl": null,
  "siteName": null,
  "extractedFrom": "body",
  "markdown": "# [Quotes to Scrape](https://quotes.toscrape.com/)\n\n[Login](https://quotes.toscrape.com/login)\n\n“The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking.”by Albert Einstein\n\nTags: change deep-thoughts thinking world\n\n...",
  "chars": 1525,
  "tokensEstimate": 382,
  "truncated": false,
  "waitForSelectorFound": null,
  "screenshotKey": null,
  "screenshotUrl": null,
  "renderMs": 788,
  "renderedAt": "2026-11-25T21:37:09.178Z"
}
```

The run summary (`OUTPUT` in the key-value store) lists pages rendered, screenshots, and every skipped URL with the reason.

### Pricing

Pay per event. Pages that don't render add no charge; the start fee applies once per run.

| Event | Price |
|---|---|
| Actor start (per GB of memory, charged once per run; default 1 GB = $0.002) | $0.002 |
| Page rendered (one page returned as Markdown) | $0.0015 |
| Screenshot (only when screenshots are on) | $0.001 |

Examples at the default 1 GB: the 2-page default input costs $0.005. 500 pages (the per-run maximum) cost $0.752, or $1.252 with a screenshot of each page. Pages that fail, time out or are skipped are never charged per page. Set a maximum charge on the run and the Actor stops there.

### Limits

- Public pages only. Pages behind a login, paywall or CAPTCHA are not supported, and private or local network addresses are refused.
- Up to 500 URLs per run, rendered several at a time (one browser tab per 512 MB of memory, up to 8).
- Some sites block automated browsers. Pages that return a block status (401, 403, 429) are skipped, listed in `OUTPUT` with the reason, and not charged. A challenge page that loads with status 200 is rendered like any page.
- Images, fonts and video are skipped while rendering to save time. Image links still appear in the Markdown, and everything loads when a screenshot is requested.
- Markdown is cut at **Max Markdown characters per page** (default 200,000); the row then says `truncated: true`.

### FAQ

**What happens if a URL is wrong or the site is down?**
The run still succeeds. Bad or unreachable URLs are skipped, not charged, and listed in `OUTPUT` with the reason. If no page renders, you get 0 rows and the reason in the run's status message.

**Do I need this or a plain HTTP fetcher?**
If the page's text is in its HTML, a plain HTTP fetcher such as [Web Page to Markdown](https://apify.com/publicrecords/url-to-markdown) is cheaper and faster. Use this Actor when the content only appears after JavaScript runs.

**How do I get content that loads late?**
Set **Wait for CSS selector** to an element that appears with the content, turn on **Scroll to load more**, or add **Extra wait after load**.

**Where are the screenshots?**
In the run's key-value store, named `screenshot-0001.png` and so on. Each row links to its own file in `screenshotUrl`.

**Can I use it from an AI agent or my own code?**
Yes. Call it through the Apify API with your Apify token, or add it to an agent through Apify's MCP server (mcp.apify.com), and read the dataset rows.

# Actor input Schema

## `urls` (type: `array`):

Public http(s) pages to render in a real Chromium browser. Up to 500 per run. Pages behind a login are not supported.

## `waitForSelector` (type: `string`):

Wait until this element exists before reading the page, e.g. .product-list or #results. If it never appears, the page is read anyway and the row says waitForSelectorFound: false.

## `scrollToBottom` (type: `boolean`):

Scroll down the page (up to 8 seconds) so lazy-loaded and infinite-scroll content renders first.

## `extraWaitMs` (type: `integer`):

Extra time to wait after the page settles, 0 to 10,000 ms.

## `contentScope` (type: `string`):

main: the page's main content (main/article), or the body without menus, headers and footers. full: the whole rendered body.

## `cssSelector` (type: `string`):

Keep only the elements matching this selector, e.g. article or #content. Overrides Content to keep.

## `screenshot` (type: `boolean`):

Save a screenshot of each rendered page to the run's key-value store. The row gets screenshotKey and screenshotUrl. Charged per screenshot.

## `fullPageScreenshot` (type: `boolean`):

Capture the whole scrollable page instead of the first screen.

## `screenshotFormat` (type: `string`):

Image format of the screenshot.

## `mobile` (type: `boolean`):

Render as a phone (390 x 844, mobile user agent) instead of a desktop (1366 x 900).

## `blockImages` (type: `boolean`):

Faster and cheaper. Image links still appear in the Markdown. Turned off automatically when a screenshot is requested.

## `includeLinks` (type: `boolean`):

Add the rendered page's links (URL, text, internal or external) to each row.

## `maxChars` (type: `integer`):

Longer Markdown is cut and the row says truncated: true.

## `timeoutSecs` (type: `integer`):

How long to wait for one page before it is skipped (not charged).

## `maxConcurrency` (type: `integer`):

Pages rendered in parallel. Default is one tab per 512 MB of memory, up to 8.

## Actor input object example

```json
{
  "urls": [
    "https://quotes.toscrape.com/js/",
    "https://react.dev/"
  ],
  "scrollToBottom": false,
  "extraWaitMs": 0,
  "contentScope": "main",
  "screenshot": false,
  "fullPageScreenshot": false,
  "screenshotFormat": "png",
  "mobile": false,
  "blockImages": true,
  "includeLinks": false,
  "maxChars": 200000,
  "timeoutSecs": 20
}
```

# Actor output Schema

## `pages` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://quotes.toscrape.com/js/",
        "https://react.dev/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords/js-page-to-markdown").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [
        "https://quotes.toscrape.com/js/",
        "https://react.dev/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("publicrecords/js-page-to-markdown").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://quotes.toscrape.com/js/",
    "https://react.dev/"
  ]
}' |
apify call publicrecords/js-page-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,publicrecords/js-page-to-markdown"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GNwImQMWH9qZtuIaY/builds/yiQ0Q9135SL17heLe/openapi.json
