Introduction
What STACK does
STACK answers PopularCaptcha image challenges. Your client fetches a challenge from PopularCaptcha as usual (the getcaptcha response), sends that object and its images to STACK, and gets back an answers object to submit to PopularCaptcha's checkcaptcha.
STACK does not issue captcha tokens: your client stays in control of the session and submits the answers itself. All requests and responses are JSON over HTTPS, and every endpoint lives under http://stack.local/v1.
- Billed only when solved
- A challenge that comes back
unsolved, an error, a timeout or a busy response is never charged. - Pay as you go or plans
- $0.50 per 1,000 solves, or a daily plan with a solve quota at a lower price per solve. See pricing.
Authentication
Send your API key
Every request needs your API key. Find it in the dashboard after signing up; keys start with stk_. Send it in the Authorization header:
Authorization: Bearer stk_your_api_keyA missing or wrong key returns 401 invalid_key. Repeated invalid keys from the same network are throttled with 429 rate_limited.
Warning
Keep your key on the server
Quick start
First solve in four steps
- Create an account
- Sign up, then top up from $5.00 or pick a daily plan in the dashboard. Solves are paid from your plan quota or your balance.
- Copy your API key
- Copy it from the dashboard and export it as
STACK_API_KEY. - Send a challenge
- Fetch a challenge from PopularCaptcha with your client, then send it with its images to
POST /v1/recognition. - Submit the answers
- If
statusis"solved", submitanswerstocheckcaptcha. If it is"unsolved", fetch a new challenge: you were not charged.
curl http://stack.local/v1/recognition \
-H "Authorization: Bearer $STACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"challenge": {
"key": "E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"request_type": "image_label_binary",
"requester_question": { "en": "Please click each image containing a bicycle" },
"tasklist": [
{ "datapoint_uri": "https://imgs.popularcaptcha.com/a1f3...", "task_key": "6f1c2b9e-..." },
{ "datapoint_uri": "https://imgs.popularcaptcha.com/c47d...", "task_key": "9a0e5d14-..." }
]
},
"images": {
"https://imgs.popularcaptcha.com/a1f3...": "/9j/4AAQSkZJRgABAQ...",
"https://imgs.popularcaptcha.com/c47d...": "/9j/4AAQSkZJRgABAQ..."
}
}'POST /v1/recognition
Recognize a challenge
Answers one PopularCaptcha image challenge. The call returns when the challenge is answered (or found unanswerable), so a single request covers the whole challenge.
Request
Headers: Authorization: Bearer stk_... (or X-API-Key) and Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
challenge | object | yes | The JSON object returned by PopularCaptcha's getcaptcha, unchanged. It must contain request_type and a tasklist of 1 to 40 tasks. |
images | object | no | Map of image URL to base64-encoded image bytes for the images the challenge references (up to 80 images, 6 MB each). May be omitted when every URL in the challenge is on the captcha provider's image host: STACK then downloads the images itself, which is slower. |
curl http://stack.local/v1/recognition \
-H "Authorization: Bearer $STACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"challenge": {
"key": "E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"request_type": "image_label_binary",
"requester_question": { "en": "Please click each image containing a bicycle" },
"tasklist": [
{ "datapoint_uri": "https://imgs.popularcaptcha.com/a1f3...", "task_key": "6f1c2b9e-..." },
{ "datapoint_uri": "https://imgs.popularcaptcha.com/c47d...", "task_key": "9a0e5d14-..." }
]
},
"images": {
"https://imgs.popularcaptcha.com/a1f3...": "/9j/4AAQSkZJRgABAQ...",
"https://imgs.popularcaptcha.com/c47d...": "/9j/4AAQSkZJRgABAQ..."
}
}'Response
200 OK means the request was processed. Check status to see whether you got answers.
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Task id. The same id is listed in the solve log on your dashboard's Usage page. |
status | "solved" | "unsolved" | solved: answers are included and the solve is billed once. unsolved: the recognizer was not confident; answers is null and nothing is charged. |
answers | object | null | Exactly what goes into checkcaptcha. Submit it as is. |
request_type | string | The challenge type, echoed from the challenge. |
billed | "plan" | "free" | "balance" | null | What paid for this solve: your plan's daily quota, a free solve credited by support, or your balance. null when nothing was charged. |
cost | number | USD taken from your balance for this request. 0 unless billed is balance. |
ms | number | Time spent on the request on our side, in milliseconds. |
reason | string | Only on unsolved: why no answers were returned. |
{
"id": "3d6f0a52-8c1e-4b7a-9f2d-5e8c1a7b4d90",
"status": "solved",
"answers": {
"6f1c2b9e-...": "true",
"9a0e5d14-...": "false"
},
"request_type": "image_label_binary",
"billed": "balance",
"cost": 0.0005,
"ms": 412
}POST /v1/funcaptcha
Answer a FunCaptcha
Answers one wave of a FunCaptcha: the game that shows a small puzzle and a pair of arrows, and asks you to cycle to the right picture. Send the game's image, get back the index of the frame to answer with. The endpoint's earlier name, /v1/gamecaptcha, still works.
Warning
It declines rather than guesses
status: "unsolved" with a null index, and is not charged. Keep a fallback for declined waves and you lose nothing by trying STACK first.Supported games
Send the game's own name in variant exactly as the game data gives it; respellings and version suffixes are recognised. Accuracy below was measured on real waves of each game, every answer checked by hand at full size, and is updated as live results come in.
| Game | variant | What it asks | Right | Typical time |
|---|---|---|---|---|
| Claw machine | claw_machine | Pick the claw holding the prize shown on the left. | 35 of 36 | 0.4 s |
| Hopscotch | hopscotch_v2 | Move the person onto the spot the cross marks. | 7 of 7 | 0.7 s |
| Conveyor belt | conveyor_belt_V2 | The object directly under the claw matches the left image. | 38 of 46 | 0.3 s |
| Pathfinder | pathfinder | The character points at the shortest road. | 8 of 9 | 0.1 s |
| Water cups | waterIconCup | The icon on the left sits on the cup with the most liquid. | 10 of 13 | 0.3 s |
| Icon match | icon_match, match_game, tile* | The frame matching the reference panel. | not yet measured live | 0.2 s |
| Dice and card pairs | dice_pair, card*, numerical* | The two matching cells of a six-cell grid. | not yet measured live | 0.2 s |
| Rotate upright | rotated | Turn the picture the right way up. | not yet measured live | 0.2 s |
Every answer carries a confidence. On the checked waves no wrong answer came with a high one, so a caller with a fallback can set min_confidence to 0.5: claw machine was then right on every wave it answered, conveyor belt on 33 of 37.
| Game | variant | Why |
|---|---|---|
| Dice count | MatchDiceIconCount | Counting one small symbol across every die's top face is not yet reliable enough to answer. |
| Rollball | 3DRollball_v2_* | Reading which way the reference animal faces is not yet reliable enough to answer. |
| Rock groups | rockgroup, rockstack | Counting touching rocks is not yet reliable enough to answer. |
Request
Every field except game_type and image is optional, and every size is a hint: the recognizer measures the image itself and uses these only as a cross-check. Pass them through from the game data when you have them.
| Field | Type | Required | Description |
|---|---|---|---|
game_type | 1 | 3 | 4 | yes | Which family the game belongs to. 4 and 1 are strips you arrow through; 3 is a six-cell grid you click once. |
image | string (base64) | yes | The game image exactly as it was served, base64-encoded. Up to 8 MB. |
variant | string | no | The game's own name for itself, when it gives one. This is the strongest routing signal there is, so send it whenever you have it. |
question | string | no | The instruction text shown to the user, in English, with any markup stripped. |
key_size | [number, number] | no | Width and height of the reference panel, when the game declares one. |
answer_size | [number, number] | no | Width and height of a single answer frame. |
waves | number | no | How many waves the whole challenge has. One request answers one wave. |
wave_index | number | no | Which wave this is, counting from 0. |
min_confidence | number (0-1) | no | Decline rather than answer when the winning margin is below this. Leave it unset to take every answer; raise it only once you have measured how confidence tracks your own pass rate. |
always_answer | boolean | no | Return a best guess instead of declining. Only worth setting when STACK is your last resort for that wave: a guess costs the wave just as a decline does, but it is charged. |
require_validated | boolean | no | Decline any game whose reader has never been graded against the captcha's own verdicts. Those games are answered by default and flagged with validated: false; set this when you keep another solver behind STACK and would rather spend money than a wave on an unproven reader. |
curl http://stack.local/v1/funcaptcha \
-H "Authorization: Bearer $STACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"game_type": 4,
"variant": "hopscotchv2",
"question": "Use the arrows to move the person until they are standing on the same icon",
"image": "<base64 of the game image>",
"key_size": [125, 200],
"answer_size": [200, 200],
"waves": 5,
"wave_index": 0
}'Response
| Field | Type | Description |
|---|---|---|
status | "solved" | "unsolved" | solved: index is set and the wave is billed once. unsolved: the game was declined, index is null and nothing is charged. |
index | number | null | The answer, counting from 0. For a strip it is the answer frame to land on (the reference panel is not counted). For a grid it is the cell, left to right then top to bottom. |
confidence | number | null | How far the winning frame beat the runner-up, from 0 to 1. Useful for logging and for setting min_confidence; it is a margin, not a probability of being right. |
validated | boolean | Whether the reader that answered has been graded against the captcha's own verdicts. false means a real reader read the art but nothing has scored it yet. The answer is a genuine attempt, not a guess. Use require_validated to decline these instead. |
grid_cell | object | Grid games only: the pixel box of the chosen cell, with its centre as cx and cy, so you can click inside it without recomputing the grid. |
billed, cost, ms, id | as above | Same meaning as on /v1/recognition. |
{
"id": "7c9a1e40-5b2d-4f81-a3c6-0d7e2f9b4a15",
"status": "solved",
"index": 2,
"confidence": 0.84,
"validated": true,
"variant": "hopscotchv2",
"game_type": 4,
"billed": "balance",
"cost": 0.0005,
"ms": 196
}{
"id": "4a1d9c73-2f85-4e60-9b17-6c0a8e5d2f39",
"status": "unsolved",
"index": null,
"confidence": null,
"validated": false,
"variant": "3d_rollball_animals",
"game_type": 4,
"billed": null,
"cost": 0,
"ms": 8,
"reason": "This game could not be answered confidently, so no answer was returned and you were not charged."
}GET /v1/me
Account and limits
Your balance, free solves, current plan and thread usage. Free to call.
| Field | Type | Description |
|---|---|---|
balance | number | Balance in USD. |
free_solves | number | Free solves left, when support has credited any (usually 0). |
plan | object | null | Active plan: id, name, daily_limit, used_today and ends_at (ISO 8601). null on pay as you go. |
threads | object | limit: concurrent requests allowed; in_use: requests in flight right now. |
curl http://stack.local/v1/me \
-H "Authorization: Bearer $STACK_API_KEY"{
"balance": 12.4805,
"free_solves": 0,
"plan": {
"id": "pro",
"name": "Pro",
"daily_limit": 75000,
"used_today": 18342,
"ends_at": "2026-11-11T09:30:00+00:00"
},
"threads": { "limit": 25, "in_use": 3 }
}Challenge types
Supported challenge types
STACK reads the type from challenge.request_type; you never have to pick a solver. Every PopularCaptcha image type is covered:
| Challenge | request_type | What you do |
|---|---|---|
| Binary select | image_label_binary | Select every image that matches the prompt. |
| Area select | image_label_area_select | Click the point(s) on an image that match the prompt. |
| Drag and drop | image_drag_drop | Drag pieces to the right place. |
| Video variants | as sent by PopularCaptcha | The video versions of these challenges, sent the same way. |
| FunCaptcha | /v1/funcaptcha | Arrow-through puzzles and six-cell grids. A separate endpoint, because the answer is one index rather than a set of clicks. |
Note
FunCaptcha coverage
In every case answers comes back in the shape checkcaptcha expects for that type. A challenge that cannot be answered confidently is returned as unsolved and not charged.
Errors
Error responses
Errors use standard HTTP status codes and always have the same JSON shape. Branch on error.code; the message is meant for humans and may change. Nothing that fails is charged.
{
"error": {
"code": "thread_limit",
"message": "Thread limit reached: 25 concurrent requests on your plan."
}
}| Status | Code | Meaning | Charged |
|---|---|---|---|
| 400 | bad_request | A field is missing or invalid (for example no challenge.tasklist). The message says which. | no |
| 400 | bad_json | The body is not a JSON object. | no |
| 401 | invalid_key | The API key is missing, malformed or has been reset. | no |
| 402 | insufficient_balance | No plan quota left and the balance cannot pay for a solve. | no |
| 402 | quota_exhausted | Today's plan quota is used up and the balance cannot cover overflow solves. | no |
| 403 | account_banned | The account is suspended. | no |
| 413 | too_large | The request body is over 20 MB. | no |
| 429 | thread_limit | Your account already has as many requests in flight as it has threads. | no |
| 429 | rate_limited | Too many requests with an invalid API key from your network. | no |
| 500 | internal_error | Unexpected error on our side. Safe to retry. | no |
| 502 | upstream_error | The recognizer failed on this challenge (other recognizer codes are possible). | no |
| 503 | busy | All solvers are busy. Retry after the Retry-After header. | no |
| 504 | timeout | Recognition took too long. | no |
Limits and priority
Limits, threads and queue priority
| Limit | Value |
|---|---|
| Request body | 20 MB |
| Tasks per challenge | 40 |
| Images per request | 80 |
| Size per image | 6 MB |
Threads
Threads are the number of requests your account can have in flight at once. A request beyond the limit is not queued: it fails immediately with 429 thread_limit (free). Read your limit from GET /v1/me and size your worker pool to match.
| Option | Threads | Daily solves | Queue priority |
|---|---|---|---|
| Pay as you go | 10 | Pay per solve | 4 of 4, top |
| Starter | 5 | 5,000 | 1 of 4 |
| Basic | 10 | 25,000 | 2 of 4 |
| Pro | 25 | 75,000 | 3 of 4 |
| Enterprise | 50 | 200,000 | 4 of 4, top |
Queue priority
When every solver is busy, requests wait briefly in a queue. Pay as you go and Enterprise share the top level and are served first, then Pro, Basic and Starter, in that order. Within the same level it is first come, first served. If no solver frees up in time you get 503 busy with a Retry-After header, and nothing is charged.
Billing rules
How solves are billed
- What is charged
- Only solved challenges, once per challenge. Unsolved, errors, timeouts and busy responses are free.
- Billing order
- Your plan's daily quota (
billed: "plan"), then any free solves credited by support ("free"), then your balance at $0.50 per 1,000 ("balance"). - Daily reset
- Plan quotas reset every day at 00:00 UTC. Solves beyond the quota bill from your balance, so you are never cut off;
402 quota_exhaustedappears only when the balance cannot cover them. - Plans
- Bought from your balance, monthly or quarterly (3 months for the price of 2). Switching plans credits the unused part of the current one; buying the same plan extends it. Auto-renew renews from balance.
- Deposits
- From $5.00 in Litecoin, sent straight to STACK and credited after 1 confirmation, or in other crypto through OxaPay. Your balance never expires.
Best practices
Integration checklist
- Send images inline
- Include every image as base64 in
images. Letting STACK download them works for images on the captcha provider's image host but adds latency. - Reuse connections
- Keep one HTTP client (a
requests.Session, or Node's built-infetch) for all calls so TLS handshakes are not repeated. - Retry 503 with backoff
- Honour
Retry-Afterwhen present, otherwise back off exponentially with a little jitter. Busy responses are free. - Respect your thread limit
- Cap concurrency at
threads.limitfrom/v1/meinstead of running into429 thread_limit. - Use generous timeouts
- Allow at least 60 seconds per recognition request.
import random
import time
def recognize(payload: dict, attempts: int = 4) -> dict:
for attempt in range(attempts):
r = session.post(API, json=payload, timeout=90)
if r.status_code not in (429, 503) or attempt == attempts - 1:
break
# honour Retry-After when present, otherwise back off exponentially with jitter
wait = float(r.headers.get("Retry-After", 0)) or min(8, 0.5 * 2 ** attempt)
time.sleep(wait + random.random() * 0.25)
body = r.json()
if not r.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
return bodySupport
Getting help
Questions about an integration, a payment or your account? Reach us from your dashboard while signed in. If something looks wrong right now, check the live status page first.