# Token Quickstart

# Sending CAPTCHA sitekey and URL and getting back CAPTCHA tokens.

  • Pros

    No browser required.

    No proxies required.

  • Cons

    Some coding required.

    Slower and more costly.

    May be detected on some sites.


# Official NopeCHA libraries

Python Client
https://nopecha.com/pypi

Node.js Client
https://nopecha.com/npm


# 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 Token API
token = nopecha.Token.solve(
    type='turnstile',
    sitekey='0x4AAAAAAAA-1LUipBaoBpsG',
    url='https://nopecha.com/demo/turnstile',
    data={
        'action': 'login',
        'cdata': '0000-1111-2222-3333-example-cdata',
    },
    proxy={
        'scheme': 'http',
        'host': '131.171.136.193',
        'port': '7234',
        'username': 'EhV1AVUbhK',
        'password': 'DJ96p39v9z',
    }
)

# Print the token
print(token)
// 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 Token API
    const token = await nopecha.solveToken({
        type: 'turnstile',
        sitekey: '0x4AAAAAAAA-1LUipBaoBpsG',
        url: 'https://nopecha.com/demo/turnstile',
        data: {
            action: 'login',
            cdata: '0000-1111-2222-3333-example-cdata',
        },
        proxy: {
            scheme: 'http',
            host: '131.171.136.193',
            port: '7234',
            username: 'EhV1AVUbhK',
            password: 'DJ96p39v9z',
        },
    });

    // Print the token
    console.log(token);
})();

# Example code with minimal dependencies

Request
Response
API = 'https://api.nopecha.com/token'

job_id = requests.post(API, json={
    'type': 'hcaptcha',
    'sitekey': 'b4c45857-0e23-48e6-9017-e28fff99ffb2',
    'url': 'https://nopecha.com/demo/hcaptcha',
    'key': KEY,
}).json()['data']

requests.get(f"{API}?key={KEY}&id={job_id}").json()
{
    'data': 'P0_eyJ...7mbPUw'  # hCaptcha token
}
Request
Response
const API = 'https://api.nopecha.com/token';

const req = await fetch(API, {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({
        type: 'hcaptcha',
        sitekey: 'b4c45857-0e23-48e6-9017-e28fff99ffb2',
        url: 'https://nopecha.com/demo/hcaptcha',
        key: KEY,
    }),
}).then(r => r.json());

await fetch(`${API}?key=${KEY}&id=${req.data}`)
    .then(r => r.json());
{
    data: 'P0_eyJ...7mbPUw'  // hCaptcha token
}