# Recognition API Quickstart

Send **CAPTCHA images or audio** to the [!badge variant="primary" text="Recognition API"] and receive **instructions on where to click or what text to enter**.
- Pros

    [!badge variant="success" text=":icon-plus:"] Faster and consumes fewer credits than the [!badge variant="primary" text="Token API"].

- Cons

    [!badge variant="danger" text=":icon-dash:"] Browser may be required (e.g. Chrome, Firefox, Edge, Opera, Brave).

    [!badge variant="danger" text=":icon-dash:"] Requires engineering natural mouse and keyboard actions and dispatching trusted JavaScript events.

!!!
The official [Chrome Extension](https://nopecha.com/chrome) and [Firefox Add-on](https://nopecha.com/firefox) 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](https://nopecha.com/api-reference/#postAwscaptcha).
!!!

---

## Official NopeCHA libraries

[!ref target="blank" text="Python Client"](https://nopecha.com/pypi)

[!ref target="blank" text="Node.js Client"](https://nopecha.com/npm)

---

## Example code using client libraries

+++ Python

```python
# 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"])
```

+++ Node.js

```js
// 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

+++ Python

||| Request :icon-sign-out:
```python
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()
```
||| Response :icon-sign-in:
```python
{
    "data": [
        False, False, True,  # Click on the 3rd image
        False, False, False
    ]
}
```
|||

+++ JavaScript

||| Request :icon-sign-out:
```js
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());
```
||| Response :icon-sign-in:
```js
{
    data: [
        false, false, true,  // Click on the 3rd image
        false, false, false
    ]
}
```
|||

+++
