#
hCaptcha
3 Types of hCaptcha challenges exist:
hcaptcha
- 3x3 grid of images. Select all answers.hcaptcha_area_select
- One image. Click on or draw a box around one answer.hcaptcha_multiple_choice
- One large image and multiple choices of small images and/or text. Select one answer.
2
solutions out of 9
choices
2
solutions out of 9
choices
[x, y]
point solution
[x, y, w, h]
box solution
1
solution out of 3
choices
1
solution out of 2
choices
#
Solving hcaptcha
#
1. Submit the challenge
POST https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'type': 'hcaptcha',
'task': 'Please click each image containing a cupcake',
'image_urls': [
'https://nopecha.com/image/demo/hcaptcha/0.png',
'https://nopecha.com/image/demo/hcaptcha/1.png',
'https://nopecha.com/image/demo/hcaptcha/2.png',
'https://nopecha.com/image/demo/hcaptcha/3.png',
'https://nopecha.com/image/demo/hcaptcha/4.png',
'https://nopecha.com/image/demo/hcaptcha/5.png',
'https://nopecha.com/image/demo/hcaptcha/6.png',
'https://nopecha.com/image/demo/hcaptcha/7.png',
'https://nopecha.com/image/demo/hcaptcha/8.png'
]
}
Retrieve solution with the data value
{
'data': 'IiIHk9IjU1LjAyMiIgd'
}
#
2. Get the solution
GET https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'id': 'IiIHk9IjU1LjAyMiIgd'
}
AI has solved the challenge
AI has not yet solved the challenge
{
'data': [
false, false, true, // Click on the 3rd image
false, true, false, // Click on the 5th image
true, false, false // Click on the 7th image
]
}
{
'error': 14,
'message': 'Incomplete job'
}
#
Solving hcaptcha_area_select
#
1. Submit the challenge
POST https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'type': 'hcaptcha_area_select',
'task': "Draw a box around the cat's head",
'image_urls': ['https://developers.nopecha.com/static/hcaptcha_area_select_crop_0.png']
}
Retrieve solution with the data value
{
'data': 'IiIHk9IjU1LjAyMiIgd'
}
#
2. Get the solution
GET https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'id': 'IiIHk9IjU1LjAyMiIgd'
}
AI has solved the challenge
AI has not yet solved the challenge
{
'data': {
x: 42, // The X position of the left side of the box, as % of image width (0-100)
y: 10, // The Y position of the top side of the box, as % of image height (0-100)
w: 18, // Width of the box as % of image width (0-100)
h: 19, // Height of the box as % of image height (0-100)
}
}
{
'error': 14,
'message': 'Incomplete job'
}
For challenges requiring only one click, use the x
and y
values in the response to click that location.
#
Solving hcaptcha_multiple_choice
#
1. Submit the challenge
POST https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'type': 'hcaptcha_multiple_choice',
'choices': [
'Bedroom',
'Living room',
'Kitchen',
],
'image_urls': ['https://developers.nopecha.com/static/hcaptcha_multiple_choice_crop_0.png']
}
Retrieve solution with the data value
{
'data': 'IiIHk9IjU1LjAyMiIgd'
}
#
2. Get the solution
GET https://api.nopecha.com/
{
'key': 'MY_NOPECHA_KEY',
'id': 'IiIHk9IjU1LjAyMiIgd'
}
AI has solved the challenge
AI has not yet solved the challenge
{
'data': 'Bedroom'
}
{
'error': 14,
'message': 'Incomplete job'
}
#
Example code using client libraries
# Install the client using the following command:
# pip install --upgrade nopecha
import nopecha
nopecha.api_key = 'YOUR_API_KEY'
# Call the Recognition API
clicks = nopecha.Recognition.solve(
type='hcaptcha',
task='Please click each image containing a cat-shaped cookie.',
image_urls=[
f"https://nopecha.com/image/demo/hcaptcha/{i}.png" for i in range(9)],
)
# Print the grids to click
print(clicks)
// Install the client using the following command:
// npm i nopecha
const { Configuration, NopeCHAApi } = require('nopecha');
const configuration = new Configuration({
apiKey: 'YOUR_API_KEY',
});
const nopecha = new NopeCHAApi(configuration);
(async () => {
// Call the Recognition API
const clicks = await nopecha.solveRecognition({
type: 'hcaptcha',
task: 'Please click each image containing a cat-shaped cookie.',
image_urls: Array.from({length: 9}, (_, i) => {
return `https://nopecha.com/image/demo/hcaptcha/${i}.png`
}),
});
// Print the grids to click
console.log(clicks);
})();