createTask
POST /createTask starts a solve and returns its taskId, in the 2Captcha, Anti-Captcha, CapMonster and CapSolver format.
POST https://api.peak.fo/createTask
Checks the task, starts the solve and returns a taskId straight away. Then poll getTaskResult for the result.
The body is JSON. It's read as JSON even if your client sends another Content-Type.
Request
| Field | Type | Required | Description |
|---|---|---|---|
clientKey | string | Yes | Your Peak Solutions API key, which starts with pk_. |
task | object | Yes | The task. Its fields are below. |
appId | string | No | Your app ID, if you build a tool on Peak Solutions. See App IDs. |
softId | any | No | Accepted and ignored. |
languagePool | string | No | Accepted and ignored. |
callbackUrl | string | No | Accepted and ignored. Peak Solutions doesn't call back, so poll getTaskResult. |
Task fields
| Field | Type | Used by | Description |
|---|---|---|---|
type | string | All | The task type. See What each task type solves. |
websiteURL | string | All | The page with the challenge. Required. |
websiteKey | string | Turnstile | The widget's sitekey. Required for Turnstile. See Find the sitekey. |
action | string | Turnstile | The widget's data-action. Also read from pageAction (CapMonster) and metadata.action (CapSolver). |
cData | string | Turnstile | The widget's data-cdata. Also read from data (2Captcha, CapMonster) and metadata.cdata (CapSolver). |
proxyType | string | With a proxy | http, https, socks4 or socks5. Defaults to http. |
proxyAddress | string | With a proxy | The proxy's host name or IP. |
proxyPort | number, string | With a proxy | The proxy's port. |
proxyLogin | string | With a proxy | The proxy username, if it has one. |
proxyPassword | string | With a proxy | The proxy password, if it has one. |
proxy | string | With a proxy | Or the whole proxy in one string, as CapSolver sends it: host:port:user:pass, scheme:host:port:user:pass, host:port, or a URL such as http://user:pass@host:port. Used instead of the fields above if set. |
userAgent | string | 5-second challenge | The Windows Chrome user-agent your code sends. |
htmlPageBase64 | string | 5-second challenge | The challenge page you loaded, base64-encoded (CapMonster). |
html | string | 5-second challenge | Or the challenge page as plain text (CapSolver). |
cloudflareTaskType | string | CapMonster | cf_clearance turns a TurnstileTask into a 5-second challenge solve. |
The 5-second challenge always needs your proxy, and the cookies only work from that proxy's IP. See 5-Second Challenge (WAF) for what to send.
Examples
{
"clientKey": "pk_your_api_key",
"task": {
"type": "TurnstileTaskProxyless",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAA..."
}
}Response
{
"errorId": 0,
"taskId": 4826153907261
}For 2Captcha, Anti-Captcha and CapMonster code, taskId is a number below 253, so JavaScript reads it exactly. For CapSolver code (a type starting with AntiTurnstile, or AntiCloudflareTask), it's a UUID string.
Before a task is created, it gets every check the native API runs: the task is turned on, your balance covers it, the fields are there, the site isn't blocked, the proxy is valid, and you're under your rate limit. If a check fails, you get the error straight away and no task is created. See Error codes.