Get API Key

How to use token

After getTaskResult returns status: "ready", use the solution object. In the Python SDK, solve() returns the solution directly; get_task_result() returns the full response including status and solution.

The SDK retrieves a solution from the API. Your integration submits it to the target website. Check which form field, callback, or backend request your site uses. The function names and selectors below are examples; use those from your page.

reCAPTCHA v2 / v3 / Enterprise#

Use solution.gRecaptchaResponse. If your site submits a g-recaptcha-response field, fill that field in the correct form and follow the site’s normal submission flow:

const token = solution.gRecaptchaResponse;
const field = document.querySelector('[name="g-recaptcha-response"]');
if (field) field.value = token;

If the integration uses a callback, pass the token to the site’s actual function, for example onCaptchaSolved(token). Setting a field does not invoke a callback by itself.

Cloudflare Turnstile#

Use solution.token in the cf-turnstile-response field or in the callback configured when Turnstile was initialized.

const field = document.querySelector('[name="cf-turnstile-response"]');
if (field) field.value = solution.token;

For Cloudflare Challenge, pass the current page’s action, data, pagedata, and current browser userAgent. Keep that User-Agent unchanged when invoking the callback; do not replace it with solution.userAgent. Keep page, proxy, and session parameters consistent. Task parameters.

Yandex SmartCaptcha#

Use solution.token in the smart-token field or pass it to your SmartCaptcha integration’s callback:

const field = document.querySelector('[name="smart-token"]');
if (field) field.value = solution.token;

GeeTest v3#

The solution contains challenge, validate, and seccode. Pass these values to your site’s verification request. If your site uses GeeTest field names, map them as follows:

const verification = {
  geetest_challenge: solution.challenge,
  geetest_validate: solution.validate,
  geetest_seccode: solution.seccode,
};

Creating this object does not send a request or invoke a success handler. Connect it to your site’s existing verification flow. Each new task requires a fresh challenge.

GeeTest v4#

Keep all five solution fields and submit them to your site’s verification flow in its expected format:

const verification = {
  captcha_id: solution.captcha_id,
  lot_number: solution.lot_number,
  pass_token: solution.pass_token,
  gen_time: solution.gen_time,
  captcha_output: solution.captcha_output,
};

Tencent#

Pass the solution values to the callback your site supplied to the TencentCaptcha constructor. Preserve the numeric type of ret:

myCallbackFunction({
  ret: solution.ret,
  ticket: solution.ticket,
  randstr: solution.randstr,
  appid: solution.appid,
});

myCallbackFunction is a placeholder name; use the actual callback from your page.

ImageToText / Coordinates#

ImageToTextTask returns solution.text: enter it in the relevant form field. CoordinatesTask, including image-based Yandex tasks, returns solution.coordinates, a list of {x, y} points. Click them in order relative to the original image’s top-left corner. If the page scales the image, convert the coordinates to its displayed size.

A ready response means the API returned a solution. Your integration must separately check whether the website accepts it.