PerimeterXHoldToken
Solve a PerimeterX Press & Hold block from the block payload through your proxy and get the PerimeterX cookies to replay.
PerimeterXHoldToken solves a PerimeterX Press & Hold challenge through your proxy. It takes the block payload from the block page and the cookies the session already holds, and returns the PerimeterX cookies (such as _px3) to set on the session.
PerimeterX shows that challenge on its block page when it wants a human to confirm the request.
Which PerimeterX task do I need?
| What you have | Task |
|---|---|
| You see a block page with a Press & Hold button, and solve through your proxy | PerimeterXHoldToken (this task) |
You have the init.js URL and the app ID, and solve through your proxy | PerimeterXInvisibleToken |
| You have only the app ID, and want the provider's invisible task, from the provider network | PerimeterXInvisibleTokenProxyLess |
| You have only the app ID, and want the provider's standard task, from the provider network | PerimeterXTokenProxyLess |
Use your proxy
task.proxy is required on this task type. The provider solves from that address, and the proxy must keep one IP for the whole solve: see Keep the same IP for the whole solve. Request the block page, solve and replay the cookies from the same IP and with the same User-Agent: PerimeterX ties the cookies to the session that received the challenge.
Recognize a block
The block page is served for the request that PerimeterX stopped and defines page variables such as window._pxAppId, window._pxJsClientSrc, window._pxVid, window._pxUuid and window._pxHostUrl. The app ID is PX followed by letters and digits.
Build the request
Read the block values from that response into one JSON object and pass it as the blockData string. It carries
the app ID, the first-party script paths, vid, uuid and the blockScript path of the challenge script.
xhr, as blockMode.Pass the PerimeterX cookies the session already holds, such as _pxhd, as initCookies. Send {} if there are
none.
Set solution.cookies on the session, send the returned userAgent as the User-Agent, and retry the blocked
request.
blockData must be valid JSON. A task whose blockData is not valid JSON is rejected before it reaches a provider.
Check Provider stats for live success rates and solve times before you pick a provider.
Supported Providers
| Provider | Price per 1,000 | Routing |
|---|---|---|
RiskBypass | $5.00 |
Request Schema
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in a workspace of the AnySolver dashboard. Example: |
task* | object | Yes | The task body. Required fields depend on the task type. See Tasks for per-task schemas. View task properties |
settings | object | No | Per-request settings for routing, Auto Retry, Auto Fallback, proxy reuse, response statistics and detailed analytics. Each field overrides the API key's value. See Routing modes. View settings reference |
Task Object Properties
The task field accepts an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
type* | Yes | ||
websiteURL* | URL | Yes | Full URL of the page where the CAPTCHA is displayed. Example: |
blockMode* | string | Yes | Block mode reported by the PerimeterX block response, for example Example: |
blockData* | string | Yes | PerimeterX block payload from the blocked response, as a JSON string. It carries the app ID ( Example: |
initCookies* | Record<string, unknown> | Yes | PerimeterX cookies the session already holds, such as Example: |
proxy* | string | object | Yes | Proxy the provider solves through, as a string or an object. See Proxy configuration. View proxy configurationExample: |
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "PerimeterXHoldToken",
"websiteURL": "https://example.com/",
"blockMode": "xhr",
"blockData": "{\"appId\":\"PXxxxxxxxx\",\"jsClientSrc\":\"/xxxxx/init.js\",\"firstPartyEnabled\":true,\"vid\":\"...\",\"uuid\":\"...\",\"hostUrl\":\"/xxxxx/xhr\",\"blockScript\":\"/xxxxx/captcha/captcha.js?a=c&u=...&v=...\"}",
"initCookies": {},
"proxy": "http://user:pass@1.2.3.4:8080"
}
}Optional fields are not guaranteed across providers
Response Schema
| Field | Type | Required | Description |
|---|---|---|---|
status* | Yes | Task status: "processing", "ready", or "failed". Example: | |
errorId* | Yes |
Example: | |
taskId | string | No | Unique identifier returned when the task was created. Example: |
errorCode | No | Machine-readable error code. Example: | |
errorDescription | string | No | Human-readable error message with resolution hints. Example: |
cost | number | No | Actual cost charged for this task in USD. Example: |
taskType | No | The type of CAPTCHA task to solve. Example: | |
provider | No | Provider that handled this task. While processing, the provider currently solving it. Example: | |
solution | object | No |
Solution Object Properties
The solution field contains an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
cookies* | Record<string, unknown> | Yes | PerimeterX cookies to set on the session, such as Example: |
userAgent* | string | Yes | User-Agent string used during solving. Example: |
raw* | Record<string, unknown> | Yes | Raw provider response data for advanced use cases. |