Loading...
Loading...
High-performance web scraping API with Chrome TLS fingerprint and JS rendering
npx skill4agent add vm0-ai/vm0-skills scrapeninjaOfficial docs: https://scrapeninja.net/docs/
/scrape/scrape-js# For RapidAPI
export SCRAPENINJA_API_KEY="your-rapidapi-key"
# For APIRoad (use X-Apiroad-Key header instead)
export SCRAPENINJA_API_KEY="your-apiroad-key"Important: When usingin a command that pipes to another command, wrap the command containing$VARin$VAR. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
/tmp/scrapeninja_request.json{
"url": "https://example.com"
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq '{status: .info.statusCode, url: .info.finalUrl, bodyLength: (.body | length)}'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"headers": ["Accept-Language: en-US"],
"retryNum": 3,
"timeout": 15
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"waitForSelector": "h1",
"timeout": 20
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape-js" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq '{status: .info.statusCode, bodyLength: (.body | length)}'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"screenshot": true
}# Get screenshot URL from response
bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape-js" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq -r '.info.screenshot'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"geo": "eu"
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq .infouseubrfrde4g-eu/tmp/scrapeninja_request.json{
"url": "https://example.com",
"retryNum": 3,
"statusNotExpected": [403, 429, 503],
"textNotExpected": ["captcha", "Access Denied"]
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json'/tmp/scrapeninja_request.json{
"url": "https://news.ycombinator.com",
"extractor": "function(input, cheerio) { let $ = cheerio.load(input); return $(\".titleline > a\").slice(0,5).map((i,el) => ({title: $(el).text(), url: $(el).attr(\"href\")})).get(); }"
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq '.extractor'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"catchAjaxHeadersUrlMask": "api/data"
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape-js" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json' | jq '.info.catchedAjax'/tmp/scrapeninja_request.json{
"url": "https://example.com",
"blockImages": true,
"blockMedia": true
}bash -c 'curl -s -X POST "https://scrapeninja.p.rapidapi.com/scrape-js" --header "Content-Type: application/json" --header "X-RapidAPI-Key: ${SCRAPENINJA_API_KEY}" -d @/tmp/scrapeninja_request.json'| Endpoint | Description |
|---|---|
| Fast non-JS scraping with Chrome TLS fingerprint |
| Full Chrome browser with JS rendering |
| Enhanced JS rendering for protected sites (APIRoad only) |
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | required | URL to scrape |
| string[] | - | Custom HTTP headers |
| int | 1 | Number of retry attempts |
| string | | Proxy geo: us, eu, br, fr, de, 4g-eu |
| string | - | Custom proxy URL (overrides geo) |
| int | 10/16 | Timeout per attempt in seconds |
| string[] | - | Text patterns that trigger retry |
| int[] | [403, 502] | HTTP status codes that trigger retry |
| string | - | Cheerio extractor function |
/scrape-js/v2/scrape-js| Parameter | Type | Default | Description |
|---|---|---|---|
| string | - | CSS selector to wait for |
| int | - | Extra wait time after load (1-12s) |
| bool | true | Take page screenshot |
| bool | false | Block image loading |
| bool | false | Block CSS/fonts loading |
| string | - | URL pattern to intercept AJAX |
| object | 1920x1080 | Custom viewport size |
{
"info": {
"statusCode": 200,
"finalUrl": "https://example.com",
"headers": ["content-type: text/html"],
"screenshot": "base64-encoded-png",
"catchedAjax": {
"url": "https://example.com/api/data",
"method": "GET",
"body": "...",
"status": 200
}
},
"body": "<html>...</html>",
"extractor": { "extracted": "data" }
}/scrape/scrape-jsretryNumeuus/v2/scrape-jsscreenshot: false