Proxy & Session Management (V2 vs. V1)

Proxy Requirements

There is a fundamental difference in how proxies are handled between the two versions of Scrapingbypass API.

  • V1 API (Stateless/Optional Proxy):
    • Designed for stateless requests.
    • If no proxy is provided via the X-Cb-Proxy header, the system utilizes a default dynamic proxy pool.
    • Suitable for simple scraping tasks where session consistency is not required.
  • V2 API (Stateful/Mandatory Proxy):
    • Mandatory Requirement: You must provide a static or time-limited (sticky) proxy via the X-Cb-Proxy header.
    • Logic: V2 relies on maintaining a consistent IP address to successfully solve and reuse Cloudflare JS challenges. The V2 engine will not function without a user-defined proxy.

Automatic Session Management (V2 Only)

The V2 engine is optimized for high-success rate bypasses through automated session hosting:

  1. Initial Challenge: When a request encounters a Cloudflare JS challenge, Scrapingbypass API automatically executes the challenge logic.
  2. Session Creation: Upon success, the system stores the Cloudflare session (including cookies and clearance tokens) for 10 minutes.
  3. Automatic Reuse: Subsequent requests using the same proxy and parameters will automatically inherit this session, bypassing the WAF without re-triggering challenges.
  4. Session Extension: Every successful request within the active window automatically extends the 10-minute expiration timer.

Session Isolation with X-Cb-Part

To manage multiple concurrent sessions or separate user contexts, use the X-Cb-Part parameter:

  • Function: Acts as a namespace for your sessions.
  • Isolation: Requests with different X-Cb-Part values are treated as independent environments, even if they use the same proxy.
  • Usage: Set X-Cb-Part="0", X-Cb-Part="1", etc., to isolate cookie jars and clearance states across different tasks.

Configuration Summary

FeatureV1 APIV2 API
Proxy RequirementOptional (Defaults to internal pool)Mandatory (Static or Sticky ISP)
HeaderX-Cb-ProxyX-Cb-Proxy
StatefulnessStatelessStateful (10-minute persistence)
Challenge HandlingBasicAdvanced (JS Polling/Turnstile)
Session IsolationN/ASupported via X-Cb-Part

Warning: V2 Proxy Stability

For V2, ensure your proxy provider supports a "sticky" duration of at least 10 minutes. If the IP rotates during a session, the Cloudflare clearance will immediately invalidate, causing a 403 error.