SurSolver

How to solve PerimeterX

PerimeterX, now part of HUMAN Security, scores visitors with a silent sensor and issues cookies tied to the IP that earned them. Here is how to find the parameters and replay a solve from the right connection.

Updated

Charged when a task is accepted

On this page

What is PerimeterX Bot Defender and how to recognise it

PerimeterX is now part of HUMAN Security, but the tooling, cookies and documentation still say PerimeterX or PX. The product that sits in front of scrapers is Bot Defender: a JavaScript sensor plus a cloud risk score per request, with models trained for each customer. Enforcement is a block page or a 403 that carries a PX reference id.

Most of the time it is invisible. When a visitor looks suspicious, the site shows a "Press & Hold to confirm you are human" page, sometimes a slide or image-match variant instead.

You recognise it by a _px3 or _px2 cookie on first load, a _pxAppId string in the page source, and requests to *.px-cloud.net, *.px-cdn.net or *.perimeterx.net. First-party deployments hide these behind an unexplained POST on every page.

The result contains the main cookie value as _px3, not token. When available, cookies is an object of every cookie name and value returned by the solve. Additional names such as _px2, _pxhd and _pxvid are present only when actually returned. Replay with the userAgent you sent in the task.

Which page URL, app id and proxy to send

Send the full URL of the protected parent page from the address bar. Never use the URL of the challenge iframe, such as iframe.hsprotect.net or *.px-cdn.net; it renders only an empty stub outside the parent page, so it cannot give a working result.

For the app id, search the page source for _pxAppId or for the sensor script URL //client.perimeterx.net/<id>/main.min.js. The id is PX plus eight characters.

Two optional values help. The visitor id is the _pxvid cookie value in the Application panel, and the PX vid can be read by running window._pxhc.vid in the console; it often equals the visitor id. Finally, choose the proxy now, because the same one must be used for the solve and the replay.

Where the cookies go

Set every returned cookie on your HTTP client and replay through the same proxy IP, sending exactly the user agent you sent in the task. The cookies are tied to the IP that earned them.

In browser automation, add the cookies to the context with the same proxy server configured and the task's user agent set at launch. Expect a 200. A 403 with a valid cookie means the IP or user agent changed, so solve again instead of retrying the same cookie.

Common mistakes

IP binding is absolute. Replaying from a different IP, user agent or proxy gives a 403 even with a valid cookie, so use one proxy and one user agent for the fetch, the solve and the replay. Datacenter proxies always fail the trust scoring; use residential, mobile or static ISP addresses, kept sticky for roughly 5 to 10 minutes.

Sending the iframe URL as the page URL is the second mistake, covered above. A captcha loop is a proxy reputation problem, not a solving problem; move to a cleaner IP range. A 429 is usually the site's own rate limit, and solving again will not help.

Cookie lifetime varies by site: some deployments rotate _px3 about every minute, so re-solve when you are blocked. PX also trains per-site models, so a result that works on one app id may fail on another, and TLS and header fingerprints are scored before any challenge, so replay with a client whose headers look like a real browser.

Solve it with SurSolver

Send the parent page URL, the app id, your browser userAgent and your proxy details to createTask with the task type PerimeterXCookie, adding the visitor id when you have it, then poll getTaskResult until the status is ready. This type has no proxyless form. The solution carries the cookies to replay with that user agent. The accepted names and parameters are listed by the public catalog (GET /v1/task-types). The PerimeterX guide covers the cookie set, lifetimes and proxy choice in more depth.

The official client wraps createTask and polling in one solve call; each language tab is its Quick start with this captcha's request, and prints _px3. Replay it, with the returned cookies, through the same proxy and with the task's user agent.

quickstart.ts
npm install sursolver
import { SurSolver, TaskType } from 'sursolver';

const API_KEY = 'YOUR_API_KEY';
const USER_AGENT =
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36';

const client = new SurSolver(API_KEY);

const { solution } = await client.solve({
  type: TaskType.PerimeterXCookie,
  websiteURL: 'https://example.com/login',
  pxAppId: 'YOUR_PX_APP_ID',
  userAgent: USER_AGENT,
  proxy: 'http://user:password@203.0.113.10:8000',
});
console.log(solution._px3);

FAQ

How do I solve PerimeterX automatically?

Send the protected page URL, the app id, your browser user agent and your proxy details, then replay the returned cookies from the same proxy with that user agent. The main result is the _px3 cookie value, with the full cookie set alongside it.

Where do I find the PerimeterX app id?

Search the page source for _pxAppId, or for the sensor script URL of the form //client.perimeterx.net/PXxxxxxxxx/main.min.js, where PXxxxxxxxx stands for the app id. The id is PX followed by eight characters.

Why do I get a 403 with a valid _px3 cookie?

The cookie is tied to the IP that earned it, so a different IP, user agent or proxy gives a 403 even with a valid value. Replay through the same proxy, with the user agent you sent in the task.

Which URL should I send as websiteURL?

The parent page you see in the address bar, never the URL of the challenge iframe on iframe.hsprotect.net or px-cdn.net. The iframe URL renders only an empty stub outside the parent page, so it cannot give a working result.

Which proxy works best?

Residential, mobile or static ISP addresses. Datacenter IPs fail the trust scoring, and the proxy should stay sticky for roughly 5 to 10 minutes so the fetch, the solve and the replay share one IP.