👑 CaptchaKings
  • Home
  • Features
  • Pricing
  • Documentation
Login Sign Up

cURL Captcha Solver

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.

Image Captcha: One Command

The image API is synchronous — upload the file, get the text back immediately. This is the same endpoint documented in the API docs:

bash
curl -X POST https://captchakings.com/api/process.php \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Response (success):

json
{
  "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:

bash
curl -s -X POST https://captchakings.com/api/process.php \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" | jq -r '.data.prediction'

reCAPTCHA: Two Commands

reCAPTCHA v2/v3, hCaptcha and AWS WAF are token tasks. Step 1 — create the task and grab the taskId:

bash — create task
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:

bash — get result
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'

Full Bash Solver Script (Cron-Ready)

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:

solve_recaptcha.sh
#!/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):

crontab
*/15 * * * * CAPTCHAKINGS_KEY=ck_xxx /opt/scripts/solve_recaptcha.sh "https://example.com/form" "6Lc...KEY" > /var/run/recaptcha_token.txt

PowerShell on Windows

No curl needed — Invoke-RestMethod handles the JSON endpoints natively:

solve.ps1
$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:

image.ps1 (PowerShell 7+)
$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

Endpoint Recap

Captcha TypeEndpointResult
Image captchacaptchakings.com/api/process.phpSolved text (synchronous)
reCAPTCHA / hCaptcha / AWS WAFapi.captchakings.com/createTaskToken (async, poll getTaskResult)
2Captcha-compatiblecaptchakings.com/in.php / res.phpDrop-in migration format

Best Practices

  • -s for scripts, -v for debugging — silent mode keeps output clean for pipes and jq.
  • Poll every 3 seconds with a hard 120s deadline; typical reCAPTCHA v2 solves take 5–20 seconds.
  • Keep the key in an env var (CAPTCHAKINGS_KEY), not in the script or crontab history.
  • Exit codes matter in cron: the bash script above exits 1 on failure so cron notifies you instead of silently writing garbage.
  • Batch image solves with xargs for bulk jobs: ls *.jpg | xargs -P8 -I{} curl ... -F "captcha=@{}".

FAQ

Can I solve a captcha with a single cURL command?

For image captchas, yes — one multipart POST returns the solved text synchronously. reCAPTCHA needs two: createTask then poll getTaskResult.

How do I parse the JSON in bash?

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.

Does this work in PowerShell?

Yes — Invoke-RestMethod covers the JSON task endpoints on any PowerShell version, and -Form handles multipart image uploads on PowerShell 7+. Examples above.

Can I run this from cron?

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.

Integration Guides for Other Languages

  • Python Captcha Solver Guide
  • Node.js Captcha Solver Guide
  • PHP Captcha Solver Guide
  • reCAPTCHA Solver — How It Works
  • Full API Documentation
  • Free Browser Tools (no code)

Start solving from your terminal today

50 free solves on signup — test with your own captchas.

Get Your API Key

👑 CaptchaKings

AI-powered captcha solving API with 95% success rate. Trusted by developers worldwide.

Compare

  • Price Comparison
  • vs 2Captcha
  • vs CapSolver
  • vs CapMonster
  • vs Anti-Captcha

Legal

  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Documentation

© 2026 CaptchaKings. All rights reserved.