Token API Quickstart
Send CAPTCHA sitekey and URL to the Token API and receive solved CAPTCHA tokens.
-
Pros
No browser required.
-
Cons
Slower and consumes more credits than the Recognition API .
Proxies may be required to avoid detection on some sites.
For more information, see our API Reference.
Official NopeCHA libraries
Example code using client libraries
# Install the SDK 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 Token API
token = api.solve_cloudflare_turnstile(
'0x4AAAAAAAA-1LUipBaoBpsG',
'https://nopecha.com/demo/turnstile',
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['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 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': 'recaptcha2',
'sitekey': 'b4c45857-0e23-48e6-9017-e28fff99ffb2',
'url': 'https://nopecha.com/demo/recaptcha2',
'key': KEY,
}).json()['data']
requests.get(f"{API}?key={KEY}&id={job_id}").json()
{
'data': 'P0_eyJ...7mbPUw' # reCaptcha2 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: 'recaptcha2',
sitekey: 'b4c45857-0e23-48e6-9017-e28fff99ffb2',
url: 'https://nopecha.com/demo/recaptcha2',
key: KEY,
}),
}).then(r => r.json());
await fetch(`${API}?key=${KEY}&id=${req.data}`)
.then(r => r.json());
{
data: 'P0_eyJ...7mbPUw' // reCaptcha2 token
}