# Google reCAPTCHA

Examples of reCAPTCHA
Examples of reCAPTCHA


# Submit the challenge to NopeCHA

POST https://api.nopecha.com/
Parameter Type Required Value
key String Required NopeCHA subscription key.
type String Required recaptcha
task String Required Challenge instruction, in English.
grid String Required Valid values are 4x4, 3x3, and 1x1. 4x4 for 16 grids. 3x3 for 9 grids, array size is 1, and the image size is 350x350 px. 1x1 if all images in the array are 100x100 px.
image_data Array of String Conditional Required if image_urls is missing. Base64-encoded images. Array size must be between 1 and 9.
image_urls Array of String Conditional Required if image_data is missing. Valid image URLs. Array size must be between 1 and 9.
{
    'key': 'MY_NOPECHA_KEY',
    'type': 'recaptcha',
    'task': 'Select all images with a bus',
    'grid': '3x3',
    'image_urls': ['https://nopecha.com/image/demo/recaptcha/3x3.png']
}
Retrieve solution with the data value
{
    'data': 'LjUyMzg0IiBoZWlnaH'
}

# Get the solution from NopeCHA

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': 'LjUyMzg0IiBoZWlnaH'
}
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 5rd image
        true, false, false  // Click on the 7rd image
    ]
}
{
    '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='recaptcha',
    task='Select all squares with vehicles.',
    image_urls=['https://nopecha.com/image/demo/recaptcha/4x4.png'],
    grid='4x4'
)

# 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: 'recaptcha',
        task: 'Select all squares with vehicles.',
        image_urls: ['https://nopecha.com/image/demo/recaptcha/4x4.png'],
        grid: '4x4',
    });

    // Print the grids to click
    console.log(clicks);
})();