Skip to content

Geetest V4

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": "GeetestImage",
"queries": [
"iVBORw0KGgoAAAANSUhEUgAAASwAAADICAIAAADdvUsCAAAgAElEQVR4AezBCZRd9X0n...."
],
"examples": [
"iVBORw0KGgoAAAANSUhEUgAAASwAAADICAIAAADdvUsCAAAgAElEQVR4AezBCZRd9X0n...."
],
"question": "slide",
"websiteURL": "https://your-website.com",
"websiteKEY": "website-key"
}
}


Response

{
"code": 200,
"msg": "",
"answers": {
"slide": [
175,
115
],
"taskId": ""
}
}


API Testing Example Scripts

async function fetch_geetest_result() {
const url = "https://api.captchasonic.com/createTask"; // Replace with the actual API endpoint
const data = {
"apiKey": "sonic_xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "GeetestImage",
"queries": [
"iVBORw0KGgoAAAANSUhEUgAAASwAAADICAIAAADdvUsCAAAgAElEQVR4AezBCZRd9X0n...."
],
"examples": [
"iVBORw0KGgoAAAANSUhEUgAAASwAAADICAIAAADdvUsCAAAgAElEQVR4AezBCZRd9X0n...."
],
"question": "slide",
"websiteURL": "https://your-website.com",
"websiteKEY": "website-key"
}
}
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_geetest_result();