Reference

Postman Collection for CaptchaAI API Testing

Testing the CaptchaAI API before writing code saves debugging time. This guide provides a ready-to-use Postman collection covering all core endpoints, with environment variables and test scripts.


Setting up the environment

Create a Postman environment with these variables:

Variable Value Description
base_url https://ocr.captchaai.com API base URL
api_key YOUR_API_KEY Your CaptchaAI API key
task_id (empty) Auto-populated after submit

Collection structure

1. Check balance

GET {{base_url}}/res.php

Query params:

{
  "key": "{{api_key}}",
  "action": "getbalance",
  "json": "1"
}

Test script:

const resp = pm.response.json();
pm.test("Balance check succeeds", () => {
  pm.expect(resp.status).to.eql(1);
  pm.expect(parseFloat(resp.request)).to.be.above(0);
});
console.log("Balance: $" + resp.request);

Expected response:

{
  "status": 1,
  "request": "5.42"
}

2. Submit reCAPTCHA v2

POST {{base_url}}/in.php

Body (form-data):

Key Value
key {{api_key}}
method userrecaptcha
googlekey 6Le-SITEKEY
pageurl https://example.com
json 1

Test script:

const resp = pm.response.json();
pm.test("Submit returns task ID", () => {
  pm.expect(resp.status).to.eql(1);
  pm.expect(resp.request).to.match(/^\d+$/);
});
pm.environment.set("task_id", resp.request);
console.log("Task ID: " + resp.request);

Expected response:

{
  "status": 1,
  "request": "71823456"
}

3. Submit Cloudflare Turnstile

POST {{base_url}}/in.php

Body (form-data):

Key Value
key {{api_key}}
method turnstile
sitekey 0x4AAAAAAAB...
pageurl https://example.com
json 1

4. Submit Image CAPTCHA

POST {{base_url}}/in.php

Body (form-data):

Key Value
key {{api_key}}
method base64
body (base64-encoded image string)
json 1

5. Poll result

GET {{base_url}}/res.php

Query params:

{
  "key": "{{api_key}}",
  "action": "get",
  "id": "{{task_id}}",
  "json": "1"
}

Test script:

const resp = pm.response.json();
if (resp.request === "CAPCHA_NOT_READY") {
  console.log("Not ready yet — wait 5s and retry");
} else if (resp.status === 1) {
  pm.test("CAPTCHA solved", () => {
    pm.expect(resp.request.length).to.be.above(10);
  });
  console.log("Token: " + resp.request.substring(0, 60) + "...");
} else {
  pm.test("No error", () => {
    pm.expect.fail("Error: " + resp.request);
  });
}

Expected responses:

{"status": 0, "request": "CAPCHA_NOT_READY"}
{"status": 1, "request": "03AGdBq26ZfPxL..."}

6. Report incorrect solve

GET {{base_url}}/res.php

Query params:

{
  "key": "{{api_key}}",
  "action": "reportbad",
  "id": "{{task_id}}",
  "json": "1"
}

Automating the submit → poll flow

Use Postman's Collection Runner with a pre-request script to add delay between poll attempts:

  1. Set the collection to run requests in order: Balance → Submit → Poll
  2. Add a 5-second delay in the Poll request's pre-request script:
// Pre-request script for Poll
const delay = 5000;
setTimeout(() => {}, delay);
  1. Use postman.setNextRequest("Poll result") in the Poll test script to loop until solved:
const resp = pm.response.json();
if (resp.request === "CAPCHA_NOT_READY") {
  postman.setNextRequest("Poll result"); // retry
} else {
  postman.setNextRequest(null); // stop
}

Error testing requests

Test error responses by sending invalid data:

Invalid API key

{
  "key": "INVALID_KEY",
  "method": "userrecaptcha",
  "googlekey": "6Le-SITEKEY",
  "pageurl": "https://example.com",
  "json": "1"
}

Expected: {"status": 0, "request": "ERROR_WRONG_USER_KEY"}

Zero balance

Expected: {"status": 0, "request": "ERROR_ZERO_BALANCE"}

Missing sitekey

Expected: {"status": 0, "request": "ERROR_WRONG_GOOGLEKEY"}


Importing as cURL

If you prefer cURL over Postman, equivalent commands:

Submit:

curl -X POST "https://ocr.captchaai.com/in.php" \
  -d "key=YOUR_API_KEY&method=userrecaptcha&googlekey=6Le-SITEKEY&pageurl=https://example.com&json=1"

Poll:

curl "https://ocr.captchaai.com/res.php?key=YOUR_API_KEY&action=get&id=71823456&json=1"

