# Peak Solutions documentation > Peak Solutions is a captcha and bot-challenge solving API. Solve challenges such as Cloudflare Turnstile and the Cloudflare 5-second challenge (WAF) with one HTTPS request. Pay only for successful solves. Index: https://docs.peak.fo/llms.txt ## Key facts - Base URL: https://api.peak.fo. HTTPS and JSON only. No SDK is needed. - Authentication: send the API key in the `X-API-Key` header (or `Authorization: Bearer `). Keys start with `pk_`. - Solve: `POST https://api.peak.fo/solve` with a JSON body. `task_type` picks the task. The result comes back in the same response, with no polling. - Task types: `turnstiletask` (Cloudflare Turnstile, your proxy), `turnstiletaskproxyless` (Turnstile, no proxy needed), `cloudflare5stask` (Cloudflare 5-second challenge / WAF, returns cf_clearance cookies, needs a sticky proxy). - Proxy format: `protocol://user:pass@host:port`. Any protocol (http, https, socks4, socks5). Or send proxy parameters instead: `proxy_type` (default http), `proxy_address`, `proxy_port`, `proxy_login`, `proxy_password`; `proxy` wins if both are sent. - Every response: `{"success": bool, "data": {...}, "cost": number, "error": string, "error_code": string}`. Branch on `error_code`, not on `error`. - Every solve that was tried (success or failure) also returns `task_id` (a UUID). Report whether its result worked with `POST https://api.peak.fo/feedback` `{"task_id": "...", "correct": false, "reason": "..."}` within 24 hours; it doesn't change the balance. - Compatible API: the same base URL also answers the createTask API of 2Captcha (API v2), Anti-Captcha, CapMonster Cloud and CapSolver: `POST /createTask`, `/getTaskResult`, `/getBalance`, `/reportIncorrect`, `/reportCorrect`, `/feedbackTask`, with the key as `clientKey` in the body. Switch by changing only the base URL and key. Task types: `TurnstileTaskProxyless`, `TurnstileTask` (with `cloudflareTaskType: "cf_clearance"` for the 5-second challenge), `AntiTurnstileTaskProxyLess`, `AntiCloudflareTask`. Always HTTP 200; failure is `errorId` > 0. Finished tasks are kept 5 minutes. No 2Captcha in.php/res.php. - Failed solves return HTTP 200 with `"success": false` and are not charged. Rejected requests use 4xx/5xx. - Rate limits: each key has a solves-per-minute limit. Requests over it queue for up to 10 seconds, then get HTTP 429 `rate_limited` with `Retry-After: 1`. - Balance: `GET https://api.peak.fo/balance`. Health: `GET https://api.peak.fo/health` (no key). - Pricing: Turnstile $0.90 per 1,000 solves, 5-second challenge $1.00 per 1,000, lower with packages. New accounts can claim 1,000 free solves ($0.90 of credit) in the dashboard; some targets are blocked for trial credit until the account tops up (403 `task_blocked`, `error` says "for trial credits"). - Every docs page is also available as Markdown: add `.md` to its URL, or send `Accept: text/markdown`. --- # What is Peak Solutions? > Solve bot checks and captchas with one API. Source: https://docs.peak.fo/docs Peak Solutions is an API that gets your automation past bot checks and captchas. When your code hits a challenge, it sends the details to Peak Solutions. Peak Solutions solves it and returns what the site expects, such as a token or clearance cookies, and your code carries on. Today Peak Solutions solves Cloudflare [Turnstile](/docs/tasks/turnstile) and Cloudflare's [5-second challenge](/docs/tasks/cloudflare-5s), with more challenge types on the way. ## One endpoint for every challenge [#one-endpoint-for-every-challenge] Every solve goes to `POST /solve`. The `task_type` field says what to solve, and the other fields describe the page: ```json title="POST https://api.peak.fo/solve" { "task_type": "turnstiletask", "url": "https://example.com/", "sitekey": "0x4AAAAAAA...", "proxy": "http://user:pass@1.2.3.4:8080" } ``` New challenge types arrive as new task types, so your integration stays the same. ## Any language [#any-language] It's plain HTTPS and JSON, so there's no SDK to install. If your code can send an HTTP request, it can use Peak Solutions. Every response has the same shape. Check `success`, then read `data`: ```json { "success": true, "data": { "token": "0.AgAAAB..." } } ``` ## Pay only for what works [#pay-only-for-what-works] Failed solves are never charged. When a solve fails, you get `"success": false`, with an `error_code` and an `error` saying why, and nothing is taken from your balance: ```json { "success": false, "error": "Challenge was flagged - try using a different proxy with a cleaner IP reputation", "error_code": "challenge_flagged" } ``` Pay per solve from your balance, or buy a package of solves. ## Your proxy or ours [#your-proxy-or-ours] Some tasks run through your own proxy, so the site sees the same IP that will use the result. Others run through Peak Solutions' proxies, so you don't need one. --- # Why choose Peak Solutions? > Free to try, fast, stable, and priced for scale. Source: https://docs.peak.fo/docs/why Peak Solutions is built for teams that solve challenges all day and can't afford for it to break. ## Try it free [#try-it-free] Every new account can claim **1,000 free solves** ($0.90 of credit) from the dashboard. No card needed. [Create an account](/docs/quickstart), claim the trial, get your key, and test it on your own targets before you pay anything. Some sites can't be solved with trial credit. On those, `error` says the target is blocked for trial credits: [top up](https://peak.fo/dashboard/topup) and they work within a minute. ## Fast solves [#fast-solves] One request returns the result. There's no task to create and no polling loop: send `POST /solve` and the token or cookies come back in the same response. Already on 2Captcha, Anti-Captcha, CapMonster or CapSolver? Peak Solutions also answers their `createTask` API, so you can [switch](/docs/compat) by changing the API address and key. That keeps your code simple and your pipeline moving. Nothing waits on a second round trip. ## Stable at volume [#stable-at-volume] Peak Solutions runs on a pool of solver servers, so one server going down doesn't stop your solves. Changes on the sites you target are picked up and fixed on our side, without any change to your code. When something does go wrong, you can see it. [peak.fo/status](https://peak.fo/status) shows each task's live status, measured from real solves, and outages and fixes are posted on [@peakfostatus](https://t.me/peakfostatus). ## Low prices, lower at volume [#low-prices-lower-at-volume] | Task | Pay per solve, per 1,000 | Packages, per 1,000 | | ----------------------------------------------------- | ------------------------ | ------------------- | | [Turnstile](/docs/tasks/turnstile) | $0.90 | From $0.50 to $0.35 | | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | $1.00 | From $0.60 to $0.40 | The more you solve, the less each solve costs. And you only pay for successful solves: failed solves are never charged. See [Pricing](/docs/pricing) for every package. ## Built for enterprise [#built-for-enterprise] - **Packages up to 1M solves**, each with its own API key, separate from your pay-per-solve balance. - **Stable error codes** on every failure, so your code can retry, switch proxies or alert on the right thing. See [Error codes](/docs/api/errors). - **Clear billing.** Every successful solve returns its `cost`, and [`/balance`](/docs/api/balance) shows what's left at any time. - **Direct support** from the team that runs the solvers, through the chat at [peak.fo/support](https://peak.fo/support). Running at a scale bigger than our packages? [Talk to us](/docs/support) about your volume. ## Quality you can check [#quality-you-can-check] Don't take our word for it. Use the free solves on your real targets, watch the success rate in your dashboard, and decide from there. [Get started](/docs/quickstart) --- # Quickstart > Create an account, get your API key and test it. Source: https://docs.peak.fo/docs/quickstart ## Step 1: Create an account [#step-1-create-an-account] Go to [peak.fo/login](https://peak.fo/login) and click **Create an account**. Enter your email and a password, then open the confirmation link we email you. ## Step 2: Claim your free trial [#step-2-claim-your-free-trial] Open the [Dashboard](https://peak.fo/dashboard) and click **Claim 1,000 solves**. It adds $0.90 of credit to your balance, enough for 1,000 Turnstile solves. No card needed. ## Step 3: Get your API key [#step-3-get-your-api-key] Open [Dashboard → API keys](https://peak.fo/dashboard/keys), click **Generate API key** and copy it. Keys start with `pk_`. ## Step 4: Test your key [#step-4-test-your-key] Ask for your balance. It's free, and it confirms the key works. Replace `pk_your_api_key` with your key: ```bash title="Terminal" curl https://api.peak.fo/balance \ -H "X-API-Key: pk_your_api_key" ``` If the key works, you get your balance back: ```json { "success": true, "data": { "type": "pay_per_solve", "balance": 0.9 } } ``` If you get `"success": false` instead, `error_code` and `error` say why. See [Authentication](/docs/authentication#errors). Want to try a solve before writing code? Use the [Playground](https://peak.fo/dashboard/playground) in your dashboard. --- # Authentication > Send your API key with every request. Source: https://docs.peak.fo/docs/authentication Every request needs your API key. Create one in [Dashboard → API keys](https://peak.fo/dashboard/keys). Keys start with `pk_`. ## Send the key [#send-the-key] Put the key in the `X-API-Key` header. If your HTTP client prefers it, an `Authorization` header with a Bearer token works too. ```http tab="X-API-Key" X-API-Key: pk_your_api_key ``` ```http tab="Authorization" Authorization: Bearer pk_your_api_key ``` If you send both, `X-API-Key` is used. ## Check your key [#check-your-key] `GET /balance` is the simplest authenticated call. It costs nothing and tells you what the key can spend. Replace `pk_your_api_key` with your key. The Python examples use [requests](https://requests.readthedocs.io) (`pip install requests`). The Go examples use [tls-client](https://github.com/bogdanfinn/tls-client) (`go get github.com/bogdanfinn/tls-client`, Go 1.27+). ```bash tab="cURL" tab-group="language" curl https://api.peak.fo/balance \ -H "X-API-Key: pk_your_api_key" ``` ```python tab="Python" tab-group="language" import requests API_KEY = "pk_your_api_key" def get_balance() -> dict: """Returns your balance, or the error if the key doesn't work.""" resp = requests.get( "https://api.peak.fo/balance", headers={"X-API-Key": API_KEY}, timeout=30, ) return resp.json() if __name__ == "__main__": print(get_balance()) ``` ```js tab="JavaScript" tab-group="language" const API_KEY = "pk_your_api_key"; // Returns your balance, or the error if the key doesn't work. async function getBalance() { const resp = await fetch("https://api.peak.fo/balance", { headers: { "X-API-Key": API_KEY }, }); return resp.json(); } console.log(await getBalance()); ``` ```go tab="Go" tab-group="language" package main import ( "encoding/json" "fmt" "log" http "github.com/bogdanfinn/fhttp" tls_client "github.com/bogdanfinn/tls-client" "github.com/bogdanfinn/tls-client/profiles" ) const apiKey = "pk_your_api_key" // Response is the body of every Peak Solutions response. type Response struct { Success bool `json:"success"` Data json.RawMessage `json:"data,omitempty"` Error string `json:"error,omitempty"` ErrorCode string `json:"error_code,omitempty"` } // getBalance returns your balance, or the error if the key doesn't work. func getBalance(client tls_client.HttpClient) (*Response, error) { req, err := http.NewRequest(http.MethodGet, "https://api.peak.fo/balance", nil) if err != nil { return nil, err } req.Header.Set("X-API-Key", apiKey) resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() var out Response if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { return nil, fmt.Errorf("HTTP %d: %w", resp.StatusCode, err) } return &out, nil } func main() { client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), tls_client.WithTimeoutSeconds(30), tls_client.WithClientProfile(profiles.Chrome_152), ) if err != nil { log.Fatal(err) } balance, err := getBalance(client) if err != nil { log.Fatal(err) } out, _ := json.MarshalIndent(balance, "", " ") fmt.Println(string(out)) } ``` If the key works, you get `"success": true` and your balance. [Balance](/docs/api/balance) lists every field. ## Errors [#errors] A key that can't be used is rejected with HTTP `401`. `error_code` says why: ```json { "success": false, "error": "invalid API key", "error_code": "invalid_api_key" } ``` | `error_code` | What to do | | ------------------- | ------------------------------------------------------------ | | `missing_api_key` | Send the key in the `X-API-Key` header. | | `invalid_api_key` | Check for typos, or copy the key again from the dashboard. | | `api_key_inactive` | The key was turned off, or its package expired or ran out. | | `account_suspended` | [Contact support](/docs/support). | | `auth_error` | We couldn't check the key. Retry. | ## Keep your key secret [#keep-your-key-secret] Anyone with your key can spend your balance. Never put it in a browser, a mobile app, or a public repository. Load it from an environment variable or a secrets manager. If a key leaks, click **Rotate key** in [Dashboard → API keys](https://peak.fo/dashboard/keys). You can rotate a key once an hour. The old key stops working within a few seconds. --- # Proxies > The proxy format, which protocols work, and when you need a sticky session. Source: https://docs.peak.fo/docs/proxies ## Format [#format] Send the proxy as one URL in the `proxy` field: ```txt protocol://user:pass@host:port ``` Any proxy protocol works, such as `http`, `https`, `socks4` or `socks5`: ```txt http://user:pass@1.2.3.4:8080 socks5://user:pass@proxy.example.com:1080 ``` Put the username and password in the URL. If they contain special characters such as `@`, `:` or `/`, URL-encode them first. ## Proxy parameters [#proxy-parameters] If your proxy settings are stored in parts, send them as proxy parameters instead of `proxy`: | Field | Type | Required | Description | | ---------------- | ------------------ | -------- | -------------------------------------------------------------------------------- | | `proxy_type` | `string` | No | The protocol, such as `http`, `https`, `socks4` or `socks5`. Defaults to `http`. | | `proxy_address` | `string` | Yes | The host name or IP, such as `1.2.3.4`. No protocol or port. | | `proxy_port` | `number`, `string` | Yes | The port, from `1` to `65535`. | | `proxy_login` | `string` | No | The username, if the proxy has one. | | `proxy_password` | `string` | No | The password. Needs `proxy_login`. | ```json title="POST https://api.peak.fo/solve" { "task_type": "turnstiletask", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "proxy_type": "socks5", "proxy_address": "1.2.3.4", "proxy_port": 1080, "proxy_login": "user", "proxy_password": "pass" } ``` This is the same as sending `"proxy": "socks5://user:pass@1.2.3.4:1080"`. You don't need to URL-encode the login or password here: Peak Solutions does it for you. Send either `proxy` or the proxy parameters. If you send both, `proxy` is used. If the proxy parameters can't make a proxy, the request is rejected with HTTP `400` before any solving, and isn't charged: | `error_code` | When | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | `missing_fields` | `proxy_address` or `proxy_port` is missing. | | `invalid_proxy` | The port isn't a number from 1 to 65535, the address has a protocol or port in it, the type isn't a protocol name, or there's a password without a login. | ## Which tasks need one [#which-tasks-need-one] | Task | Proxy | | -------------------------------------------------------- | ------------------------------------------------------------- | | [Turnstile](/docs/tasks/turnstile) | Required. Peak Solutions solves through it. | | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | Optional. Peak Solutions uses its own if you don't send one. | | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | Required, and it must be sticky. The same one your code uses. | ## Sticky sessions [#sticky-sessions] Many proxy providers give you a new IP on every request unless you ask for a sticky session. With a sticky session, the IP stays the same for a few minutes. Cloudflare ties the 5-second challenge clearance to the IP that solved it. If your next request comes from a different IP, the cookies stop working and you see the challenge again. So for that task: - Use a sticky session that lasts at least a few minutes. - Send the same proxy to Peak Solutions and use it in your own code. ## Picking a proxy [#picking-a-proxy] The proxy's IP matters more than anything else you send. If you see a lot of `challenge_flagged` or `ip_blocked`: - Use residential or mobile IPs. Datacenter IPs are flagged far more often. - Pick a location close to the site's audience. - Avoid IPs that other people share heavily. If you see `proxy_error`, check the format above and that the proxy works from your own machine: ```bash title="Terminal" curl -x "http://user:pass@1.2.3.4:8080" https://example.com ``` --- # Find the sitekey > Where to find a Turnstile widget's sitekey, action and cdata on a page. Source: https://docs.peak.fo/docs/find-sitekey To solve Turnstile you need the widget's **sitekey**. Some sites also set an **action** and **cdata**. If they do, send them too, or the solve fails with `invalid_action` or `invalid_cdata`. | Field | Looks like | Required | | --------- | -------------------------------------------------------------- | ------------------------- | | `sitekey` | `0x4AAAAAAAB1cD2eF3gH4iJ5` | Yes | | `action` | Up to 32 letters, digits, `_` or `-`, such as `login` | Only if the page sets one | | `cdata` | Up to 255 letters, digits, `_` or `-`, such as `session-8f2a` | Only if the page sets one | | `url` | The full URL of the page | Yes | Send `url` as the page that shows the widget, not the site's home page. Real sitekeys start with `0x4`. Sitekeys that start with `1x`, `2x` or `3x`, such as `1x00000000000000000000AA`, are Cloudflare's [test sitekeys](https://developers.cloudflare.com/turnstile/troubleshooting/testing/): the site is in testing mode and doesn't need a real solve. You don't need any of this for the [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s). Peak Solutions reads it from the `html` you send. ## In the page HTML [#in-the-page-html] Most sites put the widget in the HTML as an element with `data-` attributes: ```html
``` Open the page, view its source, and search for `cf-turnstile`. The `data-sitekey`, `data-action` and `data-cdata` on that element are the sitekey, action and cdata. Search for `cf-turnstile`, not just `data-sitekey`: reCAPTCHA and hCaptcha widgets use `data-sitekey` too, and other scripts often use `data-action` for their own purposes. ## Rendered with JavaScript [#rendered-with-javascript] Other sites create the widget from a script, with `turnstile.render()`: ```js turnstile.render('#captcha', { sitekey: '0x4AAAAAAAB1cD2eF3gH4iJ5', action: 'login', cData: 'session-8f2a', }); ``` Search the page's scripts for `turnstile.render` or for `0x4AAAA`. Here the cdata option is spelled `cData`, but you send it to Peak Solutions as `cdata`. ## With the browser console [#with-the-browser-console] On the page with the widget, open the developer tools (F12), go to **Console**, and run: ```js [...document.querySelectorAll('.cf-turnstile')].map((el) => ({ sitekey: el.dataset.sitekey, action: el.dataset.action, cdata: el.dataset.cdata, })); ``` It lists every widget written in the HTML. If it returns an empty list, or a widget without a sitekey, the widget was rendered with JavaScript: use the **Network** tab instead. ## In the Network tab [#in-the-network-tab] Every widget loads a frame from `challenges.cloudflare.com`, with the sitekey in its URL. 1. Open the developer tools (F12) and go to **Network**. 2. Reload the page and filter by `challenges.cloudflare.com`. 3. Find the request whose path contains `turnstile`. The part of the path that starts with `0x4` is the sitekey. This works even when the widget is hidden or created by a script. ## In your code [#in-your-code] If your code already loads the page, read the values out of the HTML before you solve: ```python tab="Python" tab-group="language" import re def find_turnstile(html: str) -> dict: """Returns the sitekey, action and cdata of the first Turnstile widget in the HTML.""" widget = re.search(r'<[^>]*cf-turnstile[^>]*>', html) if not widget: return {} found = {} for field in ("sitekey", "action", "cdata"): match = re.search(rf'data-{field}=["']([^"']+)["']', widget.group(0)) if match: found[field] = match.group(1) return found ``` ```js tab="JavaScript" tab-group="language" function findTurnstile(html) { const widget = html.match(/<[^>]*cf-turnstile[^>]*>/); if (!widget) return {}; const found = {}; for (const field of ["sitekey", "action", "cdata"]) { const match = widget[0].match(new RegExp(`data-${field}=["']([^"']+)["']`)); if (match) found[field] = match[1]; } return found; } ``` ```go tab="Go" tab-group="language" import "regexp" var widgetRe = regexp.MustCompile(`<[^>]*cf-turnstile[^>]*>`) // findTurnstile returns the sitekey, action and cdata of the first Turnstile widget in the HTML. func findTurnstile(html string) map[string]string { found := map[string]string{} widget := widgetRe.FindString(html) if widget == "" { return found } for _, field := range []string{"sitekey", "action", "cdata"} { re := regexp.MustCompile(`data-` + field + `=["']([^"']+)["']`) if m := re.FindStringSubmatch(widget); m != nil { found[field] = m[1] } } return found } ``` Then pass them into the task with the page `url`. If a field isn't found, leave it out of the task. If no widget is found at all, it was rendered with JavaScript: look for the `turnstile.render()` call in the page's scripts instead. ## If the solve fails [#if-the-solve-fails] | `error_code` | What to check | | ----------------- | ---------------------------------------------------------------------------- | | `invalid_sitekey` | The sitekey is copied in full, and belongs to the `url` you sent. | | `invalid_action` | The action matches the page exactly, or leave it out if the page has none. | | `invalid_cdata` | The cdata matches the page exactly. Some sites change it on every page load. | If the site changes `cdata` on every load, read it again from the page right before each solve. --- # Build with AI > Give your AI assistant or coding agent the whole Peak Solutions docs in one link. Source: https://docs.peak.fo/docs/ai These docs are built to be read by AI assistants and coding agents as well as people. Point your tool at one of the files below and it can write a working integration for you. ## Files for AI [#files-for-ai] | File | What's in it | | ---------------------------------- | -------------------------------------------------------------------------- | | [`/llms.txt`](/llms.txt) | A short index: key facts about the API, and a link to every page. | | [`/llms-full.txt`](/llms-full.txt) | Every page in one Markdown file. Best for pasting into a chat. | | [`/openapi.json`](/openapi.json) | An OpenAPI 3.1 spec of every endpoint, for agents and code generators. | | Any page + `.md` | That page as Markdown, such as [`/docs/api/solve.md`](/docs/api/solve.md). | Tools that send `Accept: text/markdown` get Markdown from any docs URL automatically. Every page also has **Copy Markdown** and an **Open** menu at the top, to send the page straight to ChatGPT, Claude and other assistants. ## A prompt to start with [#a-prompt-to-start-with] Paste this into your assistant, then describe what you're building: ```txt Read https://docs.peak.fo/llms-full.txt. It documents the Peak Solutions API. Write a function that solves Cloudflare Turnstile with POST /solve, sends my API key in the X-API-Key header, and retries on error_code timeout, proxy_error and solve_failed. ``` ## Migration [#migration] Already using 2Captcha, Anti-Captcha, CapMonster Cloud or CapSolver? Peak Solutions answers their `createTask` API too, so most code needs only a new API address (`https://api.peak.fo`) and a new key. See [Switch from another solver](/docs/compat) for the task types and fields it accepts. These pages give your assistant what it needs: | Page | What's in it | | -------------------------------------------------------------------- | ----------------------------------------------------------- | | [`/docs/compat.md`](/docs/compat.md) | What to change, and which task types work for each service. | | [`/docs/compat/create-task.md`](/docs/compat/create-task.md) | Every field `createTask` reads, and the ones it ignores. | | [`/docs/compat/get-task-result.md`](/docs/compat/get-task-result.md) | The solution shapes, and how long a result is kept. | | [`/docs/compat/errors.md`](/docs/compat/errors.md) | Every `errorCode`, and how native codes map to it. | Paste this, with your existing code below it: ```txt Read https://docs.peak.fo/llms-full.txt, especially the "Compatible API" pages. My code below uses another captcha solver's createTask API. Move it to Peak Solutions: change the API address to https://api.peak.fo and the key to my Peak Solutions key, and change only what the Compatible API pages say is different or unsupported (callbackUrl is ignored, 2Captcha's in.php/res.php isn't available, finished tasks are kept 5 minutes). Keep the rest of my code as it is. ``` Writing new code anyway? Ask for the native [`POST /solve`](/docs/api/solve) instead. It returns the result in one request, with no polling. --- # Overview > The base URL, every endpoint, and the shape of every response. Source: https://docs.peak.fo/docs/api ## Base URL [#base-url] ```txt https://api.peak.fo ``` Every request goes over HTTPS. Request bodies are JSON, and so is every response. ## Endpoints [#endpoints] | Method | Path | What it does | Needs a key | | ------ | ------------------------------- | -------------------------------- | ----------- | | `POST` | [`/solve`](/docs/api/solve) | Solves a task. | Yes | | `POST` | [`/feedback`](/docs/api/feedback) | Reports whether a solve's result worked. | Yes | | `GET` | [`/balance`](/docs/api/balance) | Returns what your key can spend. | Yes | | `GET` | [`/health`](/docs/api/health) | Checks that the API is up. | No | Send your key in the `X-API-Key` header. See [Authentication](/docs/authentication). Moving from 2Captcha, Anti-Captcha, CapMonster or CapSolver? The same base URL also answers their `createTask` API: `/createTask`, `/getTaskResult`, `/getBalance`, `/reportIncorrect`, `/reportCorrect` and `/feedbackTask`. See [Switch from another solver](/docs/compat). The whole API is also described in an [OpenAPI 3.1 spec](/openapi.json), for code generators and AI agents. See [Build with AI](/docs/ai). ## Responses [#responses] `/solve` and `/balance` always answer with the same envelope: | Field | Type | Description | | ------------ | --------- | ------------------------------------------------------------------------------------------------------- | | `success` | `boolean` | `true` if the request worked. | | `data` | `object` | The result. Only when `success` is `true`. | | `cost` | `number` | What the solve was charged, in USD. Only on a successful `/solve`. | | `error` | `string` | What went wrong, in words. Only when `success` is `false`. | | `error_code` | `string` | What went wrong, as a stable code. Only when `success` is `false`. See [Error codes](/docs/api/errors). | | `task_id` | `string` | The solve's id. On `/solve`, when a solve was tried, whether it worked or not. Send it to [`/feedback`](/docs/api/feedback), or to support. | ```json tab="Success" { "success": true, "data": { "token": "0.AgAAAB..." }, "cost": 0.0009, "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90" } ``` ```json tab="Failure" { "success": false, "error": "Challenge was flagged - try using a different proxy with a cleaner IP reputation", "error_code": "challenge_flagged", "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90" } ``` The `error` text is for people and its wording can change. `error_code` stays the same, so check that in your code. ## HTTP status codes [#http-status-codes] | Status | Meaning | | ------ | ---------------------------------------------------------------------------------------------------------------- | | `200` | The request worked, or a solve was tried and failed. Check `success`. | | `400` | The body isn't valid JSON, `task_type` is unknown, a required field is missing, or the proxy fields are invalid. | | `401` | The API key is missing, wrong, turned off, or expired, or the account is suspended. | | `402` | Not enough balance, the package is used up, or the key can't solve this task type. | | `403` | The target site or sitekey is blocked, or blocked for trial credit until you top up. | | `404` | `/feedback` only: no recent solve on your account has that `task_id`. | | `413` | The body is over 4 MB. | | `429` | You're over your key's rate limit. See [Rate limits](#rate-limits). | | `500` | Something went wrong on our side. Retry. | | `503` | The task type is turned off for now, or no proxyless capacity is available. Retry later. | You're only charged for a successful solve. Failed solves and rejected requests cost nothing. ## Rate limits [#rate-limits] Each API key can start a set number of solves per minute. If you go over, your request waits in line for its turn, so a short burst usually just runs a little slower. If the wait would be longer than 10 seconds, the request is rejected with HTTP `429`, the `rate_limited` error code, and a `Retry-After` header with the seconds to wait (currently always `1`). It isn't charged. The same happens if the whole service is over its limit, which is rare. ```json title="HTTP 429" { "success": false, "error": "Rate limit exceeded - slow down or contact support for a higher limit", "error_code": "rate_limited" } ``` Need a higher limit? [Contact support](/docs/support). --- # Solve > POST /solve solves a task and returns the result. Source: https://docs.peak.fo/docs/api/solve `POST https://api.peak.fo/solve` Sends a task to Peak Solutions and waits for the result. The `task_type` field picks what to solve, and each task page lists the fields it needs. ## Request [#request] Headers: | Header | Value | | -------------- | ------------------ | | `X-API-Key` | Your API key. | | `Content-Type` | `application/json` | Body fields, for all tasks: | Field | Type | Used by | Description | | ---------------- | ------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------ | | `task_type` | `string` | All | What to solve. Not case-sensitive. See the table below. | | `url` | `string` | All | The page with the challenge. | | `proxy` | `string` | All | Your proxy, as `protocol://user:pass@host:port`. Optional for proxyless tasks. See [Proxies](/docs/proxies). | | `proxy_type` | `string` | All | Or use proxy parameters: the protocol, such as `http` or `socks5`. Defaults to `http`. | | `proxy_address` | `string` | All | The proxy's host name or IP. | | `proxy_port` | `number`, `string` | All | The proxy's port. | | `proxy_login` | `string` | All | The proxy username, if it has one. | | `proxy_password` | `string` | All | The proxy password, if it has one. | | `sitekey` | `string` | Turnstile | The widget's sitekey. | | `action` | `string` | Turnstile | The widget's `data-action`, if the page sets one. | | `cdata` | `string` | Turnstile | The widget's `data-cdata`, if the page sets one. | | `user_agent` | `string` | 5-second challenge | The Windows Chrome user-agent your code sends. | | `html` | `string` | 5-second challenge | The challenge page you already loaded. | | `appId` | `string` | All | Optional. Your app ID, if you build a tool on Peak Solutions. `app_id` also works. See [App IDs](/docs/earn#app-ids). | Send the proxy either as one `proxy` URL or as the five proxy parameters, not both. If you send both, `proxy` is used. See [Proxies](/docs/proxies#proxy-parameters). The body can be up to 4 MB. | `task_type` | Task | | ------------------------ | -------------------------------------------------------- | | `turnstiletask` | [Turnstile](/docs/tasks/turnstile) | | `turnstiletaskproxyless` | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | | `cloudflare5stask` | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | ## Example [#example] ```bash title="Terminal" curl https://api.peak.fo/solve \ -H "X-API-Key: pk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "task_type": "turnstiletask", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "proxy": "http://user:pass@1.2.3.4:8080" }' ``` ## Response [#response] | Field | Type | Description | | ------------ | --------- | ------------------------------------------------------------------ | | `success` | `boolean` | `true` if the solve worked. | | `data` | `object` | The result. Its fields depend on the task, see each task page. | | `cost` | `number` | What the solve was charged, in USD. | | `error` | `string` | On failure: what went wrong, in words. | | `error_code` | `string` | On failure: what went wrong, as a stable [code](/docs/api/errors). | | `task_id` | `string` | The solve's id, when a solve was tried. See below. | ```json tab="Success" { "success": true, "data": { "token": "0.AgAAAB..." }, "cost": 0.0009, "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90" } ``` ```json tab="Failed solve" { "success": false, "error": "Challenge was flagged - try using a different proxy with a cleaner IP reputation", "error_code": "challenge_flagged", "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90" } ``` ```json tab="Rejected request" { "success": false, "error": "Missing required fields: sitekey, url, proxy", "error_code": "missing_fields" } ``` - **Failed solve:** HTTP `200`. Peak Solutions tried and couldn't solve it. Not charged. - **Rejected request:** a `4xx` or `5xx` status, before any solving. Not charged, and no `task_id`. ### task_id [#task_id] Every solve that was tried, successful or failed, returns a `task_id`. Keep it: - If the token or cookies don't work on the site, send it to [`POST /feedback`](/docs/api/feedback). - When you ask [support](/docs/support) about a solve, include it. ## Errors [#errors] These can happen on any task: | `error_code` | HTTP | What to do | | ---------------------- | ----- | ---------------------------------------------------------------------------- | | `invalid_request_body` | `400` | Send valid JSON. | | `invalid_task_type` | `400` | Use a `task_type` from the table above. | | `missing_fields` | `400` | Add the fields that `error` lists. | | `invalid_proxy` | `400` | Fix the `proxy_` field that `error` names. | | `request_too_large` | `413` | Keep the body under 4 MB. | | `insufficient_balance` | `402` | [Top up](https://peak.fo/dashboard/topup). | | `package_exhausted` | `402` | Renew the package, or use a pay-per-solve key. | | `task_not_authorized` | `402` | This package key can't solve this task. Check `allowed_tasks`. | | `task_blocked` | `403` | The target is blocked. If `error` says "for trial credits", [top up](https://peak.fo/dashboard/topup) to unlock it. Otherwise [contact support](/docs/support) if that's a mistake. | | `rate_limited` | `429` | Wait for `Retry-After`, then retry. See [Rate limits](/docs/api#rate-limits). | | `task_disabled` | `503` | The task is turned off for now. Retry later. | Each task page lists its own solve failures. All codes are on [Error codes](/docs/api/errors). --- # Feedback > POST /feedback tells us whether a solve's result worked on the site. Source: https://docs.peak.fo/docs/api/feedback `POST https://api.peak.fo/feedback` Tells us whether the token or cookies from a solve worked on the site. Reports go to the Peak Solutions team, who use them to find and fix problems with a site or a solver. They don't change your balance. Every solve that was tried returns a `task_id`. Send it back here within 24 hours, from any key on the same account. A later report on the same solve replaces the earlier one. ## Request [#request] | Header | Value | | -------------- | ------------------ | | `X-API-Key` | Your API key. | | `Content-Type` | `application/json` | | Field | Type | Required | Description | | --------- | --------- | -------- | ------------------------------------------------------------------- | | `task_id` | `string` | Yes | The `task_id` from the [`/solve`](/docs/api/solve#response) response. | | `correct` | `boolean` | Yes | `false` if the result didn't work on the site, `true` if it did. | | `reason` | `string` | No | What happened, such as the site's response. Up to 500 characters. | ```bash title="Terminal" curl https://api.peak.fo/feedback \ -H "X-API-Key: pk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "task_id": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90", "correct": false, "reason": "login returned 403 with the token" }' ``` ## Response [#response] ```json tab="Saved" { "success": true } ``` ```json tab="Not found" { "success": false, "error": "Task not found", "error_code": "task_not_found" } ``` ## Errors [#errors] | `error_code` | HTTP | What to do | | ---------------------- | ----- | ------------------------------------------------------------------------------------------------------------ | | `missing_fields` | `400` | Send both `task_id` and `correct`. | | `invalid_request_body` | `400` | Send valid JSON. | | `task_not_found` | `404` | Check the `task_id`. It must be from your account and under 24 hours old. A solve from the last few seconds may not be found yet: retry shortly. | | `rate_limited` | `429` | Reports count toward your key's [rate limit](/docs/api#rate-limits). Wait for `Retry-After`, then retry. | A package key that has expired or run out can still report on the solves it paid for. For authentication errors, see [Balance](/docs/api/balance#errors). --- # Balance > GET /balance returns what your API key can spend. Source: https://docs.peak.fo/docs/api/balance `GET https://api.peak.fo/balance` Returns your balance, or what's left on your package. It's free, so it's also the easiest way to check that a key works. ## Request [#request] | Header | Value | | ----------- | ------------- | | `X-API-Key` | Your API key. | ```bash title="Terminal" curl https://api.peak.fo/balance \ -H "X-API-Key: pk_your_api_key" ``` For examples in Python, JavaScript and Go, see [Authentication](/docs/authentication#check-your-key). ## Response [#response] The fields in `data` depend on how the key is billed. **Pay-per-solve key.** Each successful solve is taken from your balance. | Field | Type | Description | | -------------- | -------- | ----------------------------- | | `data.type` | `string` | `pay_per_solve` | | `data.balance` | `number` | Your account balance, in USD. | **Package key.** Solves come out of the package instead of your balance. | Field | Type | Description | | ----------------------- | ---------- | ------------------------------------------------ | | `data.type` | `string` | `package` | | `data.package_name` | `string` | The package's name. | | `data.remaining_solves` | `number` | Solves left. | | `data.total_solves` | `number` | Solves the package started with. | | `data.allowed_tasks` | `string[]` | The `task_type` values this key can solve, or `["all"]`. A Turnstile package covers both Turnstile task types. | | `data.expires_at` | `string` | When the package expires, as an ISO 8601 time. | | `data.days_remaining` | `number` | Whole days until it expires. | ```json tab="Pay-per-solve key" { "success": true, "data": { "type": "pay_per_solve", "balance": 12.5 } } ``` ```json tab="Package key" { "success": true, "data": { "type": "package", "package_name": "Turnstile 500K", "remaining_solves": 342819, "total_solves": 500000, "allowed_tasks": ["turnstiletask", "turnstiletaskproxyless"], "expires_at": "2026-12-25T00:00:00Z", "days_remaining": 30 } } ``` ```json tab="Failure" { "success": false, "error": "invalid API key", "error_code": "invalid_api_key" } ``` ## Errors [#errors] | `error_code` | HTTP | What to do | | ------------------ | ----- | ---------------------------------------------------------- | | `missing_api_key` | `401` | Send the key in the `X-API-Key` header. | | `invalid_api_key` | `401` | Check for typos, or copy the key again from the dashboard. | | `api_key_inactive` | `401` | The key was turned off, or its package expired or ran out. | | `account_suspended` | `401` | Your account is suspended. [Contact support](/docs/support). | | `auth_error` | `401` | We couldn't check the key. Retry. | | `internal_error` | `500` | Something went wrong on our side. Retry. | --- # Health > GET /health checks that the API is up. Source: https://docs.peak.fo/docs/api/health `GET https://api.peak.fo/health` Checks that the API is up. It needs no API key and costs nothing, so it works well for uptime monitors. ## Request [#request] ```bash title="Terminal" curl https://api.peak.fo/health ``` ## Response [#response] HTTP `200` with: ```json { "status": "ok" } ``` Any other status, or no answer at all, means the API is down or can't be reached. `/health` only says the API answers. To see how well each task is solving right now, check [peak.fo/status](https://peak.fo/status): it shows whether each task is operational, degraded or down over the last 5 hours, measured from real solves. --- # Error codes > Every error_code the API can return, and what to do about it. Source: https://docs.peak.fo/docs/api/errors Every failed response has an `error_code`, along with an `error` message: ```json { "success": false, "error": "IP address is blocked by CloudFlare - use a different proxy with cleaner reputation", "error_code": "ip_blocked" } ``` Check `error_code` in your code. It stays the same, while the `error` wording can change. None of these are charged. ## Rejected requests [#rejected-requests] The request was turned down before any solving, with a `4xx` or `5xx` status. | `error_code` | HTTP | What happened | What to do | | ----------------------- | ----- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `missing_api_key` | `401` | No API key was sent. | Send it in the `X-API-Key` header. | | `invalid_api_key` | `401` | The key doesn't exist. | Copy the key again from the dashboard. | | `api_key_inactive` | `401` | The key was turned off, or its package expired or ran out of solves. | Use an active key. | | `account_suspended` | `401` | Your account is suspended. | [Contact support](/docs/support). | | `auth_error` | `401` | We couldn't check the key. | Retry. | | `invalid_request_body` | `400` | The body isn't valid JSON. | Send a valid JSON body. | | `request_too_large` | `413` | The body is over 4 MB. | Send a smaller body. | | `invalid_task_type` | `400` | `task_type` isn't a known task. | Use a task type from [Solve](/docs/api/solve#request). | | `missing_fields` | `400` | A field the task needs is missing. | Add the fields that `error` lists. | | `invalid_proxy` | `400` | The proxy parameters can't make a proxy. | Fix the field that `error` names. See [Proxies](/docs/proxies#proxy-parameters). | | `task_not_authorized` | `402` | This package key can't solve this task type. | Check `allowed_tasks` on [Balance](/docs/api/balance). | | `insufficient_balance` | `402` | Your balance is below the task's price. | [Top up](https://peak.fo/dashboard/topup). | | `package_exhausted` | `402` | The package has no solves left. A few seconds later, the same key answers `api_key_inactive` instead. | Renew the package, or use a pay-per-solve key. | | `task_blocked` | `403` | The target site or sitekey is blocked. If `error` says "for trial credits", it's only blocked until you top up. | [Top up](https://peak.fo/dashboard/topup) to unlock a trial block. Otherwise [contact support](/docs/support) if you think it's a mistake. | | `task_not_found` | `404` | [`/feedback`](/docs/api/feedback) only: no solve on your account in the last 24 hours has that `task_id`. | Check the `task_id`. A solve from the last few seconds may not be found yet. | | `rate_limited` | `429` | You're sending solves faster than your key's limit. | Wait for `Retry-After`, then retry. See [Rate limits](/docs/api#rate-limits). | | `task_disabled` | `503` | The task type is turned off for now. | Retry later. | | `proxyless_unavailable` | `503` | Proxyless solving isn't available right now. | Retry later, or use `turnstiletask` with your own proxy. | | `billing_error` | `500` | The solve worked, but charging failed, so the result wasn't sent. | Retry. You weren't charged. | | `internal_error` | `500` | Something went wrong on our side. | Retry. | ## Failed solves [#failed-solves] Peak Solutions tried to solve the task and couldn't. These come back as HTTP `200` with `"success": false`. | `error_code` | Tasks | What happened | What to do | | ------------------------ | ------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------- | | `proxy_error` | All | Your proxy failed or was rejected. | Check the [format](/docs/proxies#format) and that it's reachable. | | `timeout` | All | The solve didn't finish in time. | Retry, or use a faster proxy closer to the site. | | `solve_failed` | All | The solver couldn't produce a result. | Retry, if needed with a different proxy. | | `no_servers` | All | No solver for this task is free right now. | Retry in a few seconds. | | `proxy_required` | All | The task needed a proxy and none was available. | Retry. | | `solver_error` | All | The solver ran into an error. | Retry. | | `unknown` | All | Something else went wrong. | Retry. [Contact support](/docs/support) if it keeps happening. | | `challenge_flagged` | Turnstile, 5-second | The challenge flagged the request, usually the proxy's IP. | Retry with a proxy that has a cleaner IP. | | `invalid_sitekey` | Turnstile, 5-second | The sitekey is wrong for that site. | Check the sitekey belongs to the page. | | `invalid_action` | Turnstile, 5-second | `action` doesn't match the site. | Send the exact `data-action`, or leave it out. | | `invalid_cdata` | Turnstile, 5-second | `cdata` doesn't match the site. | Send the exact `data-cdata`, or leave it out. | | `no_challenge` | 5-second | The page isn't showing a challenge. | Check the `url`, and that the page is challenged right now. | | `ip_blocked` | 5-second | Cloudflare blocked the proxy's IP. | Retry with a different proxy. | | `unsupported_user_agent` | 5-second | The user-agent isn't supported. | Send a Windows Chrome user-agent. | | `invalid_html` | 5-second | The page couldn't be read. | Check the `url`, and that `html` is the challenge page. | | `invalid_request_data` | 5-second | The request data was rejected. | Check the `url` format, such as `https://example.com/`. | | `turnstile_failed` | 5-second | The Turnstile inside the challenge failed. If that step timed out or the proxy failed, you get `timeout` or `proxy_error` instead. | Retry with a different proxy. | --- # Turnstile > Solve a Cloudflare Turnstile widget through your own proxy. Source: https://docs.peak.fo/docs/tasks/turnstile Solves a Cloudflare Turnstile widget and returns the token the site expects. The solve runs through your proxy. ## Request [#request] `POST https://api.peak.fo/solve` | Field | Type | Required | Description | | ----------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | `task_type` | `string` | Yes | `turnstiletask` | | `url` | `string` | Yes | The page the widget is on. | | `sitekey` | `string` | Yes | The widget's sitekey. See [Find the sitekey](/docs/find-sitekey). | | `proxy` | `string` | Yes | Your proxy, as `protocol://user:pass@host:port`. Or send it in [proxy parameters](/docs/proxies#proxy-parameters). | | `action` | `string` | No | The widget's `data-action`, if the page sets one. | | `cdata` | `string` | No | The widget's `data-cdata`, if the page sets one. | ## Example [#example] The Python examples use [requests](https://requests.readthedocs.io) (`pip install requests`). The Go examples use [tls-client](https://github.com/bogdanfinn/tls-client) (`go get github.com/bogdanfinn/tls-client`, Go 1.27+). ```bash tab="cURL" tab-group="language" curl https://api.peak.fo/solve \ -H "X-API-Key: pk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "task_type": "turnstiletask", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "proxy": "http://user:pass@1.2.3.4:8080" }' ``` ```python tab="Python" tab-group="language" import requests API_KEY = "pk_your_api_key" def solve(task: dict) -> dict: """Sends a task to Peak Solutions and returns the response.""" resp = requests.post( "https://api.peak.fo/solve", headers={"X-API-Key": API_KEY}, json=task, timeout=120, ) return resp.json() if __name__ == "__main__": response = solve( { "task_type": "turnstiletask", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "proxy": "http://user:pass@1.2.3.4:8080", } ) print(response) ``` ```js tab="JavaScript" tab-group="language" const API_KEY = "pk_your_api_key"; // Sends a task to Peak Solutions and returns the response. async function solve(task) { const resp = await fetch("https://api.peak.fo/solve", { method: "POST", headers: { "X-API-Key": API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(task), }); return resp.json(); } const response = await solve({ task_type: "turnstiletask", url: "https://example.com/login", sitekey: "0x4AAAAAAA...", proxy: "http://user:pass@1.2.3.4:8080", }); console.log(response); ``` ```go tab="Go" tab-group="language" package main import ( "bytes" "encoding/json" "fmt" "log" http "github.com/bogdanfinn/fhttp" tls_client "github.com/bogdanfinn/tls-client" "github.com/bogdanfinn/tls-client/profiles" ) const apiKey = "pk_your_api_key" // Response is the body of every Peak Solutions response. type Response struct { Success bool `json:"success"` Data json.RawMessage `json:"data,omitempty"` Error string `json:"error,omitempty"` ErrorCode string `json:"error_code,omitempty"` Cost float64 `json:"cost,omitempty"` } // solve sends a task to Peak Solutions and returns the response. func solve(client tls_client.HttpClient, task map[string]string) (*Response, error) { payload, err := json.Marshal(task) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, "https://api.peak.fo/solve", bytes.NewReader(payload)) if err != nil { return nil, err } req.Header.Set("X-API-Key", apiKey) req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() var out Response if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { return nil, fmt.Errorf("HTTP %d: %w", resp.StatusCode, err) } return &out, nil } func main() { client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), tls_client.WithTimeoutSeconds(120), tls_client.WithClientProfile(profiles.Chrome_152), ) if err != nil { log.Fatal(err) } response, err := solve(client, map[string]string{ "task_type": "turnstiletask", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "proxy": "http://user:pass@1.2.3.4:8080", }) if err != nil { log.Fatal(err) } out, _ := json.MarshalIndent(response, "", " ") fmt.Println(string(out)) } ``` ## Response [#response] | Field | Type | Description | | ---------------------- | -------- | ------------------------------------------------------------------ | | `data.token` | `string` | The Turnstile token. | | `data.secondary_token` | `string` | Only returned when the widget also issues a second token. | | `cost` | `number` | What the solve was charged, in USD. | | `error` | `string` | On failure: what went wrong, in words. | | `error_code` | `string` | On failure: what went wrong, as a stable [code](/docs/api/errors). | ```json tab="Success" { "success": true, "data": { "token": "0.AgAAAB..." }, "cost": 0.0009 } ``` ```json tab="Failure" { "success": false, "error": "Challenge was flagged - try using a different proxy with a cleaner IP reputation", "error_code": "challenge_flagged" } ``` ## Errors [#errors] A failed solve returns HTTP `200` with `"success": false`, and is not charged. | `error_code` | What to do | | ------------------- | ------------------------------------------------------------ | | `invalid_sitekey` | Check the sitekey belongs to that page. | | `invalid_action` | Send the exact `data-action` from the page, or leave it out. | | `invalid_cdata` | Send the exact `data-cdata` from the page, or leave it out. | | `challenge_flagged` | Retry with a proxy that has a cleaner IP. | | `proxy_error` | Check the proxy format and that the proxy is reachable. | | `timeout` | Retry, or use a faster proxy. | | `solve_failed` | Retry, if needed with a different proxy. | | `solver_error` | Retry. | A request missing `sitekey`, `url` or `proxy` is rejected with HTTP `400` and `missing_fields`. For rejections like `insufficient_balance`, see [Error codes](/docs/api/errors). --- # Turnstile (Proxyless) > Solve a Cloudflare Turnstile widget without a proxy. Source: https://docs.peak.fo/docs/tasks/turnstile-proxyless The same solve as [Turnstile](/docs/tasks/turnstile), but you don't need a proxy: Peak Solutions runs it through its own proxies. ## Request [#request] `POST https://api.peak.fo/solve` | Field | Type | Required | Description | | ----------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `task_type` | `string` | Yes | `turnstiletaskproxyless` | | `url` | `string` | Yes | The page the widget is on. | | `sitekey` | `string` | Yes | The widget's sitekey. See [Find the sitekey](/docs/find-sitekey). | | `action` | `string` | No | The widget's `data-action`, if the page sets one. | | `cdata` | `string` | No | The widget's `data-cdata`, if the page sets one. | | `proxy` | `string` | No | Your own proxy, as `protocol://user:pass@host:port` or in [proxy parameters](/docs/proxies#proxy-parameters). Used instead of ours if set. | ## Example [#example] The Python examples use [requests](https://requests.readthedocs.io) (`pip install requests`). The Go examples use [tls-client](https://github.com/bogdanfinn/tls-client) (`go get github.com/bogdanfinn/tls-client`, Go 1.27+). ```bash tab="cURL" tab-group="language" curl https://api.peak.fo/solve \ -H "X-API-Key: pk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "task_type": "turnstiletaskproxyless", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA..." }' ``` ```python tab="Python" tab-group="language" import requests API_KEY = "pk_your_api_key" def solve(task: dict) -> dict: """Sends a task to Peak Solutions and returns the response.""" resp = requests.post( "https://api.peak.fo/solve", headers={"X-API-Key": API_KEY}, json=task, timeout=120, ) return resp.json() if __name__ == "__main__": response = solve( { "task_type": "turnstiletaskproxyless", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", } ) print(response) ``` ```js tab="JavaScript" tab-group="language" const API_KEY = "pk_your_api_key"; // Sends a task to Peak Solutions and returns the response. async function solve(task) { const resp = await fetch("https://api.peak.fo/solve", { method: "POST", headers: { "X-API-Key": API_KEY, "Content-Type": "application/json", }, body: JSON.stringify(task), }); return resp.json(); } const response = await solve({ task_type: "turnstiletaskproxyless", url: "https://example.com/login", sitekey: "0x4AAAAAAA...", }); console.log(response); ``` ```go tab="Go" tab-group="language" package main import ( "bytes" "encoding/json" "fmt" "log" http "github.com/bogdanfinn/fhttp" tls_client "github.com/bogdanfinn/tls-client" "github.com/bogdanfinn/tls-client/profiles" ) const apiKey = "pk_your_api_key" // Response is the body of every Peak Solutions response. type Response struct { Success bool `json:"success"` Data json.RawMessage `json:"data,omitempty"` Error string `json:"error,omitempty"` ErrorCode string `json:"error_code,omitempty"` Cost float64 `json:"cost,omitempty"` } // solve sends a task to Peak Solutions and returns the response. func solve(client tls_client.HttpClient, task map[string]string) (*Response, error) { payload, err := json.Marshal(task) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, "https://api.peak.fo/solve", bytes.NewReader(payload)) if err != nil { return nil, err } req.Header.Set("X-API-Key", apiKey) req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() var out Response if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { return nil, fmt.Errorf("HTTP %d: %w", resp.StatusCode, err) } return &out, nil } func main() { client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), tls_client.WithTimeoutSeconds(120), tls_client.WithClientProfile(profiles.Chrome_152), ) if err != nil { log.Fatal(err) } response, err := solve(client, map[string]string{ "task_type": "turnstiletaskproxyless", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", }) if err != nil { log.Fatal(err) } out, _ := json.MarshalIndent(response, "", " ") fmt.Println(string(out)) } ``` ## Response [#response] | Field | Type | Description | | ---------------------- | -------- | ------------------------------------------------------------------ | | `data.token` | `string` | The Turnstile token. | | `data.secondary_token` | `string` | Only returned when the widget also issues a second token. | | `cost` | `number` | What the solve was charged, in USD. | | `error` | `string` | On failure: what went wrong, in words. | | `error_code` | `string` | On failure: what went wrong, as a stable [code](/docs/api/errors). | ```json tab="Success" { "success": true, "data": { "token": "0.AgAAAB..." }, "cost": 0.0009 } ``` ```json tab="Failure" { "success": false, "error": "Challenge was flagged - try using a different proxy with a cleaner IP reputation", "error_code": "challenge_flagged" } ``` ## Errors [#errors] A failed solve returns HTTP `200` with `"success": false`, and is not charged. | `error_code` | What to do | | ------------------- | ----------------------------------------------------------------------------------------- | | `invalid_sitekey` | Check the sitekey belongs to that page. | | `invalid_action` | Send the exact `data-action` from the page, or leave it out. | | `invalid_cdata` | Send the exact `data-cdata` from the page, or leave it out. | | `challenge_flagged` | Retry. If it keeps happening, use [Turnstile](/docs/tasks/turnstile) with your own proxy. | | `proxy_error` | Retry. | | `timeout` | Retry. | | `solve_failed` | Retry. | | `solver_error` | Retry. | If proxyless solving is unavailable, the request is rejected with HTTP `503` and `proxyless_unavailable`. Retry later, or use [Turnstile](/docs/tasks/turnstile) with your own proxy. A request missing `sitekey` or `url` is rejected with HTTP `400` and `missing_fields`. For rejections like `insufficient_balance`, see [Error codes](/docs/api/errors). --- # 5-Second Challenge (WAF) > Pass Cloudflare's "Just a moment..." browser check. Source: https://docs.peak.fo/docs/tasks/cloudflare-5s Passes Cloudflare's browser check, the "Just a moment..." page that runs before a site loads. Peak Solutions returns the clearance cookies, the headers to send, and the form fields that complete the challenge. ## How it works [#how-it-works] 1. **Load the page** through your proxy. Cloudflare answers with the challenge page. 2. **Send it to Peak Solutions**, with the same proxy and user-agent. 3. **Complete the challenge.** Add the returned cookies, then post the returned form fields back to the page. 4. **Keep going** with the same proxy, cookies and headers. Cloudflare now lets you through. Cloudflare ties the clearance to the IP that solved it. Use a sticky (session) proxy, and keep the same session from step 1 to step 4. Start a new proxy session for each solve. ## Request [#request] `POST https://api.peak.fo/solve` | Field | Type | Required | Description | | ------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `task_type` | `string` | Yes | `cloudflare5stask` | | `url` | `string` | Yes | The page that shows the challenge. | | `proxy` | `string` | Yes | A [sticky](/docs/proxies#sticky-sessions) proxy, as `protocol://user:pass@host:port` or in [proxy parameters](/docs/proxies#proxy-parameters). The same one your code uses. | | `user_agent` | `string` | No | The user-agent your code sends. Must be a Windows Chrome user-agent. | | `html` | `string` | No | The challenge page you already loaded in step 1. Saves a request, so solves faster. | ```bash title="Terminal" curl https://api.peak.fo/solve \ -H "X-API-Key: pk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "task_type": "cloudflare5stask", "url": "https://example.com/", "proxy": "http://user:pass@1.2.3.4:8080", "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" }' ``` ## Response [#response] | Field | Type | Description | | ----------------- | -------- | ---------------------------------------------------------------------- | | `data.cookies` | `object` | Cookies to add for the site, such as `cf_clearance`. | | `data.headers` | `object` | Headers to send on every request from now on. Names are lowercase. | | `data.attributes` | `object` | Form fields to post back to the page, to complete the challenge. | | `data.cf_rt` | `string` | Challenge token. Goes in the `Referer` of that post, as `__cf_chl_tk`. | | `cost` | `number` | What the solve was charged, in USD. | | `error` | `string` | On failure: what went wrong, in words. | | `error_code` | `string` | On failure: what went wrong, as a stable [code](/docs/api/errors). | ```json tab="Success" { "success": true, "data": { "cookies": { "cf_clearance": "Kx9...", "__cf_bm": "aB3..." }, "headers": { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ..." }, "attributes": { "md": "Zq1...", "r": "7Hk..." }, "cf_rt": "Wm2..." }, "cost": 0.001 } ``` ```json tab="Failure" { "success": false, "error": "IP address is blocked by CloudFlare - use a different proxy with cleaner reputation", "error_code": "ip_blocked" } ``` ## Complete the challenge [#complete-the-challenge] After the solve, post `attributes` back to the page: - **Method and URL:** `POST` to the same `url` you solved. - **Body:** `attributes` as a URL-encoded form (`application/x-www-form-urlencoded`). - **Cookies:** everything in `cookies`. - **Headers:** everything in `headers`, plus a `Referer` of your `url` with `__cf_chl_tk=` added to its query string. Cloudflare checks the TLS fingerprint as well as the headers, so use an HTTP client that looks like Chrome. A plain HTTP library gets challenged again. This full example runs all four steps. Install the client for your language: - **Python:** [wreq](https://github.com/0x676e67/wreq-python), `pip install wreq` (Python 3.11+) - **JavaScript:** [wreq-js](https://github.com/sqdshguy/wreq-js), `npm install wreq-js` - **Go:** [tls-client](https://github.com/bogdanfinn/tls-client), `go get github.com/bogdanfinn/tls-client` (Go 1.27+) ```python tab="Python" tab-group="language" import asyncio from datetime import timedelta from urllib.parse import urlencode from wreq import Client, Cookie, Emulation, Platform, Proxy API_KEY = "pk_your_api_key" USER_AGENT = ( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36" ) async def solve(url: str, proxy: str, html: str) -> dict: """Sends the challenge page to Peak Solutions and returns the solution.""" async with Client(timeout=timedelta(seconds=120)) as client: resp = await client.post( "https://api.peak.fo/solve", headers={"X-API-Key": API_KEY}, json={ "task_type": "cloudflare5stask", "url": url, "proxy": proxy, "user_agent": USER_AGENT, "html": html, }, ) body = await resp.json() if not body["success"]: raise RuntimeError(f"{body['error_code']}: {body['error']}") return body["data"] async def main() -> None: url = "https://example.com/" proxy = "http://user:pass@1.2.3.4:8080" # a sticky session async with Client( emulation=Emulation(Emulation.Chrome154, Platform.Windows), user_agent=USER_AGENT, proxies=[Proxy.all(proxy)], cookie_store=True, timeout=timedelta(seconds=60), ) as browser: # 1. Load the page. Cloudflare answers with the challenge. page = await browser.get(url) # 2. Send it to Peak Solutions. solution = await solve(url, proxy, await page.text()) # 3. Add the cookies, then post the form fields back. for name, value in solution["cookies"].items(): browser.cookie_jar.add(Cookie(name, value), url) separator = "&" if "?" in url else "?" referer = url + separator + urlencode({"__cf_chl_tk": solution["cf_rt"]}) await browser.post( url, form=solution.get("attributes", {}), headers={**solution["headers"], "referer": referer}, ) # 4. You're through. Keep using the same browser and headers. page = await browser.get(url, headers=solution["headers"]) print(page.status, await page.text()) if __name__ == "__main__": asyncio.run(main()) ``` ```js tab="JavaScript" tab-group="language" import { createSession } from "wreq-js"; const API_KEY = "pk_your_api_key"; const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " + "(KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36"; // Sends the challenge page to Peak Solutions and returns the solution. async function solve(url, proxy, html) { const resp = await fetch("https://api.peak.fo/solve", { method: "POST", headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ task_type: "cloudflare5stask", url, proxy, user_agent: USER_AGENT, html, }), }); const body = await resp.json(); if (!body.success) { throw new Error(`${body.error_code}: ${body.error}`); } return body.data; } async function main() { const url = "https://example.com/"; const proxy = "http://user:pass@1.2.3.4:8080"; // a sticky session // Chrome 149 on Windows, through your proxy. The session keeps cookies between requests. const browser = await createSession({ browser: "chrome_149", os: "windows", proxy, timeout: 60_000, }); try { // 1. Load the page. Cloudflare answers with the challenge. const page = await browser.fetch(url); // 2. Send it to Peak Solutions. const solution = await solve(url, proxy, await page.text()); // 3. Add the cookies, then post the form fields back. for (const [name, value] of Object.entries(solution.cookies)) { browser.setCookie(name, value, url); } const separator = url.includes("?") ? "&" : "?"; const referer = url + separator + new URLSearchParams({ __cf_chl_tk: solution.cf_rt }); await browser.fetch(url, { method: "POST", headers: { ...solution.headers, "content-type": "application/x-www-form-urlencoded", referer, }, body: new URLSearchParams(solution.attributes).toString(), }); // 4. You're through. Keep using the same browser and headers. const result = await browser.fetch(url, { headers: solution.headers }); console.log(result.status, await result.text()); } finally { await browser.close(); } } await main(); ``` ```go tab="Go" tab-group="language" package main import ( "bytes" "encoding/json" "fmt" "io" "log" "net/url" "strings" http "github.com/bogdanfinn/fhttp" tls_client "github.com/bogdanfinn/tls-client" "github.com/bogdanfinn/tls-client/profiles" ) const ( apiKey = "pk_your_api_key" userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36" ) // Solution is what Peak Solutions returns for a cloudflare5stask. type Solution struct { Cookies map[string]string `json:"cookies"` Headers map[string]string `json:"headers"` Attributes map[string]string `json:"attributes"` CfRt string `json:"cf_rt"` } // solve sends the challenge page to Peak Solutions and returns the solution. func solve(pageURL, proxy, html string) (*Solution, error) { payload, err := json.Marshal(map[string]string{ "task_type": "cloudflare5stask", "url": pageURL, "proxy": proxy, "user_agent": userAgent, "html": html, }) if err != nil { return nil, err } client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), tls_client.WithTimeoutSeconds(120)) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, "https://api.peak.fo/solve", bytes.NewReader(payload)) if err != nil { return nil, err } req.Header.Set("X-API-Key", apiKey) req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() var body struct { Success bool `json:"success"` Error string `json:"error"` ErrorCode string `json:"error_code"` Data Solution `json:"data"` } if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, err } if !body.Success { return nil, fmt.Errorf("%s: %s", body.ErrorCode, body.Error) } return &body.Data, nil } // send makes a request that looks like Chrome, adds any extra headers, and returns the status and body. func send(browser tls_client.HttpClient, method, pageURL, body string, headers map[string]string) (int, string, error) { var reader io.Reader if body != "" { reader = strings.NewReader(body) } req, err := http.NewRequest(method, pageURL, reader) if err != nil { return 0, "", err } req.Header = http.Header{ "accept": {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}, "accept-language": {"en-US,en;q=0.9"}, "user-agent": {userAgent}, } for name, value := range headers { req.Header[strings.ToLower(name)] = []string{value} } resp, err := browser.Do(req) if err != nil { return 0, "", err } defer resp.Body.Close() text, err := io.ReadAll(resp.Body) return resp.StatusCode, string(text), err } func main() { pageURL := "https://example.com/" proxy := "http://user:pass@1.2.3.4:8080" // a sticky session browser, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), tls_client.WithClientProfile(profiles.Chrome_152), tls_client.WithProxyUrl(proxy), tls_client.WithCookieJar(tls_client.NewCookieJar()), tls_client.WithTimeoutSeconds(60), ) if err != nil { log.Fatal(err) } // 1. Load the page. Cloudflare answers with the challenge. _, html, err := send(browser, http.MethodGet, pageURL, "", nil) if err != nil { log.Fatal(err) } // 2. Send it to Peak Solutions. solution, err := solve(pageURL, proxy, html) if err != nil { log.Fatal(err) } // 3. Add the cookies, then post the form fields back. u, err := url.Parse(pageURL) if err != nil { log.Fatal(err) } var cookies []*http.Cookie for name, value := range solution.Cookies { cookies = append(cookies, &http.Cookie{Name: name, Value: value}) } browser.SetCookies(u, cookies) form := url.Values{} for name, value := range solution.Attributes { form.Set(name, value) } separator := "?" if strings.Contains(pageURL, "?") { separator = "&" } headers := map[string]string{ "content-type": "application/x-www-form-urlencoded", "referer": pageURL + separator + url.Values{"__cf_chl_tk": {solution.CfRt}}.Encode(), } for name, value := range solution.Headers { headers[name] = value } if _, _, err := send(browser, http.MethodPost, pageURL, form.Encode(), headers); err != nil { log.Fatal(err) } // 4. You're through. Keep using the same browser and headers. status, page, err := send(browser, http.MethodGet, pageURL, "", solution.Headers) if err != nil { log.Fatal(err) } fmt.Println(status, page) } ``` ## Errors [#errors] A failed solve returns HTTP `200` with `"success": false`, and is not charged. | `error_code` | What to do | | ------------------------ | ------------------------------------------------------------------ | | `no_challenge` | The page isn't showing the challenge, or the `url` is wrong. | | `ip_blocked` | Retry with a different proxy. | | `unsupported_user_agent` | Send a Windows Chrome user-agent. | | `invalid_html` | Check the `url`, and that `html` is the challenge page itself. | | `invalid_request_data` | Check the `url` format, such as `https://example.com/`. | | `challenge_flagged` | Retry with a proxy that has a cleaner IP. | | `turnstile_failed` | Retry with a different proxy. | | `invalid_sitekey` | The Turnstile inside the challenge has a sitekey the solver can't use. Retry, or [contact support](/docs/support). | | `invalid_action` | The Turnstile inside the challenge rejected the action. Retry. | | `invalid_cdata` | The Turnstile inside the challenge rejected the cdata. Retry. | | `no_servers` | No solver is free right now. Retry in a few seconds. | | `proxy_error` | Check the proxy format, that it's reachable, and that it's sticky. Also returned when the proxy fails during the challenge's Turnstile step. | | `timeout` | Retry, or use a faster proxy closer to the site. | | `solve_failed` | Retry with a different proxy. | | `solver_error` | Retry with a different proxy. | A request missing `url` or `proxy` is rejected with HTTP `400` and `missing_fields`. For rejections like `insufficient_balance`, see [Error codes](/docs/api/errors). --- # Switch from another solver > Use your 2Captcha, Anti-Captcha, CapMonster or CapSolver code with Peak Solutions by changing two settings. Source: https://docs.peak.fo/docs/compat Already using 2Captcha, Anti-Captcha, CapMonster Cloud or CapSolver? Peak Solutions answers the same `createTask` API they use, so your code works as it is. Change two settings: 1. **The API address:** `https://api.peak.fo`. 2. **The key:** your Peak Solutions key, which starts with `pk_`. Get one in [Dashboard → API keys](https://peak.fo/dashboard/keys). Everything else stays the same: the task types, the field names, the polling loop, the error codes your code already handles. ## Supported services [#supported-services] | Your code is written for | Task types Peak Solutions accepts | `taskId` | | ----------------------------------- | -------------------------------------------------------------- | ---------- | | 2Captcha (API v2) | `TurnstileTaskProxyless`, `TurnstileTask` | A number | | Anti-Captcha | `TurnstileTaskProxyless`, `TurnstileTask` | A number | | CapMonster Cloud | `TurnstileTask`, including `cloudflareTaskType: "cf_clearance"` | A number | | CapSolver | `AntiTurnstileTaskProxyLess`, `AntiCloudflareTask` | A UUID | Task type names aren't case-sensitive. Any other task type gets `ERROR_TASK_NOT_SUPPORTED`. ## What each task type solves [#what-each-task-type-solves] Each task runs as one of the Peak Solutions tasks, with that task's price and rules. | Task type | Runs as | Proxy | | ------------------------------------------------- | ------------------------------------------------------------ | --------------------- | | `TurnstileTaskProxyless` | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | Not needed | | `AntiTurnstileTaskProxyLess` | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | Not needed | | `TurnstileTask` with proxy fields | [Turnstile](/docs/tasks/turnstile) | Yours | | `TurnstileTask` without proxy fields | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | Not needed | | `TurnstileTask` with `cloudflareTaskType: "cf_clearance"` | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | Yours, required | | `AntiCloudflareTask` | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | Yours, required | ## How it works [#how-it-works] ### Create a task [#create-a-task] `POST https://api.peak.fo/createTask` with your key and the task. You get a `taskId` back straight away. See [createTask](/docs/compat/create-task). ### Poll for the result [#poll-for-the-result] Every 3 to 5 seconds, `POST https://api.peak.fo/getTaskResult` with the `taskId`. It answers `processing` until the solve finishes, then `ready` with the solution. See [getTaskResult](/docs/compat/get-task-result). ### Use the solution [#use-the-solution] The solution has the same shape your code already reads: a `token` for Turnstile, or the `cf_clearance` cookie for the 5-second challenge. ## Good to know [#good-to-know] - **HTTP status is always `200`.** Check `errorId`: `0` means it worked, anything else is an error with an `errorCode` and an `errorDescription`. See [Error codes](/docs/compat/errors). - **You're only charged for solves that work.** The charge happens when the solve finishes, whether or not you collect the result. - **Collect results within 5 minutes.** A finished task is kept for 5 minutes, about as long as a Turnstile token stays valid. After that, or if Peak Solutions restarts, `getTaskResult` answers `ERROR_NO_SUCH_CAPCHA_ID`. Create a new task. - **Results are private to your account.** Any of your keys can poll your tasks. Another account's key gets `ERROR_NO_SUCH_CAPCHA_ID`, exactly as for an unknown id. - **Balance, rate limits and blocked sites** work as on the native API. When you're over your key's rate limit, `createTask` answers `ERROR_NO_SLOT_AVAILABLE` (`ERROR_RATE_LIMIT` for CapSolver code), which these clients already retry. - **`callbackUrl` is ignored.** Peak Solutions doesn't call back, so poll `getTaskResult`. - **`softId`, `languagePool`, `pagedata`, `chlPageData` and `pageData` are accepted and ignored.** ## Not supported [#not-supported] - 2Captcha's older `in.php` / `res.php` API. Use its API v2 (`createTask`) instead. - Captcha types other than Cloudflare Turnstile and the Cloudflare 5-second challenge. - Anti-Captcha's `reportIncorrectRecaptcha` and `reportCorrectRecaptcha`. Use [`reportIncorrect`](/docs/compat/reports) instead. ## Or use the native API [#or-use-the-native-api] The native [`POST /solve`](/docs/api/solve) returns the result in the same request, with no task to create and no polling. It's the simplest choice for new code. Both APIs use the same keys, balance and prices. --- # createTask > POST /createTask starts a solve and returns its taskId, in the 2Captcha, Anti-Captcha, CapMonster and CapSolver format. Source: https://docs.peak.fo/docs/compat/create-task `POST https://api.peak.fo/createTask` Checks the task, starts the solve and returns a `taskId` straight away. Then poll [getTaskResult](/docs/compat/get-task-result) for the result. The body is JSON. It's read as JSON even if your client sends another `Content-Type`. ## Request [#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](/docs/earn#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 [#task-fields] | Field | Type | Used by | Description | | -------------------- | ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------------------- | | `type` | `string` | All | The task type. See [What each task type solves](/docs/compat#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](/docs/find-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)](/docs/tasks/cloudflare-5s) for what to send. ## Examples [#examples] ```json tab="2Captcha / Anti-Captcha" { "clientKey": "pk_your_api_key", "task": { "type": "TurnstileTaskProxyless", "websiteURL": "https://example.com/login", "websiteKey": "0x4AAAAAAA..." } } ``` ```json tab="CapMonster (cf_clearance)" { "clientKey": "pk_your_api_key", "task": { "type": "TurnstileTask", "cloudflareTaskType": "cf_clearance", "websiteURL": "https://example.com/", "websiteKey": "xxxxxxxxxx", "htmlPageBase64": "PCFET0NUWVBFIGh0bWw+...", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36", "proxyType": "http", "proxyAddress": "1.2.3.4", "proxyPort": 8080, "proxyLogin": "user", "proxyPassword": "pass" } } ``` ```json tab="CapSolver" { "clientKey": "pk_your_api_key", "task": { "type": "AntiTurnstileTaskProxyLess", "websiteURL": "https://example.com/login", "websiteKey": "0x4AAAAAAA...", "metadata": { "action": "login" } } } ``` ```bash tab="cURL" curl https://api.peak.fo/createTask \ -H "Content-Type: application/json" \ -d '{ "clientKey": "pk_your_api_key", "task": { "type": "TurnstileTaskProxyless", "websiteURL": "https://example.com/login", "websiteKey": "0x4AAAAAAA..." } }' ``` ## Response [#response] ```json tab="2Captcha, Anti-Captcha, CapMonster" { "errorId": 0, "taskId": 4826153907261 } ``` ```json tab="CapSolver" { "errorId": 0, "taskId": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90" } ``` ```json tab="Error" { "errorId": 10, "errorCode": "ERROR_ZERO_BALANCE", "errorDescription": "insufficient balance" } ``` 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](/docs/compat/errors). --- # getTaskResult > POST /getTaskResult returns a task's status and, once it's ready, its solution. Source: https://docs.peak.fo/docs/compat/get-task-result `POST https://api.peak.fo/getTaskResult` Returns whether a task from [createTask](/docs/compat/create-task) is still being solved, and its solution once it's ready. Poll it every 3 to 5 seconds. ## Request [#request] | Field | Type | Required | Description | | ----------- | ------------------ | -------- | -------------------------------------------------------------------- | | `clientKey` | `string` | Yes | Your API key. Any key on the account that created the task works. | | `taskId` | `number`, `string` | Yes | The `taskId` from `createTask`. A number may also be sent as a string. | ```bash title="Terminal" curl https://api.peak.fo/getTaskResult \ -H "Content-Type: application/json" \ -d '{"clientKey": "pk_your_api_key", "taskId": 4826153907261}' ``` ## Response [#response] | Field | Type | Description | | ------------ | -------- | --------------------------------------------------------------------------- | | `errorId` | `number` | `0` if the request worked. | | `status` | `string` | `processing` while solving, `ready` when the solution is in. | | `solution` | `object` | Only when `ready`. Its fields are below. | | `cost` | `string` | Only when `ready`. What the solve was charged, in USD, as a string. | | `createTime` | `number` | Only when `ready`. When the task was created, as a Unix time in seconds. | | `endTime` | `number` | Only when `ready`. When the solve finished, as a Unix time in seconds. | | `solveCount` | `number` | Only when `ready`. Always `1`. | | `taskId` | `string` | Only when `ready`, for CapSolver tasks. The task's id. | ### Solution [#solution] | Task | `solution` fields | | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- | | Turnstile | `token`: the Turnstile token. | | 5-second challenge, CapMonster code | `cf_clearance`: the cookie value. `userAgent`: the user-agent the cookie is bound to. | | 5-second challenge, CapSolver code | `cookies`: every cookie set, including `cf_clearance`. `token`: the `cf_clearance` value. `userAgent`. | Send the cookie with the same `userAgent`, through the same proxy you gave the task. Cloudflare checks both. ```json tab="Processing" { "errorId": 0, "status": "processing" } ``` ```json tab="Ready (Turnstile)" { "errorId": 0, "status": "ready", "solution": { "token": "0.AgAAAB..." }, "cost": "0.0009", "createTime": 1795094012, "endTime": 1795094019, "solveCount": 1 } ``` ```json tab="Ready (cf_clearance)" { "errorId": 0, "status": "ready", "solution": { "cf_clearance": "Xk3o9...", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36" }, "cost": "0.001", "createTime": 1795094012, "endTime": 1795094031, "solveCount": 1 } ``` ```json tab="Failed" { "errorId": 12, "errorCode": "ERROR_CAPTCHA_UNSOLVABLE", "errorDescription": "Challenge was flagged - try using a different proxy with a cleaner IP reputation" } ``` A failed solve isn't charged. `errorDescription` says why it failed, in the same words as the native API's `error`. See [Error codes](/docs/compat/errors) for how failures map to `errorCode`. ## Task not found [#task-not-found] `ERROR_NO_SUCH_CAPCHA_ID` (CapSolver code: `ERROR_TASKID_INVALID`) means one of these: - The `taskId` is wrong. - The task finished more than 5 minutes ago and was removed. - Peak Solutions restarted since you created it. - It belongs to another account. Create a new task. If the solve had already finished, it was charged. ## A complete loop [#a-complete-loop] ```python tab="Python" tab-group="language" import time import requests API = "https://api.peak.fo" API_KEY = "pk_your_api_key" def solve_turnstile(url: str, sitekey: str) -> str: """Creates a Turnstile task and polls until it has a token.""" created = requests.post( f"{API}/createTask", json={ "clientKey": API_KEY, "task": {"type": "TurnstileTaskProxyless", "websiteURL": url, "websiteKey": sitekey}, }, timeout=30, ).json() if created["errorId"] != 0: raise RuntimeError(f"{created['errorCode']}: {created['errorDescription']}") for _ in range(40): time.sleep(3) result = requests.post( f"{API}/getTaskResult", json={"clientKey": API_KEY, "taskId": created["taskId"]}, timeout=30, ).json() if result["errorId"] != 0: raise RuntimeError(f"{result['errorCode']}: {result['errorDescription']}") if result["status"] == "ready": return result["solution"]["token"] raise TimeoutError("no result after 2 minutes") if __name__ == "__main__": print(solve_turnstile("https://example.com/login", "0x4AAAAAAA...")) ``` ```js tab="JavaScript" tab-group="language" const API = "https://api.peak.fo"; const API_KEY = "pk_your_api_key"; async function call(method, body) { const resp = await fetch(`${API}/${method}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ clientKey: API_KEY, ...body }), }); const data = await resp.json(); if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`); return data; } // Creates a Turnstile task and polls until it has a token. async function solveTurnstile(url, sitekey) { const { taskId } = await call("createTask", { task: { type: "TurnstileTaskProxyless", websiteURL: url, websiteKey: sitekey }, }); for (let i = 0; i < 40; i++) { await new Promise((r) => setTimeout(r, 3000)); const result = await call("getTaskResult", { taskId }); if (result.status === "ready") return result.solution.token; } throw new Error("no result after 2 minutes"); } console.log(await solveTurnstile("https://example.com/login", "0x4AAAAAAA...")); ``` --- # getBalance > POST /getBalance returns what your key can spend, in USD. Source: https://docs.peak.fo/docs/compat/get-balance `POST https://api.peak.fo/getBalance` Returns what your key can spend, in USD. It's free. ## Request [#request] | Field | Type | Required | Description | | ----------- | -------- | -------- | ------------- | | `clientKey` | `string` | Yes | Your API key. | ```bash title="Terminal" curl https://api.peak.fo/getBalance \ -H "Content-Type: application/json" \ -d '{"clientKey": "pk_your_api_key"}' ``` ## Response [#response] | Field | Type | Description | | ---------- | -------- | ---------------------------------------------- | | `errorId` | `number` | `0` if the request worked. | | `balance` | `number` | What the key can spend, in USD. | | `packages` | `array` | Always empty. It's there for CapSolver code. | ```json tab="Success" { "errorId": 0, "balance": 12.5, "packages": [] } ``` ```json tab="Error" { "errorId": 1, "errorCode": "ERROR_KEY_DOES_NOT_EXIST", "errorDescription": "invalid API key" } ``` ## Package keys [#package-keys] A [package](/docs/pricing#packages) key has solves, not dollars. So `balance` is what the solves left are worth: the solves left × the package's price per solve, rounded down to 4 decimals. For example, a package of 500,000 solves bought for $250 is worth $0.0005 a solve. With 342,819 solves left, `balance` is `171.4095`. When the package is used up or expires, `balance` is `0`, so code that stops at a zero balance stops at the right time. For the exact number of solves left and the expiry date, use the native [`GET /balance`](/docs/api/balance). --- # Report a result > Tell us whether a solution worked, with reportIncorrect, reportCorrect or feedbackTask. Source: https://docs.peak.fo/docs/compat/reports If a solution didn't work on the site, tell us. Reports go to the Peak Solutions team, who use them to find and fix problems with a site or a solver. They don't change your balance. You can report on any of your account's finished tasks. A later report on the same task replaces the earlier one. How long you have depends on the `taskId`: - **A number** (2Captcha, Anti-Captcha and CapMonster code): within 5 minutes of the solve finishing, while [getTaskResult](/docs/compat/get-task-result) still has the task. - **A UUID string** (CapSolver code, or a native `task_id`): for 24 hours. ## reportIncorrect and reportCorrect [#reportincorrect-and-reportcorrect] The 2Captcha format. `POST https://api.peak.fo/reportIncorrect` when the solution didn't work, or `POST https://api.peak.fo/reportCorrect` when it did. | Field | Type | Required | Description | | ----------- | ------------------ | -------- | ------------------------------- | | `clientKey` | `string` | Yes | Your API key. | | `taskId` | `number`, `string` | Yes | The `taskId` from `createTask`. | ```bash title="Terminal" curl https://api.peak.fo/reportIncorrect \ -H "Content-Type: application/json" \ -d '{"clientKey": "pk_your_api_key", "taskId": 4826153907261}' ``` ## feedbackTask [#feedbacktask] The CapSolver format. `POST https://api.peak.fo/feedbackTask`. | Field | Type | Required | Description | | ---------------- | ------------------ | -------- | -------------------------------------------------------------- | | `clientKey` | `string` | Yes | Your API key. | | `taskId` | `string` | Yes | The `taskId` from `createTask`. | | `result.invalid` | `boolean` | No | `true` if the solution didn't work. Defaults to `false`. | | `result.code` | `number`, `string` | No | Your own code for what happened, such as the site's response status. | | `result.message` | `string` | No | What happened, in words. | ```json title="Body" { "clientKey": "pk_your_api_key", "taskId": "5f0c2b1e-8a4d-4c3e-9b7a-2d6e1f4a8c90", "result": { "invalid": true, "code": 403, "message": "the site rejected the token" } } ``` `code` and `message` are kept together, up to 500 characters. ## Response [#response] ```json tab="Saved" { "errorId": 0, "status": "success" } ``` ```json tab="Not found" { "errorId": 16, "errorCode": "ERROR_NO_SUCH_CAPCHA_ID", "errorDescription": "Task not found or expired" } ``` `ERROR_NO_SUCH_CAPCHA_ID` (CapSolver code: `ERROR_TASKID_INVALID`) means one of these: - The task id is wrong. - The task is still being solved. - The time to report on it has passed (see above). - It belongs to another account. A `task_id` from the native [`POST /solve`](/docs/api/solve) works here too, sent as `taskId`. On the native API, use [`POST /feedback`](/docs/api/feedback). --- # Compatible error codes > Every errorCode the compatible API returns, and what it means. Source: https://docs.peak.fo/docs/compat/errors Every response from the compatible API is HTTP `200`. A failure has `errorId` above `0`, an `errorCode`, and an `errorDescription` in words: ```json { "errorId": 12, "errorCode": "ERROR_CAPTCHA_UNSOLVABLE", "errorDescription": "Challenge was flagged - try using a different proxy with a cleaner IP reputation" } ``` The codes follow the service your code is written for: - **2Captcha, Anti-Captcha and CapMonster code** gets their `errorId` numbers and `errorCode` names. - **CapSolver code** gets CapSolver's `errorCode` names, always with `errorId` `1`. A request is treated as CapSolver code when its task type starts with `AntiTurnstile` or is `AntiCloudflareTask`, or when its `taskId` is a UUID. `errorDescription` uses the same words as the native API's `error`, so it often says more than the code. None of these are charged. ## Codes [#codes] | `errorId` | `errorCode` | CapSolver `errorCode` | What happened | What to do | | --------- | --------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | | `1` | `ERROR_KEY_DOES_NOT_EXIST` | `ERROR_KEY_DENIED_ACCESS` | The key is missing, wrong, or turned off. | Use an active key from [Dashboard → API keys](https://peak.fo/dashboard/keys). | | `55` | `ERROR_ACCOUNT_SUSPENDED` | `ERROR_KEY_DENIED_ACCESS` | Your account is suspended. | [Contact support](/docs/support). | | `10` | `ERROR_ZERO_BALANCE` | `ERROR_ZERO_BALANCE` | Your balance is below the task's price, the package is used up or expired, or the package doesn't cover this task. | [Top up](https://peak.fo/dashboard/topup), or use another key. | | `2` | `ERROR_NO_SLOT_AVAILABLE` | `ERROR_RATE_LIMIT` | You're over your key's rate limit. | Retry in a moment. See [Rate limits](/docs/api#rate-limits). | | `2` | `ERROR_NO_SLOT_AVAILABLE` | `ERROR_SERVICE_UNAVALIABLE` | The task type is turned off for now, no solver is free, or something went wrong on our side. | Retry in a few seconds. | | `110` | `ERROR_BAD_PARAMETERS` | `ERROR_INVALID_TASK_DATA` | A field is missing or invalid: `websiteURL`, `websiteKey`, the proxy, `htmlPageBase64`, `action`, `cData`, the user-agent or the challenge page. | Fix the field that `errorDescription` names. | | `22` | `ERROR_TASK_ABSENT` | `ERROR_INVALID_TASK_DATA` | The body has no `task` object. | Send the task in `task`. | | `23` | `ERROR_TASK_NOT_SUPPORTED` | `ERROR_TASK_NOT_SUPPORTED` | The task type isn't one Peak Solutions solves. | Use a [supported task type](/docs/compat#supported-services). | | `21` | `ERROR_IP_BLOCKED` | `ERROR_TASK_NOT_SUPPORTED` | The target site or sitekey is blocked, or needs a top-up first. `errorDescription` says which. | [Contact support](/docs/support) if you think it's a mistake. | | `16` | `ERROR_NO_SUCH_CAPCHA_ID` | `ERROR_TASKID_INVALID` | The task doesn't exist, has expired, or belongs to another account. | Create a new task. See [Task not found](/docs/compat/get-task-result#task-not-found). | | `12` | `ERROR_CAPTCHA_UNSOLVABLE` | `ERROR_CAPTCHA_UNSOLVABLE` | The solve failed: it timed out, the challenge flagged the request, or the solver couldn't produce a result. | Retry, if needed with a different proxy. | | `25` | `ERROR_PROXY_CONNECT_REFUSED` | `ERROR_PROXY_BANNED` | Your proxy failed, or Cloudflare blocked its IP. | Check the proxy, or use one with a cleaner IP. | | `31` | `ERROR_RECAPTCHA_INVALID_SITEKEY` | `ERROR_INVALID_TASK_DATA` | The sitekey is wrong for that site. | Check the sitekey belongs to the page. See [Find the sitekey](/docs/find-sitekey). | ## How native codes map [#how-native-codes-map] The solve behind a task is the same one the native API runs, so a failure starts as a native [error code](/docs/api/errors) and is sent as the code below. | Native `error_code` | Compatible code | | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | `missing_api_key`, `invalid_api_key`, `api_key_inactive` | `ERROR_KEY_DOES_NOT_EXIST` | | `account_suspended` | `ERROR_ACCOUNT_SUSPENDED` | | `insufficient_balance`, `package_exhausted`, `task_not_authorized` | `ERROR_ZERO_BALANCE` | | `rate_limited` | `ERROR_NO_SLOT_AVAILABLE` | | `task_disabled`, `proxyless_unavailable`, `no_servers`, `billing_error`, `auth_error`, `internal_error` | `ERROR_NO_SLOT_AVAILABLE` | | `missing_fields`, `invalid_proxy`, `invalid_action`, `invalid_cdata`, `invalid_html`, `invalid_request_data`, `unsupported_user_agent`, `proxy_required`, `invalid_request_body`, `request_too_large` | `ERROR_BAD_PARAMETERS` | | `task_blocked` | `ERROR_IP_BLOCKED` | | `proxy_error`, `ip_blocked` | `ERROR_PROXY_CONNECT_REFUSED` | | `invalid_sitekey` | `ERROR_RECAPTCHA_INVALID_SITEKEY` | | `timeout`, `solve_failed`, `challenge_flagged`, `turnstile_failed`, `no_challenge`, `solver_error`, `unknown`, and any other | `ERROR_CAPTCHA_UNSOLVABLE` | --- # Pricing > What each task costs, per solve or in packages. Source: https://docs.peak.fo/docs/pricing You only pay for successful solves. Failed solves and rejected requests are free, and every successful solve returns its price in `cost`. New accounts can claim 1,000 free solves ($0.90 of credit) from the [dashboard](https://peak.fo/dashboard): click **Claim 1,000 solves**. No card needed. Some sites can't be solved with trial credit. On those, `error` says the target is blocked for trial credits: [top up](https://peak.fo/dashboard/topup) and they work within a minute. ## Pay per solve [#pay-per-solve] Top up your balance in [Dashboard → Top up](https://peak.fo/dashboard/topup), then use any task. Each successful solve is taken from your balance. | Task | `task_type` | Per 1,000 solves | Per solve | | -------------------------------------------------------- | ------------------------ | ---------------- | --------- | | [Turnstile](/docs/tasks/turnstile) | `turnstiletask` | $0.90 | $0.0009 | | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless) | `turnstiletaskproxyless` | $0.90 | $0.0009 | | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | `cloudflare5stask` | $1.00 | $0.001 | ## Packages [#packages] Solving a lot? A package gives you a set number of solves at a lower price, valid for 30 days. Solves come out of the package instead of your balance. Check what's left with [`/balance`](/docs/api/balance). | Solves | Price | Per 1,000 | | ------ | ----- | --------- | | 50K | $25 | $0.50 | | 100K | $47 | $0.47 | | 200K | $88 | $0.44 | | 500K | $200 | $0.40 | | 1M | $350 | $0.35 | | Solves | Price | Per 1,000 | | ------ | ----- | --------- | | 50K | $30 | $0.60 | | 100K | $55 | $0.55 | | 200K | $100 | $0.50 | | 500K | $225 | $0.45 | | 1M | $400 | $0.40 | See the current packages and buy one at [peak.fo/#pricing](https://peak.fo/#pricing). Questions about pricing? [Contact support](/docs/support). --- # Referrals & App IDs > Earn balance by referring people, or by building tools on Peak Solutions. Source: https://docs.peak.fo/docs/earn There are two ways to earn. Both pay straight into your balance, with no minimum and no cap, and you can spend it on solves right away. ## Referrals [#referrals] Share your referral link. Anyone who signs up through it is tied to your account, and you get **20%** of every top-up they make, for as long as they keep using Peak Solutions. Your link is in [Dashboard → Referrals](https://peak.fo/dashboard/referrals) and looks like this: ```txt https://peak.fo/?ref=YOURCODE ``` You can't refer yourself. Free trial solves don't count, because referrals are paid on top-ups. ## App IDs [#app-ids] Building a tool, bot or SDK on Peak Solutions? Create an app ID in [Dashboard → Developer](https://peak.fo/dashboard/developer) and send it as `appId` in every solve. Each successful solve that carries it credits you a share of what that solve cost. Your share is shown next to each app ID in the dashboard. ```json title="POST https://api.peak.fo/solve" { "task_type": "turnstiletaskproxyless", "url": "https://example.com/login", "sitekey": "0x4AAAAAAA...", "appId": "app_your_app_id" } ``` `appId` is optional and never changes how the solve works. Requests without it, or with an unknown one, are solved the same way. A solve earns you credit when: - It's made by another account, not your own. - That account has paid for something, so free trial solves don't count. - You've paid for something yourself. - Neither of you referred the other. You can create up to 25 app IDs, for example one per tool, to see which one earns what. --- # Support > Where to get help, check the service status, and follow news. Source: https://docs.peak.fo/docs/support ## Chat with us [#chat-with-us] Open [peak.fo/support](https://peak.fo/support). The chat opens by itself and goes straight to the Peak Solutions team. You can also start the chat from the button in the bottom right corner of any page on [peak.fo](https://peak.fo). ## Email [#email] [support@peak.fo](mailto:support@peak.fo). Best for account or billing questions that need detail. ## Service status [#service-status] [peak.fo/status](https://peak.fo/status) shows whether each task is solving normally over the last 5 hours, measured from real solves. If solves suddenly start failing, check it first. ## Telegram [#telegram] | Channel | What's posted there | | ------------------------------------------ | ----------------------------------------- | | [@peakfo](https://t.me/peakfo) | News, new tasks and announcements. | | [@peakfostatus](https://t.me/peakfostatus) | Outages, and updates when they're fixed. | ## What to send us [#what-to-send-us] You'll get an answer faster if you include: - The `task_id` from the response, if you got one. - The `task_type` and the `url` you were solving. - The `error_code` and `error` you got back. - Roughly when it happened, with your time zone. - The first few characters of your API key, such as `pk_a1b2`. Nobody from Peak Solutions will ever ask for it. Anyone who has it can spend your balance. If a token or cookie didn't work on the site, you can also report it from your code with [`POST /feedback`](/docs/api/feedback). ## Try it without code [#try-it-without-code] The [Playground](https://peak.fo/dashboard/playground) in your dashboard sends real solves from your browser. Use it to check that a site and sitekey work before you write any code.