Skip to content

Imperva (Incapsula)

IllustrationImperva (Incapsula): the site answers with a check page instead of the real content, and loads the real page once the browser passes. The task returns solution.cookies, the cookies that let later requests through.

Summary

PropertyValue
v1 typeimperva beta
createTask namesnone: native API (v1) only
Proxyrequired (Proxies)
Deadline120 seconds (starting value). A task not solved by then fails with timeout and is not charged.

Parameters

The params object of POST /v1/tasks. Unknown fields are rejected with 422 invalid_params.

FieldTypeDescription
website_url
required
string

Full URL of the page that shows the captcha (http or https).

format: uri · pattern: ^[Hh][Tt][Tt][Pp][Ss]?:// · min length 8 · max length 4,096
script_url
required
string

The Incapsula script path, e.g. _Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3.

min length 1 · max length 4,096
cookies
required
string

Your Incapsula cookies (incap_ses_…, visid_incap_…) as a Cookie header string.

min length 1 · max length 16,384
reese84_endpoint
optional
string

The endpoint the reese84 fingerprint is posted to (ends with ?d=site.com), if the site uses reese84.

min length 1 · max length 4,096
user_agent
optional
string

Browser User-Agent.

min length 1 · max length 1,024
proxy
required
object

Required: the cookies are bound to the IP that solved the challenge, so use the same proxy for your next requests.

proxy.type
required
enumone of "http", "https", "socks4", "socks5"
proxy.host
required
string

IP address or host name. Private and loopback addresses are rejected.

min length 1 · max length 253
proxy.port
required
integer≥ 1 · ≤ 65535
proxy.login
optional
stringmax length 256
proxy.password
optional
stringmax length 256

Solution

The solution object of a solved task.

FieldTypeDescription
cookies
required
object

Cookies to set on the target site, name → value. Some values carry cookie attributes (Max-Age, Domain, Path) after the first semicolon.

cookies.<any key>
optional
string

Example: native API (v1)

Runs as is with a test key (nop_test_…) in the sandbox; use a live key for real tasks.

POST /v1/tasks
{
"type": "imperva",
"params": {
"website_url": "https://example.com/login",
"script_url": "_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3",
"cookies": "incap_ses_1166_2930313=br7iX; visid_incap_2930313=P3hgPV",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
"proxy": {
"type": "http",
"host": "203.0.113.7",
"port": 8080,
"login": "proxyuser",
"password": "proxypass"
}
}
}
Terminal window
export NOPTCHA_KEY=nop_test_... # your test or live key
# waits up to 60 s; 200 = finished (solved or failed), 202 = still processing
IDEMPOTENCY_KEY=$(uuidgen) # one key per task you want; a retry of the same request reuses it
curl -s -X POST "https://api.noptcha.com/v1/tasks" \
-H "Authorization: Bearer $NOPTCHA_KEY" \
-H 'Prefer: wait=60' \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"type": "imperva",
"params": {
"website_url": "https://example.com/login",
"script_url": "_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3",
"cookies": "incap_ses_1166_2930313=br7iX; visid_incap_2930313=P3hgPV",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
"proxy": {
"type": "http",
"host": "203.0.113.7",
"port": 8080,
"login": "proxyuser",
"password": "proxypass"
}
}
}
EOF
# on 202: long-poll with the "id" from the response
TASK_ID=...
curl -s "https://api.noptcha.com/v1/tasks/$TASK_ID?wait=60" \
-H "Authorization: Bearer $NOPTCHA_KEY"

In the sandbox the task is solved at once and solution is:

{
"cookies": {
"noptcha_test": "NOPTCHA_TEST_TOKEN_7259140378796032"
}
}