Recognition API Quickstart
Send CAPTCHA images or audio to the Recognition API and receive instructions on where to click or what text to enter.
-
Pros
Faster and consumes fewer credits than the Token API .
-
Cons
Browser may be required (e.g. Chrome, Firefox, Edge, Opera, Brave).
Requires engineering natural mouse and keyboard actions and dispatching trusted JavaScript events.
The official Chrome Extension and Firefox Add-on are the easiest way to use the Recognition API, as they handle all the browser automation in a way that is indistinguishable from a human user.
For more information, see our API Reference.
Official NopeCHA libraries
Example code using client libraries
# Install the client using the following command:
# pip install --upgrade nopecha
# Install the requests library:
# pip install --upgrade requests
from nopecha.api.requests import RequestsAPIClient
api = RequestsAPIClient('YOUR_API_KEY')
# Call the Recognition API
clicks = api.recognize_recaptcha(
'Select all squares with vehicles.',
['https://nopecha.com/image/demo/recaptcha/4x4.png'],
)
# Print the grids to click
print(clicks["data"])
// 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);
})();
Example code with minimal dependencies
Request
Response
API = 'https://api.nopecha.com/'
job_id = requests.post(API, json={
'type': 'funcaptcha',
'image_data': image_data,
'task': 'Pick the alien',
'key': key,
}).json()['data']
requests.get(f"{API}?key={KEY}&id={job_id}").json()
{
"data": [
False, False, True, # Click on the 3rd image
False, False, False
]
}
Request
Response
const API = 'https://api.nopecha.com/';
const req = await fetch(API, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'funcaptcha',
image_data: image_data,
task: 'Pick the alien',
key: KEY,
}),
}).then(r => r.json());
await fetch(`${API}?key=${KEY}&id=${req.data}`)
.then(r => r.json());
{
data: [
false, false, true, // Click on the 3rd image
false, false, false
]
}