Popular Captcha
Create Task
POST https://api.captchasonic.com/createTaskHost: api.captchasonic.comContent-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": [] }}
{ "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": "objectDrag", "examples": [ "example1_base64", "example2_base64" ], "websiteURL": "https://your-website.com", "websiteKEY": "website-key", "choices": [] }}
{ "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": "objectClassify", "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();
import requests
def fetch_recaptchaV2_result(): url = "https://api.captchasonic.com/createTask" headers = {"Content-Type": "application/json"}
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: response = requests.post(url, json=data, headers=headers) response.raise_for_status() # Raise an error for HTTP error responses (4xx, 5xx) return response.json() # Return JSON responseexcept requests.exceptions.RequestException as e: print(f"Error fetching OCR result: {e}") return None
# Example usage:result = fetch_recaptchaV2_result()if result: print("Response:", result)