Getting Started
Learn how to integrate AI4CAP.COM into your application in just a few steps.
Step 1: Get Your API Key
- Sign up or log in to your AI4CAP.COM account
- Go to your Dashboard
- Navigate to "API Keys" section
- Click "Create New API Key"
- Copy your API key and keep it secure
Step 2: Submit a CAPTCHA
Send a POST request to /api/captcha/solve
with your CAPTCHA details:
Required Headers:
X-API-Key: your-api-key-here
Content-Type: application/json
Request Body:
{
"type": "recaptcha_v2",
"sitekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"pageurl": "https://example.com"
}
Response:
{
"success": true,
"taskId": "task_123456789",
"status": "processing"
}
Step 3: Get the Result
Poll the result endpoint with your task ID until the CAPTCHA is solved:
Request:
GET /api/captcha/result/task_123456789
Response (when solved):
{
"success": true,
"status": "solved",
"solution": "03AGdBq24PBnbvKMn..."
}
Complete Examples
# 1. Submit a CAPTCHA for solving
curl -X POST http://localhost:3000/api/captcha/solve \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"type": "recaptcha_v2",
"sitekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"pageurl": "https://example.com"
}'
# Response: {"success": true, "taskId": "task_123456789"}
# 2. Get the result
curl -X GET http://localhost:3000/api/captcha/result/task_123456789 \
-H "X-API-Key: your-api-key-here"
# Response: {"success": true, "status": "solved", "solution": "03AGdBq24..."}
// Install axios (optional)
// npm install axios
const API_KEY = 'your-api-key-here';
const API_URL = 'http://localhost:3000/api';
async function solveCaptcha() {
try {
// 1. Submit CAPTCHA
const submitResponse = await fetch(`${API_URL}/captcha/solve`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
},
body: JSON.stringify({
type: 'recaptcha_v2',
sitekey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
pageurl: 'https://example.com'
})
});
const submitData = await submitResponse.json();
const taskId = submitData.taskId;
console.log('Task submitted:', taskId);
// 2. Poll for result
while (true) {
const resultResponse = await fetch(`${API_URL}/captcha/result/${taskId}`, {
headers: {
'X-API-Key': API_KEY
}
});
const resultData = await resultResponse.json();
if (resultData.status === 'solved') {
console.log('CAPTCHA solved:', resultData.solution);
return resultData.solution;
} else if (resultData.status === 'failed') {
throw new Error('CAPTCHA solving failed');
}
// Wait 2 seconds before checking again
await new Promise(resolve => setTimeout(resolve, 2000));
}
} catch (error) {
console.error('Error:', error);
}
}
solveCaptcha();
import requests
import time
API_KEY = 'your-api-key-here'
API_URL = 'http://localhost:3000/api'
def solve_captcha():
try:
# 1. Submit CAPTCHA
response = requests.post(
f'{API_URL}/captcha/solve',
headers={
'Content-Type': 'application/json',
'X-API-Key': API_KEY
},
json={
'type': 'recaptcha_v2',
'sitekey': '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
'pageurl': 'https://example.com'
}
)
data = response.json()
task_id = data['taskId']
print(f'Task submitted: {task_id}')
# 2. Poll for result
while True:
result_response = requests.get(
f'{API_URL}/captcha/result/{task_id}',
headers={'X-API-Key': API_KEY}
)
result_data = result_response.json()
if result_data['status'] == 'solved':
print(f'CAPTCHA solved: {result_data["solution"]}')
return result_data['solution']
elif result_data['status'] == 'failed':
raise Exception('CAPTCHA solving failed')
# Wait 2 seconds before checking again
time.sleep(2)
except Exception as error:
print(f'Error: {error}')
# Run the function
solve_captcha()
Supported CAPTCHA Types
recaptcha_v2
- Google reCAPTCHA v2
recaptcha_v3
- Google reCAPTCHA v3
hcaptcha
- hCaptcha
funcaptcha
- FunCaptcha (Arkose Labs)
geetest
- GeeTest CAPTCHA
Best Practices
• Keep your API keys secure and never expose them in client-side code
• Implement proper error handling for failed requests
• Respect rate limits (100 requests per minute for solving)
• Poll results every 2-3 seconds to avoid excessive requests
• Use webhooks for high-volume applications
You're ready to start solving CAPTCHAs!
For more advanced features and detailed API reference, visit our API Documentation.