# Website Rendering ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/website/rendering` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/website-rendering | ## Description Render JavaScript-heavy pages in a headless browser and return post-render HTML. Use when Crawler returns empty DOM; escalate to WebUnlocker if bot protection blocks the session. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/website/rendering' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Render example.com ```json Example Domain

Example Domain

This domain is for use in documentation examples without needing permission. Avoid use in operations.

Learn more

``` ## Documentation ## Choosing the right endpoint Piloterr exposes three complementary ways to fetch a public web page. Pick the **lightest engine that works** for your target site. | Endpoint | Engine | Credits | Use when | |---|---|---:|---| | [Website Crawler](https://www.piloterr.com/library/website-crawler) | HTTP request (no JavaScript) | 1 | The HTML you need is already in the first response: blogs, docs, server-rendered catalog pages, sitemaps. | | [Website Rendering](https://www.piloterr.com/library/website-rendering) | Headless browser (JavaScript executed) | 2 | Content appears only after JS runs: React/Vue/Angular SPAs, lazy-loaded listings, pages that need `wait_for` or POST `browser_instructions`. | | [Website WebUnlocker](https://www.piloterr.com/library/website-webunlocker) | Browser + unlock stack | 3 | [Website Rendering](https://www.piloterr.com/library/website-rendering) or [Website Crawler](https://www.piloterr.com/library/website-crawler) hit bot walls (Cloudflare, DataDome, Akamai, PerimeterX) **and** the domain is on Piloterr's approved whitelist. | **Decision flow** 1. Try **Crawler** first if you do not need client-side rendering. It is the fastest and cheapest option. 2. Switch to **Rendering** when the DOM is empty, prices load asynchronously, or you must wait for a selector / run browser steps. 3. Escalate to **WebUnlocker** only for hardened retail or marketplace domains that block normal browser traffic. Whitelist approval is required before production use. See also: [Website Scraping guide](https://www.piloterr.com/blog/website-crawler-vs-rendering-vs-webunlocker). ## Overview [Website Rendering](https://www.piloterr.com/library/website-rendering) loads the URL in a managed headless browser, executes JavaScript, waits for the DOM to settle, and returns the **fully rendered HTML**. Use it when [Website Crawler](https://www.piloterr.com/library/website-crawler) returns a shell page or missing prices because content is injected client-side. Rendering handles most dynamic sites and light anti-bot friction. When Cloudflare Enterprise, DataDome, or Akamai still block the session, escalate to [Website WebUnlocker](https://www.piloterr.com/library/website-webunlocker) (whitelist required). Costs **2 credits** per successful call. ## Quickstart ``` GET https://api.piloterr.com/v2/website/rendering?query=https://example.com&wait_in_seconds=3 ``` POST is supported when you need `browser_instructions` (scroll, click, fill forms before extraction). ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `query` | string | yes | Public URL with `http://` or `https://` | | `wait_in_seconds` | integer | no | Extra wait after load (0–30 seconds) | | `wait_for` | string | no | CSS/XPath selector to wait for before returning HTML | | `block_ads` | boolean | no | Block ad requests during render. Default `false` | | `timeout` | integer | no | Max seconds to wait for page load. Default `30` | | `browser_instructions` | array | no | POST only: automation steps before capture | ## Response | Field | Description | |---|---| | Response body | HTML after JavaScript execution | ## Related endpoints | Situation | Endpoint | |---|---| | Static HTML, no JS needed | [Website Crawler](https://www.piloterr.com/library/website-crawler) (1 credit, faster) | | Bot wall on whitelisted retail domain | [Website WebUnlocker](https://www.piloterr.com/library/website-webunlocker) | | PNG capture instead of HTML | [Website Screenshot](https://www.piloterr.com/library/website-screenshot) | ## Notes - Domain filtering may apply. Contact Piloterr support to whitelist production targets when needed. - Combine `wait_for` with `timeout` on slow SPAs and infinite-scroll listings. - Prefer Crawler when a quick test shows complete HTML without JS. ## Main use cases - Scrape React, Vue, or Angular marketplaces and dashboards - Wait for lazy-loaded product grids or search results - Run multi-step flows (accept cookies, open tab, scroll) via POST instructions - Collect HTML from pages that fail with plain HTTP crawling