# Website Rendering Instructions (POST) ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `POST` | | **Endpoint** | `/v2/website/rendering` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/website-rendering-website-rendering-instructions-post | ## Description Execute browser automation instructions (scroll, scroll_to_bottom) during headless rendering to trigger lazy-loaded content, bypass anti-bot detection, and scrape dynamically loaded pages. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request POST 'https://api.piloterr.com/v2/website/rendering' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Scroll by pixels on Comparably (Airbus) ```json Airbus Culture | Comparably ... ``` ### Scroll to bottom on Comparably (Airbus) ```json Airbus Culture | Comparably ... ``` ## Documentation ## Overview The Website Rendering Instructions API extends the headless browser rendering capability with a `browser_instructions` parameter, allowing you to programmatically control scrolling and other browser actions before extracting the rendered HTML. This is essential for triggering lazy-loaded content, infinite scroll pages, or simulating human-like navigation to avoid detection. Supported instruction types: - `scroll`: scroll by a precise number of pixels (horizontal and/or vertical) - `scroll_to_bottom`: automatically scroll to the bottom of the page ## Quickstart ``` POST https://api.piloterr.com/v2/website/rendering Content-Type: application/json { "query": "https://www.comparably.com/companies/airbus", "wait_for": "#ng-state", "browser_instructions": [ { "type": "scroll", "x": 0, "y": 4115, "wait_time_s": 5 } ] } ``` ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `query` | string | yes | A website URL with either the `http` or `https` protocol | | `wait_in_seconds` | integer | no | Seconds to wait after page load before returning HTML (0–30) | | `wait_for` | string | no | CSS or XPath selector to wait for before returning HTML | | `block_ads` | boolean | no | If `true`, ad requests are blocked during rendering. `false` by default | | `timeout` | integer | no | Maximum seconds to wait for the page to load. Default: `30` | | `browser_instructions` | array | no | Array of browser automation instructions to execute sequentially | ### Browser Instructions: `scroll` | Field | Type | Required | Description | |---|---|---|---| | `type` | string | yes | Must be `"scroll"` | | `x` | integer | yes | Pixels to scroll horizontally | | `y` | integer | yes | Pixels to scroll vertically | | `duration` | number | no | Scroll duration in seconds. Default: `0` (instant) | | `wait_time_s` | number | no | Wait time after scroll in seconds. Default: `0` | ### Browser Instructions: `scroll_to_bottom` | Field | Type | Required | Description | |---|---|---|---| | `type` | string | yes | Must be `"scroll_to_bottom"` | | `duration` | number | no | Scroll duration in seconds. Default: `0` (instant) | | `wait_time_s` | number | no | Wait time after scroll in seconds. Default: `0` | ## Response fields | Field | Type | Description | |---|---|---| | (response body) | string | Fully rendered HTML content after JavaScript execution and browser instructions | ## Notes - This endpoint costs 2 credits per request - Domain filtering is applied. Contact support to whitelist your target domain - Instructions are executed sequentially; if one fails, subsequent ones continue - Increase `timeout` when instructions have significant cumulative durations ## Main use cases - Trigger lazy-loaded images and infinite scroll sections before extracting content from product listing or news feed pages - Simulate human-like scrolling behavior to bypass bot detection systems on JavaScript-heavy websites - Load dynamically rendered content (reviews, comments, data tables) that only appears after user interaction - Automate multi-step browser navigation on SPAs to reach deep page states before scraping