Imperva (Incapsula)

imperva

A cookie-based method for bypassing the Imperva (Incapsula) CAPTCHA.

IMPORTANT: some parameters are generated dynamically and may differ with each load of a page protected by Imperva (Incapsula).

Task types

  • IncapsulaTask: we use the proxy you provide

IncapsulaTask specification

Property Type Required Description
type String Yes Task type:
IncapsulaTask
websiteURL String Yes The full URL of the target web page where the CAPTCHA is loaded
incapsulaScriptUrl String Yes _Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3: the name of the Incapsula JS file
incapsulaCookies String Yes Your Incapsula cookies. You can get them on the page via document.cookie or from the Set-Cookie: "incap_sess_*=...; visid_incap_*=..." header
userAgent String No The browser User-Agent used to open the page
reese84UrlEndpoint String No The endpoint name where the Reese84 fingerprint is sent. You can find it among the requests, it ends with ?d=site.com
proxyType String Yes Proxy type:
http
socks4
socks5
proxyAddress String Yes The IP address or hostname of the proxy server
proxyPort Number Yes The proxy server port
proxyLogin String No Login for proxy server authentication
proxyPassword String No Password for proxy server authentication

Request examples

Method: createTask

API endpoint: https://api.2captcha.com/createTask

IncapsulaTask request example

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "ImpervaTask",
    "websiteUrl": "https://site-example.com/login",
    "incapsulaScriptUrl": "_Incapsula_Resource?SWJIYLWA=abc123def456ghi789jkl012mno345pq",
    "incapsulaCookies": "incap_ses_1234_567890=abcDEF123ghiJKL456mnoPQR789stuVWXYZ==; visid_incap_567890=xyzABC123defGHI456jklMNOpqr789STUVWXYZ;",
    "reese84UrlEndpoint": "https://site-example.com/_Incapsula_Resource?reese84=1",
    "userAgent": "Mozilla/5.0 (Windows NT AA.B; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": 8080,
    "proxyLogin": "login",
    "proxyPassword": "password"
  }
}

Response example

Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult

json Copy
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "domains": {
      "https://site-example.com": {
        "cookies": {
          "___utmvc": "abc123XYZ789def456GHI012...jkl345MNO678pqr901STU234==; Max-Age=31536000; Domain=.domain-example.com; Path=/; Secure; SameSite=Lax"
        }
      }
    }
  }
}

The cookies from solution.domains must be passed to the target site. If the response includes solution.headers.User-Agent, use the same User-Agent in the request to the site.