Terminal one-liners, bash scripts & PowerShell — updated August 2026
TL;DR: Image captchas solve in one cURL command. reCAPTCHA takes two: create the task, then poll. Copy the bash script below for a cron-ready solver. 50 free solves on signup, no credit card.
The image API is synchronous — upload the file, get the text back immediately. This is the same endpoint documented in the API docs:
curl -X POST https://captchakings.com/api/process.php \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]"
Response (success):
{
"success": true,
"data": {
"prediction": "7H3kP",
"confidence": 97.5,
"process_time": 0.84
},
"billing": {
"amount_charged": 1,
"balance_remaining": 49,
"plan": "payg"
}
}
Extract just the text with jq:
curl -s -X POST https://captchakings.com/api/process.php \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" | jq -r '.data.prediction'
reCAPTCHA v2/v3, hCaptcha and AWS WAF are token tasks. Step 1 — create the task and grab the taskId:
curl -s -X POST https://api.captchakings.com/createTask \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://example.com/signup",
"websiteKey": "6Lc...SITE_KEY"
}
}' | jq -r '.taskId'
Step 2 — poll every few seconds until status is ready:
curl -s -X POST https://api.captchakings.com/getTaskResult \
-H "Content-Type: application/json" \
-d '{"clientKey": "YOUR_API_KEY", "taskId": 12345678}' \
| jq -r '.solution.gRecaptchaResponse'
Save this as solve_recaptcha.sh. It prints only the token on success and exits non-zero on failure, so cron mails you errors automatically:
#!/usr/bin/env bash
# Usage: ./solve_recaptcha.sh <page_url> <site_key>
set -euo pipefail
API_KEY="${CAPTCHAKINGS_KEY:?Set CAPTCHAKINGS_KEY env var}"
PAGE_URL="$1"
SITE_KEY="$2"
API="https://api.captchakings.com"
# 1. Create task
TASK_ID=$(curl -s -X POST "$API/createTask" \
-H "Content-Type: application/json" \
-d "{\"clientKey\":\"$API_KEY\",\"task\":{\"type\":\"RecaptchaV2TaskProxyless\",\"websiteURL\":\"$PAGE_URL\",\"websiteKey\":\"$SITE_KEY\"}}" \
| jq -r '.taskId // empty')
[ -n "$TASK_ID" ] || { echo "createTask failed" >&2; exit 1; }
# 2. Poll for up to 120 seconds
for i in $(seq 1 40); do
sleep 3
RESULT=$(curl -s -X POST "$API/getTaskResult" \
-H "Content-Type: application/json" \
-d "{\"clientKey\":\"$API_KEY\",\"taskId\":$TASK_ID}")
STATUS=$(echo "$RESULT" | jq -r '.status // "error"')
if [ "$STATUS" = "ready" ]; then
echo "$RESULT" | jq -r '.solution.gRecaptchaResponse'
exit 0
fi
done
echo "Solve timed out" >&2
exit 1
Run it from cron (e.g. every 15 minutes, token saved to a file):
*/15 * * * * CAPTCHAKINGS_KEY=ck_xxx /opt/scripts/solve_recaptcha.sh "https://example.com/form" "6Lc...KEY" > /var/run/recaptcha_token.txt
No curl needed — Invoke-RestMethod handles the JSON endpoints natively:
$ApiKey = $env:CAPTCHAKINGS_KEY
$Api = "https://api.captchakings.com"
# Create task
$created = Invoke-RestMethod -Method Post -Uri "$Api/createTask" `
-ContentType "application/json" `
-Body (@{
clientKey = $ApiKey
task = @{
type = "RecaptchaV2TaskProxyless"
websiteURL = "https://example.com/signup"
websiteKey = "6Lc...SITE_KEY"
}
} | ConvertTo-Json -Depth 5)
# Poll until ready
$token = $null
1..40 | ForEach-Object {
Start-Sleep -Seconds 3
$r = Invoke-RestMethod -Method Post -Uri "$Api/getTaskResult" `
-ContentType "application/json" `
-Body (@{ clientKey = $ApiKey; taskId = $created.taskId } | ConvertTo-Json)
if ($r.status -eq "ready") { $script:token = $r.solution.gRecaptchaResponse; break }
}
if ($token) { $token } else { throw "Solve timed out" }
For the image API on PowerShell 7+, multipart is one call:
$r = Invoke-RestMethod -Method Post `
-Uri "https://captchakings.com/api/process.php" `
-Headers @{ Authorization = "Bearer $env:CAPTCHAKINGS_KEY" } `
-Form @{ captcha = Get-Item ".\captcha.jpg" }
$r.data.prediction
| Captcha Type | Endpoint | Result |
|---|---|---|
| Image captcha | captchakings.com/api/process.php | Solved text (synchronous) |
| reCAPTCHA / hCaptcha / AWS WAF | api.captchakings.com/createTask | Token (async, poll getTaskResult) |
| 2Captcha-compatible | captchakings.com/in.php / res.php | Drop-in migration format |
-s for scripts, -v for debugging — silent mode keeps output clean for pipes and jq.CAPTCHAKINGS_KEY), not in the script or crontab history.ls *.jpg | xargs -P8 -I{} curl ... -F "captcha=@{}".For image captchas, yes — one multipart POST returns the solved text synchronously. reCAPTCHA needs two: createTask then poll getTaskResult.
With jq: curl ... | jq -r '.data.prediction' for images, jq -r '.solution.gRecaptchaResponse' for task results. jq is in every major distro's repos and on Windows via winget.
Yes — Invoke-RestMethod covers the JSON task endpoints on any PowerShell version, and -Form handles multipart image uploads on PowerShell 7+. Examples above.
Yes — the bash script prints only the token to stdout and exits non-zero on failure, so cron emails you errors. A sample crontab line is included above.
50 free solves on signup — test with your own captchas.
Get Your API Key