Expanded Limits, Across all tiers - Our Gift to you! Learn more →

AlterLab
SearchResearchPricingComparePlaygroundBlogDocsChangelog
    AlterLabAlterLab
    PricingComparePlaygroundBlogDocsChangelog
    IntroductionQuickstartInstallationYour First Request
    REST APICrawl APIMap APISearch APIResearch APINewSERP APINewExtract APIAIJob PollingDomain StatsNewGeocode APINewNews APIBatch ResultsNewAPI KeysSessions APINewEnterprise APIEnterprise
    AccountAutoAI VisibilityAutoAlertsAutoAuthAutoBillingAutoCrawlAutoExtractAutoIntegrationsAutoKeysAutoMapAutoMonitorsAutoOrganizationsAutoResearch SchedulesAutoRunsAutoSchedulesAutoScrapeAutoSearchAutoSearch SchedulesAutoSessionsAutoUser WebhooksAutoV1 EndpointsAutoAffiliatesAutoAgentAutoAgent OnboardingAutoAgent VisibilityAutoAnalyticsAutoApprovalsAutoArtifactsAutoAttributionAutoB2BAutoBatchAutoBeta FeaturesAutoBlogAutoBuyerAutoChatAutoConnectionsAutoConnectorsAutoContact ListsAutoCreatorAutoCross SellAutoDashboardAutoDefaultsAutoDomainsAutoEmail PreferencesAutoFcAutoHandsAutoHealthAutoJobsAutoListingsAutoMaintenanceAutoNewsAutoOauthAutoOauth GrantsAutoPage InspectAutoPlatformAutoPresetsAutoPricingAutoPrivacyAutoPublicAutoPublic PagesAutoReferralAutoReferralsAutoReportsAutoResearchAutoSecretsAutoSerpAutoSSOAutoStorefrontsAutoSupportAutoTemplatesAutoToolsAutoTrackAutoUsageAutoUsage TagsAutoUserAutoWorkflowsAutoWorkspacesAutoWebhooksAuto
    OverviewPythonNode.jsCLI
    Guides OverviewJavaScript RenderingBrowser ActionsOutput FormatsPDF & OCRCachingWebhooksJSON Schema FilteringWebSocket Real-TimeBring Your Own ProxyProSticky SessionsProAuthenticated ScrapingNewHTTP Methods & BodiesNewStructured ExtractionAIWeb SearchAgent and RAG GroundingResearch JobsAgent RunsSite MappingWeb CrawlingBatch ScrapingSchedulerData MarketplaceSelling DataAgent OnboardingEmbeddingsKeyword IdeasAI VisibilityWorkflowsChange DetectionCloud Storage ExportSpend LimitsOrganizations & TeamsScrape TemplatesCustom ConnectorsSecretsContact ListsPlatform Sub-AccountsReferrals & AffiliatesAlerts & NotificationsExtraction ProfilesAIBYOK ExtractionAIOAuth2 Machine-to-MachineSupport & TicketsUnsupported Targets
    Tutorials OverviewStructured ExtractionAIE-commerce ScrapingNews MonitoringPrice MonitoringMulti-Page CrawlingMonitoring DashboardAI Agent / MCPMCPAI Research AgentAISite CrawlingData Pipeline to Cloud
    E-commerceLead GenerationChange MonitoringRAG & AI PipelinesAIResearch
    Reference OverviewPricingRate LimitsReliabilityReliability ContractError CodesChangelogVersioning
    Migrations OverviewFrom FirecrawlFrom ApifyFrom ScrapingBee / ScraperAPIFrom Crawl4AIFrom SpiderSearch to SERPFirecrawl v0 API ReferenceLegacy
    OverviewMCP ServerAIn8n NodeLangChainAICrewAIAILlamaIndexAISupabaseChrome ExtensionSoon
    PlaygroundPricingStatus

    Up to 5,000 free requests · No credit card

    Guide
    render_js

    Browser Actions

    Drive the page before AlterLab extracts it: click buttons, fill and submit forms, pick product variants, scroll feeds, run JavaScript and capture screenshots at any point — all inside one /api/v1/scrape request.

    Example outputs

    Every request on this page was run against production on 2026-10-26 and the response samples are captured from those runs.

    Actions vs Passive Options

    Most rendered pages need no actions. Three passive options cover the common cases without scripting a sequence. Reach for actions when the content only appears after the page is interacted with. For worked use cases, see the Browser Actions API overview.

    NeedUse
    Wait until an element has renderedwait_for (request field, a CSS selector) — see Wait for Selector
    Trigger lazy-loaded images and sectionsadvanced.scroll_to_load with scroll_count
    Hide cookie bannersadvanced.remove_cookie_banners (on by default) and advanced.consent
    Click, type, select, hover, wait for a spinner to vanish, read a value mid-flow, screenshot between stepsadvanced.actions

    Request Basics

    • Pass an ordered list in advanced.actions. Each item has a type and that type's fields.
    • Actions need a rendered page: advanced.render_js: true is required, otherwise the request is rejected with 422.
    • At most 20 actions per request. They run sequentially, in the order you list them.
    • A failed action is reported and skipped; the sequence continues with the next action.
    JSON
    {
      "url": "https://www.scrapethissite.com/pages/forms/",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "click", "selector": "a[href*=page_num]" },
          { "type": "wait_for", "selector": ".team", "state": "visible" }
        ]
      }
    }

    Action Reference

    Selectors are CSS by default. Prefix with // or xpath= to use XPath.

    Action typeFieldsDescription
    wait
    • milliseconds integer (100-30000)
      Fixed delay in ms; with selector, the visibility timeout
    • selector string, default 10000 ms timeout (max 500 chars; CSS, or XPath with // or xpath=)
      Element to wait for. Provide milliseconds, selector, or both
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Fixed delay, or wait until an element is visible. A selector wait that times out fails the action.
    wait_for
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Element to wait for
    • state string, default visible (visible | hidden | attached | detached)
      hidden / detached wait for the element to disappear (e.g. a spinner)
    • timeout integer, default 10000 (1000-30000)
      Timeout in ms
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Wait for an element to reach a state. Fails on timeout.
    click
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Element to click
    • timeout_ms integer, default 10000 (100-30000)
      Action timeout in ms
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Click an element.
    fill
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Input element
    • value string, required (max 5000 chars)
      Value to type into the input
    • timeout_ms integer, default 10000 (100-30000)
      Action timeout in ms
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Fill an input field with a value.
    press
    • key string, required (max 50 chars)
      Key name, e.g. Enter, Tab, Escape, ArrowDown
    • selector string (max 500 chars; CSS, or XPath with // or xpath=)
      Element to focus first; omit to press on the page keyboard
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Press a keyboard key.
    scroll
    • direction string, default down (down | up)
      Scroll direction
    • amount integer, default 1 (1-20)
      Number of viewport heights
    • target_selector string (max 500 chars; CSS, or XPath with // or xpath=)
      Element to bring into view instead of scrolling by amount (virtualised lists render only the visible window; the observation reports window_only)
    Scroll by a number of viewport heights.
    infinite_scroll
    • max_scrolls integer, default 10 (1-50)
      Maximum scroll iterations
    • delay integer, default 1000 (200-5000)
      Delay between scrolls in ms
    • end_selector string (max 500 chars)
      Stop scrolling once this element exists
    Scroll repeatedly until the end of content or max_scrolls is reached.
    screenshot
    • full_page boolean, default true
      Full page, or the viewport only
    Capture a screenshot at this point in the sequence (returned as screenshot_url).
    evaluate
    • script string, required (max 5120 chars; blocked patterns rejected with 422)
      JavaScript expression or function body
    • timeout_ms integer, default 10000 (100-30000)
      Action timeout in ms
    Run JavaScript in the page. The return value is reported in result.
    dismiss_consent
    • mode string, default hide (hide | accept | reject)
      hide leaves consent state unchanged; accept / reject click the CMP button first
    Remove the cookie consent overlay from the live page.
    select
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      The <select> element
    • value string (max 500 chars)
      Option value attribute. Set exactly one of value or label
    • label string (max 500 chars)
      Option visible label. Set exactly one of value or label
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Choose an option in a <select> element.
    hover
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Element to hover
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Hover over an element (menus, tooltips, lazy content).
    scroll_into_view
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Element to bring into view
    • block string, default center (start | center | end | nearest)
      Vertical alignment of the element in the viewport
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Scroll an element into view, e.g. a row of a virtualised list; only the visible window is observed.
    click_text
    • text string, required (max 500 chars)
      Visible text of the element to click
    • exact boolean, default false
      Whole-text, case-sensitive match; default is case-insensitive substring
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Click the element whose visible text matches.
    extract
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Element to read
    • attribute string (max 100 chars)
      Attribute to return (e.g. href); omit to return the visible text
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Read text or an attribute from the first matching element into result.
    check
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Checkbox or radio
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Check a checkbox or radio button.
    uncheck
    • selector string, required (max 500 chars; CSS, or XPath with // or xpath=)
      Checkbox
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    Uncheck a checkbox.
    wait_event
    • event string, default load (load | domcontentloaded | networkidle)
      Load state to wait for
    • timeout integer, default 10000 (1000-30000)
      Timeout in ms
    Wait for a page load state (e.g. after a navigation).
    snapshot
    • format string, default html (html | markdown)
      Capture the rendered HTML or its markdown conversion
    Capture the page HTML or markdown at this point (returned as snapshot_url).
    inspect
    • max_elements integer, default 200 (1-500)
      Maximum number of elements returned
    Return a capped map of the visible page elements (returned as element_map: viewport, page size and elements with bounding box, tag, text and candidate CSS/XPath selectors).
    download
    • selector string (max 500 chars; exactly one of selector or url)
      Element to click that starts the download
    • url string (http(s), max 2048 chars; exactly one of selector or url)
      Download link to open in a new tab of the same session
    • timeout_ms integer, default 15000 (1000-30000)
      Time to wait for the download to finish, in ms
    • max_bytes integer (1-104857600 (platform default cap 25 MiB))
      Reject files larger than this
    • max_files integer, default 1 (1-10; at most 20 files per request in total)
      Capture up to this many files started by the trigger; further downloads are cancelled. Billed per captured file
    • max_total_bytes integer (1-104857600; requires max_files > 1)
      Aggregate size limit across all files of the action
    • quiet_ms integer, default 1000 (100-10000)
      Multi-file: stop collecting after this many ms without a new download
    • bundle string, default none (none | zip; zip requires max_files > 1)
      zip also stores one deterministic ZIP of all captured files (not billed)
    • frame string | string[] (max 500 chars per selector; up to the supported nesting depth)
      Selector of the <iframe> holding the target; a list targets nested frames, outermost first
    • integration_id string (UUID of an active S3 integration you own; single-file downloads only)
      Also deliver the captured file to this storage integration; platform retrieval works regardless
    • key_template string (requires integration_id)
      Object key for delivery: literal segments plus {artifact_id}, {job_id}, {filename}
    Not yet available (beta): requests using this action are rejected with HTTP 400 action_not_available until artifact storage ships. Capture one file download (returned as a private artifact; fetch it with GET /api/v1/artifacts/{artifact_id}/url).

    Limits

    • Count: up to 20 actions per request.
    • Selectors: up to 500 characters.
    • Scripts: an evaluate script is at most 5120 characters. Scripts that use network or code-loading primitives are rejected with 422 before the job runs. Blocked: fetch, XMLHttpRequest, WebSocket, navigator.sendBeacon, importScripts, eval, Function constructor, dynamic import() / require(), __proto__ and prototype introspection, Reflect.get / Reflect.apply / Reflect.construct, String.fromCharCode, Proxy.
    • Time budget: the whole action sequence shares a 60 s cumulative budget. Actions that would start after it is spent are not run and report action_budget_exhausted; the page is still extracted.

    Ordering

    Within one rendered request the steps run in this order:

    1. Navigation and page load.
    2. scroll_to_load, when enabled.
    3. Your actions, in order. A screenshot action captures the page at that point in the sequence.
    4. Content extraction — the returned HTML, text, markdown and structured data reflect the page after your actions.
    5. The request-level advanced.screenshot, then advanced.generate_pdf. Both capture the final state, after every action.

    action_results

    The response carries one entry per action in action_results, in the order the actions ran.

    result is always a string or null: non-string return values from evaluate are JSON-encoded strings, so parse them with JSON.parse or json.loads. An evaluate result is cut at 1000 characters; when that happens result_truncated is true and the string is not valid JSON.

    FieldTypeDescription
    indexintegerPosition of the action in your actions array (0-based)
    typestringAction type that ran
    successbooleanWhether the action completed
    errorstring | nullError message when success is false (e.g. action_budget_exhausted)
    resultstring | nullReturn value of evaluate and extract actions
    result_truncatedboolean | nullTrue when an evaluate result was cut at the size cap (the string is then not valid JSON)
    screenshotstring | nullLegacy base64 screenshot; screenshot actions now use screenshot_url
    screenshot_urlstring | nullURL of the image captured by a screenshot action
    snapshot_urlstring | nullURL of the HTML or markdown captured by a snapshot action
    artifactobject | nullDownload actions: artifact_id, filename, media_type, size_bytes, sha256, status, scan_status, expires_at. Quarantined files are held (HTTP 423). Executable files, empty files and oversize files fail the action with a download_* error.
    artifactsobject[] | nullDownload actions with max_files > 1: metadata of every captured file
    bundleobject | nullDownload actions with bundle zip: metadata of the ZIP bundle
    deliveryobject | nullDelivery outcome when the download action named an integration_id
    element_mapobject | nullInspect actions: capped element map (viewport, page, total, truncated and elements with bbox, tag, text, css and xpath candidates)
    truncatedboolean | nullTrue when a snapshot or element map was cut at the size cap
    duration_msinteger | nullWall time of the action in ms (0 when not run)
    observationobject | nullPage state after the action settled (URL, route change, readiness, bounded snapshot); only for actions sent with observe: true
    JSON
    {
      "status_code": 200,
      "action_results": [
        { "index": 0, "type": "screenshot", "success": true, "error": null, "result": null, "screenshot_url": "https://alterlab.io/downloads/netcup/screenshots/2026-10-26/eaed39f1-a397-4343-b9c7-079c5e0a21b6_action0_screenshot.png" },
        { "index": 3, "type": "screenshot", "success": true, "error": null, "result": null, "screenshot_url": "https://alterlab.io/downloads/netcup/screenshots/2026-10-26/eaed39f1-a397-4343-b9c7-079c5e0a21b6_action3_screenshot.png" },
        { "index": 4, "type": "evaluate", "success": true, "error": null, "result": "12", "screenshot_url": null }
      ]
    }

    This excerpt is captured from the mid-flow screenshot recipe below, trimmed to whole entries and the fields above. Screenshot URLs expire, so fetch the image soon after the response arrives.

    Error Behaviour

    • Validation (422): unknown action type, a missing required field, a value out of range, more than 20 actions, a blocked script pattern, or actions without render_js: true.
    • Action failure: the entry has success: false and an error message (for example a selector that never appeared). Later actions still run.
    • Budget exhausted: remaining actions report action_budget_exhausted.
    • Actions not executed: if the scrape path could not run the actions at all, the job fails with browser_actions_not_executed instead of returning a 200 with empty results.

    Pricing

    • Actions run in the browser tier, $0.004 per request. There is no per-action fee.
    • Each screenshot action that captures an image adds $0.0002, the same as advanced.screenshot. Failed captures are free.
    • Other add-ons (PDF, extraction, OCR) are billed as usual — see Pricing.

    Recipes

    Hide a consent overlay before a screenshot

    dismiss_consent in hide mode removes the overlay without accepting or rejecting anything.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "url": "https://webscraper.io/test-sites/e-commerce/allinone",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "dismiss_consent", "mode": "hide" },
          { "type": "screenshot", "full_page": true }
        ]
      }
    }'

    Load more and infinite scroll

    Click a “Load more” button, wait for the new cards, then keep scrolling until no more content loads.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "url": "https://webscraper.io/test-sites/e-commerce/more/computers/laptops",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "click", "selector": "a.ecomerce-items-scroll-more" },
          { "type": "wait_for", "selector": ".ecomerce-items-more > div:nth-child(12)", "timeout": 10000 },
          { "type": "infinite_scroll", "max_scrolls": 5, "delay": 1000 }
        ]
      }
    }'

    Select a product variant and extract the price

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "url": "https://webscraper.io/test-sites/e-commerce/allinone/product/31",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "click", "selector": ".swatches button:nth-of-type(2)" },
          { "type": "click_text", "text": "512" },
          { "type": "wait_for", "selector": "span[itemprop=price]", "state": "visible" },
          { "type": "extract", "selector": "span[itemprop=price]" },
          { "type": "extract", "selector": "link[rel=canonical]", "attribute": "href" }
        ]
      }
    }'

    Fill and submit a search form

    Press Enter in the input, or replace the press step with a click on the submit button.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "url": "https://www.scrapethissite.com/pages/forms/",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "fill", "selector": "input[name=q]", "value": "bruins" },
          { "type": "press", "key": "Enter", "selector": "input[name=q]" },
          { "type": "wait_event", "event": "domcontentloaded" },
          { "type": "wait_for", "selector": ".team", "timeout": 15000 }
        ]
      }
    }'

    Capture a screenshot mid-flow

    Screenshot actions capture the page between steps — here before and after loading more products; the evaluate step returns the number of product cards (12 on the captured run).

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "url": "https://webscraper.io/test-sites/e-commerce/more/computers/laptops",
      "advanced": {
        "render_js": true,
        "actions": [
          { "type": "screenshot", "full_page": false },
          { "type": "click", "selector": "a.ecomerce-items-scroll-more" },
          { "type": "wait", "milliseconds": 500 },
          { "type": "screenshot", "full_page": false },
          { "type": "evaluate", "script": "document.querySelectorAll(\".card.thumbnail\").length" }
        ]
      }
    }'
    JavaScript RenderingOutput Formats
    Last updated: June 2026

    On this page