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.
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);
from sursolver import SurSolver, TaskType
API_KEY = "YOUR_API_KEY"
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"
)
client = SurSolver(API_KEY)
result = 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",
}
)
print(result.solution["_px3"])
package main
import (
"context"
"fmt"
"log"
sursolver "github.com/sursolver/sursolver-go"
)
const (
APIKey = "YOUR_API_KEY"
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
)
func main() {
client, err := sursolver.New(APIKey)
if err != nil {
log.Fatal(err)
}
result, err := client.Solve(context.Background(), sursolver.Task{
"type": sursolver.TaskTypePerimeterXCookie,
"websiteURL": "https://example.com/login",
"pxAppId": "YOUR_PX_APP_ID",
"userAgent": UserAgent,
"proxy": "http://user:password@203.0.113.10:8000",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Solution["_px3"])
}
use serde_json::json;
use sursolver::{Client, task_types};
const API_KEY: &str = "YOUR_API_KEY";
const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36";
#[tokio::main]
async fn main() -> Result<(), sursolver::Error> {
let client = Client::new(API_KEY)?;
let result = client
.solve(&json!({
"type": task_types::PERIMETER_X_COOKIE,
"websiteURL": "https://example.com/login",
"pxAppId": "YOUR_PX_APP_ID",
"userAgent": USER_AGENT,
"proxy": "http://user:password@203.0.113.10:8000",
}))
.await?;
println!("{}", result.solution["_px3"]);
Ok(())
}
<?php
require __DIR__ . '/vendor/autoload.php';
use SurSolver\Client;
use SurSolver\TaskTypes;
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';
$client = new Client(API_KEY);
$result = $client->solve([
'type' => TaskTypes::PERIMETER_X_COOKIE,
'websiteURL' => 'https://example.com/login',
'pxAppId' => 'YOUR_PX_APP_ID',
'userAgent' => USER_AGENT,
'proxy' => 'http://user:password@203.0.113.10:8000',
]);
echo $result->solution['_px3'];
require "sursolver"
API_KEY = "YOUR_API_KEY"
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"
client = SurSolver::Client.new(API_KEY)
result = client.solve(
"type" => SurSolver::TaskTypes::PERIMETER_X_COOKIE,
"websiteURL" => "https://example.com/login",
"pxAppId" => "YOUR_PX_APP_ID",
"userAgent" => USER_AGENT,
"proxy" => "http://user:password@203.0.113.10:8000"
)
puts result.solution["_px3"]
import com.sursolver.SolveResult;
import com.sursolver.SurSolverClient;
import com.sursolver.TaskTypes;
import java.util.Map;
public class QuickStart {
static final String API_KEY = "YOUR_API_KEY";
static final String 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";
public static void main(String[] args) throws InterruptedException {
SurSolverClient client = SurSolverClient.create(API_KEY);
SolveResult result = client.solve(Map.of(
"type", TaskTypes.PerimeterXCookie,
"websiteURL", "https://example.com/login",
"pxAppId", "YOUR_PX_APP_ID",
"userAgent", USER_AGENT,
"proxy", "http://user:password@203.0.113.10:8000"));
System.out.println(result.solution().get("_px3"));
}
}
using System.Text.Json.Nodes;
using SurSolver;
const string ApiKey = "YOUR_API_KEY";
const string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36";
var client = new SurSolverClient(ApiKey);
var result = await client.SolveAsync(new JsonObject
{
["type"] = TaskTypes.PerimeterXCookie,
["websiteURL"] = "https://example.com/login",
["pxAppId"] = "YOUR_PX_APP_ID",
["userAgent"] = UserAgent,
["proxy"] = "http://user:password@203.0.113.10:8000",
});
Console.WriteLine(result.Solution["_px3"]);