Imperva challenge solver API

POST

API health

24h health
Normal
  • Healthy / normal
  • Available
Normal

Last 24 hours

Last 30 days

EverySolve's Imperva challenge API returns cookie values for your challenge workflow.Imperva, historically called Incapsula, protects a page through browser and edge checks rather than a standalone image widget. It returns cookie data for the guarded workflow, not a widget token or a list of page resources.

Send POST https://api.everyinfra.com/api/v1/captcha with type set to imperva. Put the parameters in the request body, at the same level as type. $3.06 per 1,000 successful solutions ($0.003056 per successful solve). Failed calls and empty results are not charged.

AI prompt

#
Help me write a script that calls the EveryInfra "Imperva challenge" API.

API contract:
- Request: POST https://api.everyinfra.com/api/v1/captcha with the header Authorization: Bearer <API Key>. Read the key from the EVERYINFRA_API_KEY environment variable; do not put it in the code.
- In the request body, set type to imperva and put the parameters next to it at the same level.
- Required parameters:
  - website_url: The exact page where this challenge appears, including the relevant path rather than only the site home page.
  - incapsula_script_url: The src of the Imperva block page's #main-iframe, such as /_Incapsula_Resource?SWJIYLWA=…. A full URL is accepted; only the part from _Incapsula_Resource on is used. It changes on every render, so read it just before solving.
  - incapsula_cookies: The visid_incap_ and incap_ses_ cookies of the session you are solving, joined as name=value; name=value. Read them through the same proxy just before solving.
  - proxy: The proxy for the solve session; when a result is network-bound, use the same exit for the subsequent target request.
- Optional parameters:
  - user_agent: The browser user agent for this challenge session; keep it consistent when the returned result is bound to that session.
- Example request body:
{
  "type": "imperva",
  "website_url": "<website_url>",
  "incapsula_script_url": "<incapsula_script_url>",
  "incapsula_cookies": "<incapsula_cookies>",
  "proxy": "<proxy>"
}
- Billing: $3.06 per 1,000 successful solutions ($0.003056 per successful solve). Failed calls and empty results are not charged.
- On 422, fix the parameters using the suggestions and allowed values in the error. On 429 or 503, wait for Retry-After and try again.

Before writing code, ask me how many items I need to process and what format to save the results in, then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
typebodystringYesimpervaCAPTCHA type, fixed value.
website_urlbodystringYes-The exact page where this challenge appears, including the relevant path rather than only the site home page.
incapsula_script_urlbodystringYes-The src of the Imperva block page's #main-iframe, such as /_Incapsula_Resource?SWJIYLWA=…. A full URL is accepted; only the part from _Incapsula_Resource on is used. It changes on every render, so read it just before solving.
incapsula_cookiesbodystringYes-The visid_incap_ and incap_ses_ cookies of the session you are solving, joined as name=value; name=value. Read them through the same proxy just before solving.
proxybodystringYes-The proxy for the solve session; when a result is network-bound, use the same exit for the subsequent target request.
user_agentbodystringNo-The browser user agent for this challenge session; keep it consistent when the returned result is bound to that session.

Code samples

#
bash
curl -X POST 'https://api.everyinfra.com/api/v1/captcha' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "imperva",
  "website_url": "<website_url>",
  "incapsula_script_url": "<incapsula_script_url>",
  "incapsula_cookies": "<incapsula_cookies>",
  "proxy": "<proxy>"
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "id": "req_…",  "type": "imperva",  "solution": {    "cookie": "…"  },  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Where the Imperva challenge parameters come from

#

website_url identifies the protected page. incapsula_script_url is the src of the block page's #main-iframe (/_Incapsula_Resource?…) and incapsula_cookies holds that session's visid_incap_ and incap_ses_ cookies; both change on every render, so read them just before solving. proxy is required and user_agent is optional; both must match the session that consumes the cookie.

Code to find these values on the page

imperva-1.js
document.cookie.split('; ').filter(c => /^(visid_incap_|incap_ses_|nlbi_|___utmvc)/.test(c))
imperva-2.js
document.querySelector('#main-iframe')?.getAttribute('src')
imperva-3.js
document.cookie.split('; ').filter(c => /^(visid_incap_|incap_ses_)/.test(c)).join('; ')

How to recognize Imperva challenge

#

Imperva, historically called Incapsula, protects a page through browser and edge checks rather than a standalone image widget.

What makes Imperva challenge different

It returns cookie data for the guarded workflow, not a widget token or a list of page resources.

How to use the Imperva challenge API

#

The Imperva challenge API returns cookie values in cookie. Its solution format is cookie. Attach the returned cookie fields to subsequent requests for the same workflow.

  1. 01Read GET /api/v1/captcha/types and select the imperva entry.
  2. 02Send type: "imperva" and the required parameters to POST /api/v1/captcha.
  3. 03Read cookie values from cookie.
  4. 04Attach the returned cookie fields to subsequent requests for the same workflow.

Billing and availability EverySolve charges only when a solution is delivered successfully. An unsuccessful attempt is not charged, and any held amount goes back to your balance automatically. Read available and the price fields from GET /api/v1/captcha/types at request time rather than treating them as static page content.

Imperva challenge integration questions

#

How can I identify Imperva challenge before choosing a type?

Imperva, historically called Incapsula, protects a page through browser and edge checks rather than a standalone image widget. Use imperva only after those signals match the target challenge.

Which target-page values belong in Imperva challenge requests?

website_url identifies the protected page. incapsula_script_url is the src of the block page's #main-iframe (/_Incapsula_Resource?…) and incapsula_cookies holds that session's visid_incap_ and incap_ses_ cookies; both change on every render, so read them just before solving. proxy is required and user_agent is optional; both must match the session that consumes the cookie. Provide website_url, incapsula_script_url, incapsula_cookies, and proxy. Optional parameters are user_agent.

What does Imperva challenge return, and what is easy to confuse it with?

The Imperva challenge API returns cookie values in cookie. Its solution format is cookie. It returns cookie data for the guarded workflow, not a widget token or a list of page resources.

Which external source explains the Imperva challenge integration?

Imperva's first-party Advanced Bot Protection page identifies the product family. [Open the Imperva challenge reference](https://www.imperva.com/products/advanced-bot-protection/). EverySolve-specific fields and live availability still come from the type catalog.

Reference for Imperva challenge

#
#

All CAPTCHA types

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

Google Analytics needs consent. Privacy