Scrapingbypass API V2s Implementation Guide

This guide follows the current Scrapingbypass API documentation: V2s uses the same parameters as V2 but adds stream response support. Before production use, confirm the latest settings in the official docs and your API console.

What is Scrapingbypass V2s?

Scrapingbypass V2s is the stream-response version of V2. It keeps the same V2 capabilities for JS Challenge, Turnstile, proxy-based access, and session partitioning, while allowing your client to process large responses as they arrive.

When to use V2s

  • The target requires V2 behavior such as challenge handling or session reuse.
  • The response body is large, such as ZIP, PDF, CSV, or exported reports.
  • Your client should write data to disk while downloading.
  • You want to avoid loading the whole response into memory.

Required headers

HeaderDescription
x-cb-apikeyYour API key.
x-cb-hostThe original target host, without protocol or path.
x-cb-version: 2sEnables V2s stream response mode.
x-cb-proxyRequired for V2/V2s.
x-cb-partOptional session partition.
x-cb-sitekeyOptional Turnstile sitekey.
x-cb-timeoutOptional timeout. V2s defaults to 30 seconds and supports 5-3600 seconds.

cURL: download a large file

curl --request GET   --url "https://api.scrapingbypass.com/files/report.zip"   --header "x-cb-apikey: YOUR_APIKEY"   --header "x-cb-host: target.com"   --header "x-cb-version: 2s"   --header "x-cb-proxy: http://user:pass@proxy-host:port"   --header "x-cb-timeout: 600"   --output report.zip

Python: stream to disk

import requests

url = "https://api.scrapingbypass.com/files/report.zip"
headers = {
    "x-cb-apikey": "YOUR_APIKEY",
    "x-cb-host": "target.com",
    "x-cb-version": "2s",
    "x-cb-proxy": "http://user:pass@proxy-host:port",
    "x-cb-timeout": "600",
}

with requests.get(url, headers=headers, stream=True, timeout=650) as resp:
    print(resp.status_code, resp.headers.get("x-cb-status"))
    resp.raise_for_status()
    with open("report.zip", "wb") as f:
        for chunk in resp.iter_content(chunk_size=1024 * 64):
            if chunk:
                f.write(chunk)

Node.js: response stream

import axios from "axios";
import fs from "node:fs";

const resp = await axios.get("https://api.scrapingbypass.com/files/report.zip", {
  responseType: "stream",
  headers: {
    "x-cb-apikey": "YOUR_APIKEY",
    "x-cb-host": "target.com",
    "x-cb-version": "2s",
    "x-cb-proxy": "http://user:pass@proxy-host:port",
    "x-cb-timeout": "600",
  },
});

console.log(resp.status, resp.headers["x-cb-status"]);
resp.data.pipe(fs.createWriteStream("report.zip"));

Using V2s with sessions and Turnstile

V2s supports the same x-cb-part session partition model as V2. It also supports Turnstile through x-cb-sitekey, with [cf_token] placed in the target token field. If the widget uses action or cData, pass x-cb-action and x-cb-cdata as required by the target site.

Migrating from V2 to V2s

  • Change x-cb-version: 2 to x-cb-version: 2s.
  • Keep your V2 proxy, part, sitekey, and token placeholder logic.
  • Use stream reading in your HTTP client.
  • Set x-cb-timeout based on file size and network conditions.

Summary

Use V2s when you need V2 challenge/session behavior and stream response. The integration change is small, but the client-side reading pattern matters: stream the body instead of buffering it all at once.