# 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.

#solving-hcaptcha
#solving-hcaptcha

2 solutions out of 9 choices
2 solutions out of 9 choices

Example hcaptcha
Example hcaptcha

Example hcaptcha
Example hcaptcha

#solving-hcaptcha_area_select
#solving-hcaptcha_area_select

[x, y] point solution
[x, y, w, h] box solution

Example hcaptcha_area_select
Example hcaptcha_area_select

Example hcaptcha_area_select
Example hcaptcha_area_select

#solving-hcaptcha_multiple_choice
#solving-hcaptcha_multiple_choice

1 solution out of 3 choices
1 solution out of 2 choices

Example hcaptcha_multiple_choice
Example hcaptcha_multiple_choice

Example hcaptcha_multiple_choice
Example hcaptcha_multiple_choice


# Solving hcaptcha

# 1. Submit the challenge

POST https://api.nopecha.com/
Parameter Type Required Value
key String Required NopeCHA subscription key.
type String Required hcaptcha
task String Required Challenge instruction, in English.
image_data Array of String Conditional Required if image_urls is missing. Base64-encoded images. Array size must be 9.
image_urls Array of String Conditional Required if image_data is missing. Valid image URLs. Array size must be 9.
image_examples Array of String Optional Base64-encoded images of the challenge examples. Accuracy may improve when this field is provided. Array size must be between 1 and 3.
{
    '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/
Parameter Type Required Value
key String Required NopeCHA subscription key.
id String Required The value of data from POST response.
{
    '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/
Parameter Type Required Value
key String Required NopeCHA subscription key.
type String Required hcaptcha_area_select
task String Required Challenge instruction, in English.
image_data Array of String Conditional Required if image_urls is missing. Base64-encoded images. Array size must be 1.
image_urls Array of String Conditional Required if image_data is missing. Valid image URLs. Array size must be 1.
image_examples Array of String Optional Base64-encoded images of the challenge examples. Accuracy may improve when this field is provided. Array size must be between 1 and 3.
{
    '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']
}

Image displayed on the challenge

Retrieve solution with the data value
{
    'data': 'IiIHk9IjU1LjAyMiIgd'
}

# 2. Get the solution

GET https://api.nopecha.com/
Parameter Type Required Value
key String Required NopeCHA subscription key.
id String Required The value of data from POST response.
{
    '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'
}

Image displayed on the challenge


# Solving hcaptcha_multiple_choice

# 1. Submit the challenge

POST https://api.nopecha.com/
Parameter Type Required Value
key String Required NopeCHA subscription key.
type String Required hcaptcha_multiple_choice
task String Required Challenge instruction, in English.
image_data Array of String Conditional Required if image_urls is missing. Base64-encoded images. Array size must be 1.
image_urls Array of String Conditional Required if image_data is missing. Valid image URLs. Array size must be 1.
choices Array of String Required Text of the choices, in English. Array size must be between 2 and 9.
image_choices Array of String Optional Base64-encoded images of the choices. Accuracy may improve when this field is provided. Array size must be equal to choices .
{
    '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']
}

Image displayed on the challenge

Retrieve solution with the data value
{
    'data': 'IiIHk9IjU1LjAyMiIgd'
}

# 2. Get the solution

GET https://api.nopecha.com/
Parameter Type Required Value
key String Required NopeCHA subscription key.
id String Required The value of data from POST response.
{
    '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);
})();