Balance:

curl "https://ocr.captchaai.com/res.php?key=YOUR_API_KEY&action=getbalance&json=1"

FAQ

Can I use Postman to test proxy-based solves?

Yes. Add proxy, proxytype, proxyport, proxylogin, and proxypassword fields to the submit request body.

How do I test callback URLs in Postman?

Use a webhook testing service (like webhook.site) as the pingback parameter. CaptchaAI sends the result to that URL when the solve completes.

Does the collection work with Postman's free tier?

Yes. All features used — environment variables, test scripts, and collection runner — are available in Postman's free plan.


Test the CaptchaAI API in Postman today

Get your API key at captchaai.com.


Discussions (0)

No comments yet.

Related Posts

API Tutorials PowerShell + CaptchaAI: Windows Automation CAPTCHA Solving
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Power Shell using Captcha AI's HTTP API with Invoke-Rest Method and Invoke-Web Request.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Power Shell using Captcha AI's HTTP API...

Automation reCAPTCHA v2 Cloudflare Turnstile
Jan 28, 2026
Tutorials Pytest Fixtures for CaptchaAI API Testing
Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI.

Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI. Covers mocking, live integra...

Automation Python reCAPTCHA v2
Apr 08, 2026
Tutorials CAPTCHA Solving Fallback Chains
Implement fallback chains for CAPTCHA solving with Captcha AI.

Implement fallback chains for CAPTCHA solving with Captcha AI. Cascade through solver methods, proxy pools, an...

Automation Python reCAPTCHA v2
Apr 06, 2026
API Tutorials Solving CAPTCHAs with Kotlin and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with Ok Http, Ktor client, and coroutines.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 06, 2026
API Tutorials Solving CAPTCHAs with Swift and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with URLSession, async/await, and Alamofire.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Apr 05, 2026
Use Cases Automated Form Submission with CAPTCHA Handling
Complete guide to automating web form submissions that include CAPTCHA challenges — re CAPTCHA, Turnstile, and image CAPTCHAs with Captcha AI.

Complete guide to automating web form submissions that include CAPTCHA challenges — re CAPTCHA, Turnstile, and...

Python reCAPTCHA v2 Cloudflare Turnstile
Mar 21, 2026
API Tutorials CaptchaAI API Latency Optimization: Faster Solves
Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, and proxy selection.

Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, an...

Automation Python reCAPTCHA v2
Feb 27, 2026
API Tutorials Solving CAPTCHAs with Rust and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Rust using Captcha AI's HTTP API with reqwest, tokio async runtime, and serde.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Rust using Captcha AI's HTTP API with r...

Automation reCAPTCHA v2 Cloudflare Turnstile
Jan 24, 2026
Tutorials Browser Console CAPTCHA Detection: Finding Sitekeys and Parameters
Use browser Dev Tools to detect CAPTCHA types, extract sitekeys, and find parameters needed for Captcha AI API requests.

Use browser Dev Tools to detect CAPTCHA types, extract sitekeys, and find all parameters needed for Captcha AI...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 25, 2026
Use Cases Multi-Step Checkout Automation with CAPTCHA Solving
Automate multi-step e-commerce checkout flows that include CAPTCHA challenges at cart, payment, or confirmation stages using Captcha AI.

Automate multi-step e-commerce checkout flows that include CAPTCHA challenges at cart, payment, or confirmatio...

Automation Python reCAPTCHA v2
Mar 21, 2026
Reference CAPTCHA Token Injection Methods Reference
Complete reference for injecting solved CAPTCHA tokens into web pages.

Complete reference for injecting solved CAPTCHA tokens into web pages. Covers re CAPTCHA, Turnstile, and Cloud...

Automation Python reCAPTCHA v2
Apr 08, 2026
Reference CAPTCHA Solving Performance by Region: Latency Analysis
Analyze how geographic region affects Captcha AI solve times — network latency, proxy location, and optimization strategies for global deployments.

Analyze how geographic region affects Captcha AI solve times — network latency, proxy location, and optimizati...

Automation Python All CAPTCHA Types
Apr 05, 2026
Reference CAPTCHA Types Comparison Matrix 2025
Complete side-by-side comparison of every major CAPTCHA type in 2025 — re CAPTCHA, Turnstile, Gee Test, BLS, h Captcha, and image CAPTCHAs.

Complete side-by-side comparison of every major CAPTCHA type in 2025 — re CAPTCHA, Turnstile, Gee Test, BLS, h...

All CAPTCHA Types Web Scraping
Mar 31, 2026