Overview

Some pages require JavaScript rendering to fully load the contents. Our Rendering service spawns headless browsers to execute those page scripts before returning the response.

To enable JS Rendering, include the render=true parameter with your requests. The API will fetch the page using a headless browser instance. This feature is available on all plans.

In addition to JS rendering, you can use the wait_for_selector parameter to instruct the API to wait for a specific element to appear on the page, before returning the response. This is useful for pages where content appears with a higher delay. This parameter must be used in combination with render=true and will not work if specified on its own.

Passing JS Rendering as part of the URL

  • API REQUEST

curl --request GET \
  --url 'https://api.scraperapi.com?api_key=API_KEY&render=true&url=https://example.com/'
  • ASYNC REQUEST

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
        "apiKey": "API_KEY",
        "url": "https://example.com/",
        "apiParams": {
          "render": "true"
        }
      }' \
  "https://async.scraperapi.com/jobs"
  • PROXY MODE

Passing JS Rendering as part of the headers

  • API REQUEST

  • ASYNC REQUEST

  • PROXY MODE

Last updated