v1
latestOpenAPI 3.0.02026-07-133020.5 KB/v2/scrape-js: scraping with JS rendering, new engine
Launches real Chrome browser engine, better success rate for websites protected by Cloudflare, Datadome, Kasada, PermimeterX. ATTENTION: Only available <a href='https://scrapeninja.net/docs/getting-started/#subscription-via-apiroad-recommended-way'>via APIRoad!</a>
post/v2/scrape-js
Request body
Example request
{
"url": "https://example.com",
"waitForSelector": "h1.some-class",
"postWaitTime": 5,
"headers": [
"X-Header: some-random-header"
],
"retryNum": 1,
"geo": "eu",
"proxy": "http://user:pw@host:port",
"timeout": 8,
"textNotExpected": [
"random-captcha-text-which-might-appear"
],
"statusNotExpected": [
403,
429
],
"blockImages": true,
"blockMedia": true,
"screenshot": true,
"extractor": "function(input, cheerio) {\n let $ = cheerio.load(input);\n return $('h1.title').text(); } "
}Response
OK
Example response
{
"info": {
"statusCode": 200,
"finalUrl": "https://example.com/url",
"catchedAjax": {
"url": "https://example.com/api/data.json",
"method": "GET",
"headers": [
"content-type: xxx",
"header2: val2"
],
"body": "<html><body><h1>Hello World!</h1></body></html>",
"bodyIframe": "<html><body><h1>Iframe content</h1></body></html>",
"status": 200,
"responseHeaders": {
"content-type": "application/json"
}
},
"headers": [
"content-type: xxx",
"header2: val2"
]
},
"body": "<html><body><h1>Hello World!</h1></body></html>"
}