cURL

Test the API directly from your terminal using cURL.

Create Task

curl -X POST https://api.regotcha.com/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "ReCaptchaV3TaskProxyless",
      "websiteURL": "https://example.com",
      "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-",
      "pageAction": "submit",
      "minScore": 0.7
    }
  }'

Get Task Result

curl -X POST https://api.regotcha.com/getTaskResult \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "taskId": "task_abc123xyz"
  }'

Get Balance

curl -X POST https://api.regotcha.com/getBalance \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY"
  }'

Enterprise reCAPTCHA

curl -X POST https://api.regotcha.com/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "ReCaptchaV3EnterpriseTaskProxyless",
      "websiteURL": "https://enterprise-site.com",
      "websiteKey": "6Le-enterprise-key",
      "pageAction": "login",
      "minScore": 0.9
    }
  }'

Bash Script

Complete solve workflow in a single script:

#!/bin/bash

API_KEY="YOUR_API_KEY"
BASE_URL="https://api.regotcha.com"

WEBSITE_URL="https://example.com"
WEBSITE_KEY="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-"

# Create task
RESPONSE=$(curl -s -X POST "$BASE_URL/createTask" \
  -H "Content-Type: application/json" \
  -d "{
    \"clientKey\": \"$API_KEY\",
    \"task\": {
      \"type\": \"ReCaptchaV3TaskProxyless\",
      \"websiteURL\": \"$WEBSITE_URL\",
      \"websiteKey\": \"$WEBSITE_KEY\"
    }
  }")

TASK_ID=$(echo $RESPONSE | jq -r '.taskId')
echo "Task ID: $TASK_ID"

# Poll for result
while true; do
  sleep 3

  RESULT=$(curl -s -X POST "$BASE_URL/getTaskResult" \
    -H "Content-Type: application/json" \
    -d "{
      \"clientKey\": \"$API_KEY\",
      \"taskId\": \"$TASK_ID\"
    }")

  STATUS=$(echo $RESULT | jq -r '.status')

  if [ "$STATUS" = "ready" ]; then
    TOKEN=$(echo $RESULT | jq -r '.solution.gRecaptchaResponse')
    echo "Token: $TOKEN"
    break
  fi

  echo "Status: $STATUS - waiting..."
done

jq Formatting

Pretty-print JSON responses with jq:

curl -s -X POST https://api.regotcha.com/getBalance \
  -H "Content-Type: application/json" \
  -d '{"clientKey": "YOUR_API_KEY"}' | jq .

Output:

{
  "errorId": 0,
  "balance": 1250
}

Environment Variables

Store your API key securely:

# Add to ~/.bashrc or ~/.zshrc
export REGOTCHA_API_KEY="your_api_key_here"

# Use in commands
curl -X POST https://api.regotcha.com/getBalance \
  -H "Content-Type: application/json" \
  -d "{\"clientKey\": \"$REGOTCHA_API_KEY\"}" | jq .