POST
/v2/scrape-jsScrape a page with the newer JavaScript rendering engine
Scrapes a URL with the newer real Chrome browser engine to render JavaScript-dependent pages. Use this endpoint when browser rendering is required, including for sites protected by services such as Cloudflare, Datadome, Kasada, or PerimeterX. Access is available only through APIRoad.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
JSON request containing the URL to scrape and optional browser rendering, request, proxy, retry, and extraction settings.
urlstringrequired
URL to scrape
waitForSelectorstringoptional
CSS selector to wait to appear in DOM tree before page is considered as loaded.
postWaitTimeintegeroptional
Wait for specified amount of seconds after page load (from 1 to 12s). Use this only if ScrapeNinja failed to wait for required page elements automatically.
headersarray<string>optional
Custom headers to send with the request. By default, regular Chrome browser headers are sent to the target URL.
retryNumintegeroptional
Amount of attempts.
geostringoptional
Geo location for basic proxy pools (you can purchase premium ScrapeNinja proxies for wider country selection and higher proxy quality). [Read more about ScrapeNinja proxy setup](https://scrapeninja.net/docs/proxy-setup/)
proxystringoptional
Premium or your own proxy URL (overrides `geo` field). [Read more about ScrapeNinja proxy setup](https://scrapeninja.net/docs/proxy-setup/)
timeoutintegeroptional
Timeout per attempt, in seconds. Each retry will take [timeout] number of seconds.
textNotExpectedarray<string>optional
Text which will trigger a retry from another proxy address.
statusNotExpectedarray<integer>optional
HTTP response statuses which will trigger a retry from another proxy address.
blockImagesbooleanoptional
Block images from loading. This will speed up page loading and reduce bandwidth usage.
blockMediabooleanoptional
Block (CSS, fonts) from loading. This will speed up page loading and reduce bandwidth usage.
screenshotbooleanoptional
Take a screenshot of the page. Pass "false" to increase the speed of the request.
extractorstringoptional
Custom JS function to extract JSON values from scraped HTML. Write&test your own extractor on https://scrapeninja.net/cheerio-sandbox/
200Returns the rendered HTML body and an `info` object containing response metadata, including the status code, final URL, headers, screenshot, and page cookies.
infoobjectoptional
bodystringoptional
HTML body of the rendered page.
Error handling
url is required and must identify the page to scrape. postWaitTime, when supplied, must be between 1 and 12 seconds; this endpoint is available only through APIRoad.