Skip to content

Popular Captcha

Create Task

POST https://api.captchasonic.com/createTask
Host: api.captchasonic.com
Content-Type: application/json


Request Example

Payload
{
"apiKey": "YOUR_API_KEY",
"task": {
"type": "PopularClassification",
"queries": [
"image1_base64",
"image2_base64"
],
"question": "Please click, hold, and drag all the missing pieces to complete the image.",
"questionType": "objectClick",
"examples": [
"example1_base64",
"example2_base64"
],
"websiteURL": "https://your-website.com",
"websiteKEY": "website-key",
"choices": []
}
}


Response

{
"errorId": 0,
"solution": {
"result": "success"
},
"status": "ready"
}


API Testing Example Scripts

async function fetch_recaptchaV2_result() {
const url = "https://api.captchasonic.com/createTask";
const data = {
"apiKey": "sonic_xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "PopularClassification",
"queries": [
"image1_base64",
"image2_base64"
],
"question": "Please click, hold, and drag all the missing pieces to complete the image.",
"questionType": "objectClick",
"examples": [
"example1_base64",
"example2_base64"
],
"websiteURL": "https://your-website.com",
"websiteKEY": "website-key",
"choices": []
}
}
try {
const response = await fetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data)
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const result = await response.json();
console.log("Response:", result);
return result;
} catch (error) {
console.error("Error fetching OCR result:", error);
return null;
}
}
// Example usage:
fetch_recaptchaV2_result();