From 4fda5fd15e21b6eba78a4960dc49194705684766 Mon Sep 17 00:00:00 2001 From: dariyaanis Date: Wed, 18 Nov 2026 18:24:32 +0300 Subject: [PATCH 1/2] docs: expand example usage guides --- examples/async/balance.py | 17 ++++++++---- examples/async/coordinates.py | 12 +++++++-- examples/async/geetest_v3_proxy.py | 20 +++++++++----- examples/async/geetest_v3_proxyless.py | 20 +++++++++----- examples/async/geetest_v4_proxy.py | 12 +++++++-- examples/async/geetest_v4_proxyless.py | 12 +++++++-- examples/async/image_to_text.py | 12 +++++++-- .../async/recaptcha_v2_enterprise_proxy.py | 12 +++++++-- .../recaptcha_v2_enterprise_proxyless.py | 12 +++++++-- examples/async/recaptcha_v2_proxy.py | 12 +++++++-- examples/async/recaptcha_v2_proxyless.py | 12 +++++++-- examples/async/recaptcha_v3.py | 12 +++++++-- examples/async/tencent_proxy.py | 12 +++++++-- examples/async/tencent_proxyless.py | 12 +++++++-- examples/async/turnstile_proxy.py | 12 +++++++-- examples/async/turnstile_proxyless.py | 12 +++++++-- examples/async/yandex_smartcaptcha_image.py | 11 +++++++- .../async/yandex_smartcaptcha_kaleidoscope.py | 16 +++++------- examples/async/yandex_smartcaptcha_proxy.py | 12 +++++++-- .../async/yandex_smartcaptcha_proxyless.py | 12 +++++++-- examples/sync/balance.py | 17 ++++++++---- examples/sync/coordinates.py | 18 +++++++++---- examples/sync/geetest_v3_proxy.py | 26 ++++++++++++------- examples/sync/geetest_v3_proxyless.py | 26 ++++++++++++------- examples/sync/geetest_v4_proxy.py | 18 +++++++++---- examples/sync/geetest_v4_proxyless.py | 18 +++++++++---- examples/sync/image_to_text.py | 18 +++++++++---- .../sync/recaptcha_v2_enterprise_proxy.py | 18 +++++++++---- .../sync/recaptcha_v2_enterprise_proxyless.py | 18 +++++++++---- examples/sync/recaptcha_v2_proxy.py | 18 +++++++++---- examples/sync/recaptcha_v2_proxyless.py | 18 +++++++++---- examples/sync/recaptcha_v3.py | 18 +++++++++---- examples/sync/tencent_proxy.py | 12 +++++++-- examples/sync/tencent_proxyless.py | 12 +++++++-- examples/sync/turnstile_proxy.py | 18 +++++++++---- examples/sync/turnstile_proxyless.py | 18 +++++++++---- examples/sync/yandex_smartcaptcha_image.py | 11 +++++++- .../sync/yandex_smartcaptcha_kaleidoscope.py | 16 +++++------- examples/sync/yandex_smartcaptcha_proxy.py | 12 +++++++-- .../sync/yandex_smartcaptcha_proxyless.py | 12 +++++++-- 40 files changed, 453 insertions(+), 153 deletions(-) diff --git a/examples/async/balance.py b/examples/async/balance.py index 3c81311..7d2b0e8 100644 --- a/examples/async/balance.py +++ b/examples/async/balance.py @@ -1,5 +1,12 @@ -""" -Example: Get account balance with the async client. +"""Example: Check the current captcha solver account balance without creating a captcha task. + +What it does: + This example shows how to check the current Captcha Solver account balance without creating a CAPTCHA task. It uses AsyncCaptchaClient.get_balance() and returns the account balance. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Call await solver.get_balance(); this does not create or poll a CAPTCHA task. + STEP-03 - Print the balance returned by the API. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -25,10 +32,10 @@ from captcha_solver_api import AsyncCaptchaClient # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/async/coordinates.py b/examples/async/coordinates.py index 70663b6..7a4c8dc 100644 --- a/examples/async/coordinates.py +++ b/examples/async/coordinates.py @@ -1,5 +1,13 @@ -""" -Example: Solve a click-based image captcha using CoordinatesTask with the async client. +"""Example: Solve click-based image captchas from bundled local images without a proxy. + +What it does: + This example shows how to solve click-based image CAPTCHAs from bundled local images without a proxy. It uses CoordinatesTask and AsyncCaptchaClient.solve(), returning pixel coordinates to click. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The image, optional instruction image, and click hints come from examples/assets and this file. + STEP-03 - Create CoordinatesTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print pixel coordinates to click. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/geetest_v3_proxy.py b/examples/async/geetest_v3_proxy.py index ce6bc1e..aa50051 100644 --- a/examples/async/geetest_v3_proxy.py +++ b/examples/async/geetest_v3_proxy.py @@ -1,15 +1,23 @@ -""" -Example: Solve a GeeTest v3 challenge with the async client. +"""Example: Solve GeeTest v3 through your own proxy. + +What it does: + This example shows how to solve GeeTest v3 through your own proxy. It uses GeeTestTask and AsyncCaptchaClient.solve(), returning challenge, validate, and seccode values. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the GeeTest values from the target page, fetch a fresh challenge, and provide your proxy settings. + STEP-03 - Create GeeTestTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print challenge, validate, and seccode values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL, gt, and challenge with values from your target page. Important: the challenge value is dynamic. Fetch a fresh one for each request. -NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a -real endpoint -- this script will not run end-to-end as-is. Replace it with a request -to your actual target page (or wherever it exposes a fresh `challenge` value) before -running this example. It's here only to illustrate where that fetch belongs in the flow. + NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a + real endpoint -- this script will not run end-to-end as-is. Replace it with a request + to your actual target page (or wherever it exposes a fresh `challenge` value) before + running this example. It's here only to illustrate where that fetch belongs in the flow. """ import asyncio diff --git a/examples/async/geetest_v3_proxyless.py b/examples/async/geetest_v3_proxyless.py index 1d9ffec..854f9c9 100644 --- a/examples/async/geetest_v3_proxyless.py +++ b/examples/async/geetest_v3_proxyless.py @@ -1,15 +1,23 @@ -""" -Example: Solve a GeeTest v3 challenge with the async client. +"""Example: Solve GeeTest v3 without a proxy. + +What it does: + This example shows how to solve GeeTest v3 without a proxy. It uses GeeTestTaskProxyless and AsyncCaptchaClient.solve(), returning challenge, validate, and seccode values. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and gt from the target page and fetch a fresh challenge for every request. + STEP-03 - Create GeeTestTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print challenge, validate, and seccode values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL, gt, and challenge with values from your target page. Important: the challenge value is dynamic. Fetch a fresh one for each request. -NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a -real endpoint -- this script will not run end-to-end as-is. Replace it with a request -to your actual target page (or wherever it exposes a fresh `challenge` value) before -running this example. It's here only to illustrate where that fetch belongs in the flow. + NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a + real endpoint -- this script will not run end-to-end as-is. Replace it with a request + to your actual target page (or wherever it exposes a fresh `challenge` value) before + running this example. It's here only to illustrate where that fetch belongs in the flow. """ import asyncio diff --git a/examples/async/geetest_v4_proxy.py b/examples/async/geetest_v4_proxy.py index 506af84..bfdda7f 100644 --- a/examples/async/geetest_v4_proxy.py +++ b/examples/async/geetest_v4_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a GeeTest v4 challenge with the async client. +"""Example: Solve GeeTest v4 through your own proxy. + +What it does: + This example shows how to solve GeeTest v4 through your own proxy. It uses GeeTestTask and AsyncCaptchaClient.solve(), returning captcha_output and related validation fields. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and captcha_id from the target page and provide your proxy settings. + STEP-03 - Create GeeTestTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print captcha_output and related validation fields. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/geetest_v4_proxyless.py b/examples/async/geetest_v4_proxyless.py index 5668b8d..caec4f2 100644 --- a/examples/async/geetest_v4_proxyless.py +++ b/examples/async/geetest_v4_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a GeeTest v4 challenge with the async client. +"""Example: Solve GeeTest v4 without a proxy. + +What it does: + This example shows how to solve GeeTest v4 without a proxy. It uses GeeTestTaskProxyless and AsyncCaptchaClient.solve(), returning captcha_output and related validation fields. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and captcha_id from the target page. + STEP-03 - Create GeeTestTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print captcha_output and related validation fields. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/image_to_text.py b/examples/async/image_to_text.py index db6fb9a..48a706d 100644 --- a/examples/async/image_to_text.py +++ b/examples/async/image_to_text.py @@ -1,5 +1,13 @@ -""" -Example: Solve an image captcha with the async client. +"""Example: Recognize text in bundled local captcha images without a proxy. + +What it does: + This example shows how to recognize text in bundled local CAPTCHA images without a proxy. It uses ImageToTextTask and AsyncCaptchaClient.solve(), returning the recognized text. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The images and answer-format hints come from examples/assets and this file. + STEP-03 - Create ImageToTextTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print the recognized text. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/recaptcha_v2_enterprise_proxy.py b/examples/async/recaptcha_v2_enterprise_proxy.py index 4389924..275f632 100644 --- a/examples/async/recaptcha_v2_enterprise_proxy.py +++ b/examples/async/recaptcha_v2_enterprise_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 Enterprise challenge with the async client. +"""Example: Solve reCAPTCHA v2 enterprise through your own proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 Enterprise through your own proxy. It uses RecaptchaV2EnterpriseTask and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any enterprisePayload from the target page, and provide your proxy settings. + STEP-03 - Create RecaptchaV2EnterpriseTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/recaptcha_v2_enterprise_proxyless.py b/examples/async/recaptcha_v2_enterprise_proxyless.py index 10d157f..4d6cfe2 100644 --- a/examples/async/recaptcha_v2_enterprise_proxyless.py +++ b/examples/async/recaptcha_v2_enterprise_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 Enterprise challenge with the async client. +"""Example: Solve reCAPTCHA v2 enterprise without a proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 Enterprise without a proxy. It uses RecaptchaV2EnterpriseTaskProxyless and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any enterprisePayload from the target page. + STEP-03 - Create RecaptchaV2EnterpriseTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/recaptcha_v2_proxy.py b/examples/async/recaptcha_v2_proxy.py index 6cd87d9..bab697f 100644 --- a/examples/async/recaptcha_v2_proxy.py +++ b/examples/async/recaptcha_v2_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 challenge through your own proxy with the async client. +"""Example: Solve reCAPTCHA v2 through your own proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 through your own proxy. It uses RecaptchaV2Task and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page and provide your proxy settings. + STEP-03 - Create RecaptchaV2Task and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/recaptcha_v2_proxyless.py b/examples/async/recaptcha_v2_proxyless.py index 01d2626..f327978 100644 --- a/examples/async/recaptcha_v2_proxyless.py +++ b/examples/async/recaptcha_v2_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 challenge without a proxy with the async client. +"""Example: Solve reCAPTCHA v2 without a proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 without a proxy. It uses RecaptchaV2TaskProxyless and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page. + STEP-03 - Create RecaptchaV2TaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/recaptcha_v3.py b/examples/async/recaptcha_v3.py index d4bb2a7..e606d0d 100644 --- a/examples/async/recaptcha_v3.py +++ b/examples/async/recaptcha_v3.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v3 challenge with the async client. +"""Example: Solve score-based reCAPTCHA v3 without a proxy. + +What it does: + This example shows how to solve score-based reCAPTCHA v3 without a proxy. It uses RecaptchaV3TaskProxyless and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, pageAction, and the required minimum score from the target page. + STEP-03 - Create RecaptchaV3TaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/tencent_proxy.py b/examples/async/tencent_proxy.py index c92644e..d62943b 100644 --- a/examples/async/tencent_proxy.py +++ b/examples/async/tencent_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Tencent captcha challenge with the async client. +"""Example: Solve Tencent captcha through your own proxy. + +What it does: + This example shows how to solve Tencent CAPTCHA through your own proxy. It uses TencentTask and AsyncCaptchaClient.solve(), returning appid, ret, ticket, and randstr values. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the Tencent parameters from the target page and provide your proxy settings. + STEP-03 - Create TencentTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/tencent_proxyless.py b/examples/async/tencent_proxyless.py index a840450..55ceaec 100644 --- a/examples/async/tencent_proxyless.py +++ b/examples/async/tencent_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Tencent captcha challenge with the async client. +"""Example: Solve Tencent captcha without a proxy. + +What it does: + This example shows how to solve Tencent CAPTCHA without a proxy. It uses TencentTaskProxyless and AsyncCaptchaClient.solve(), returning appid, ret, ticket, and randstr values. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, appId, and any non-default captchaScript from the target page. + STEP-03 - Create TencentTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/turnstile_proxy.py b/examples/async/turnstile_proxy.py index f46b797..56b6874 100644 --- a/examples/async/turnstile_proxy.py +++ b/examples/async/turnstile_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Cloudflare Turnstile challenge with the async client. +"""Example: Solve Cloudflare turnstile through your own proxy. + +What it does: + This example shows how to solve Cloudflare Turnstile through your own proxy. It uses TurnstileTask and AsyncCaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the Turnstile parameters from the target page and provide your proxy settings. + STEP-03 - Create TurnstileTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/turnstile_proxyless.py b/examples/async/turnstile_proxyless.py index 76dd7f2..243b5e8 100644 --- a/examples/async/turnstile_proxyless.py +++ b/examples/async/turnstile_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Cloudflare Turnstile challenge with the async client. +"""Example: Solve Cloudflare turnstile without a proxy. + +What it does: + This example shows how to solve Cloudflare Turnstile without a proxy. It uses TurnstileTaskProxyless and AsyncCaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any Challenge-page action, data, and pagedata values from the target page. + STEP-03 - Create TurnstileTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/yandex_smartcaptcha_image.py b/examples/async/yandex_smartcaptcha_image.py index a89202c..6fa40aa 100644 --- a/examples/async/yandex_smartcaptcha_image.py +++ b/examples/async/yandex_smartcaptcha_image.py @@ -1,4 +1,13 @@ -"""Example: Solve an image-based Yandex SmartCaptcha asynchronously. +"""Example: Solve an image-based Yandex SmartCaptcha from bundled local images without a proxy. + +What it does: + This example shows how to solve an image-based Yandex SmartCaptcha from bundled local images without a proxy. It uses YandexSmartCaptchaImageTask and AsyncCaptchaClient.solve(), returning pixel coordinates to click. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The challenge and instruction images come from examples/assets. + STEP-03 - Create YandexSmartCaptchaImageTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print pixel coordinates to click. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/yandex_smartcaptcha_kaleidoscope.py b/examples/async/yandex_smartcaptcha_kaleidoscope.py index e49a799..431d27c 100644 --- a/examples/async/yandex_smartcaptcha_kaleidoscope.py +++ b/examples/async/yandex_smartcaptcha_kaleidoscope.py @@ -1,15 +1,13 @@ -"""Example: Solve an image-based Yandex SmartCaptcha Kaleidoscope asynchronously. +"""Example: Solve a Yandex smartcaptcha kaleidoscope puzzle from a bundled local image without a proxy. -This example reads the bundled Kaleidoscope challenge image, encodes it as -Base64, sends it together with the puzzle-step sequence without a proxy, and -prints how many times to click the slider arrow. It uses -YandexSmartCaptchaKaleidoscopeTask and AsyncCaptchaClient.solve(). +What it does: + This example shows how to solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. It uses YandexSmartCaptchaKaleidoscopeTask and AsyncCaptchaClient.solve(), returning the number of slider-arrow clicks. How it works: -STEP-01 - Configure AsyncCaptchaClient and locate the bundled challenge image. -STEP-02 - Encode the image and create a task with the captured puzzle steps. -STEP-03 - Await solve(), which creates the task and polls for its solution. -STEP-04 - Print the slider-arrow click count, or report the error. + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The challenge image comes from examples/assets and the puzzle-step sequence is captured from the challenge. + STEP-03 - Create YandexSmartCaptchaKaleidoscopeTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print the number of slider-arrow clicks. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/yandex_smartcaptcha_proxy.py b/examples/async/yandex_smartcaptcha_proxy.py index 5cae19b..379b8f8 100644 --- a/examples/async/yandex_smartcaptcha_proxy.py +++ b/examples/async/yandex_smartcaptcha_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Yandex SmartCaptcha challenge (token-based) with the async client. +"""Example: Solve token-based Yandex smartcaptcha through your own proxy. + +What it does: + This example shows how to solve token-based Yandex SmartCaptcha through your own proxy. It uses YandexSmartCaptchaTask and AsyncCaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page and provide your proxy settings. + STEP-03 - Create YandexSmartCaptchaTask and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/async/yandex_smartcaptcha_proxyless.py b/examples/async/yandex_smartcaptcha_proxyless.py index 9537797..1899a24 100644 --- a/examples/async/yandex_smartcaptcha_proxyless.py +++ b/examples/async/yandex_smartcaptcha_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Yandex SmartCaptcha challenge (token-based) with the async client. +"""Example: Solve token-based Yandex smartcaptcha without a proxy. + +What it does: + This example shows how to solve token-based Yandex SmartCaptcha without a proxy. It uses YandexSmartCaptchaTaskProxyless and AsyncCaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure AsyncCaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page. + STEP-03 - Create YandexSmartCaptchaTaskProxyless and pass it to await solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/balance.py b/examples/sync/balance.py index f3a6ae7..f29f826 100644 --- a/examples/sync/balance.py +++ b/examples/sync/balance.py @@ -1,5 +1,12 @@ -""" -Example: Get account balance. +"""Example: Check the current captcha solver account balance without creating a captcha task. + +What it does: + This example shows how to check the current Captcha Solver account balance without creating a CAPTCHA task. It uses CaptchaClient.get_balance() and returns the account balance. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Call solver.get_balance(); this does not create or poll a CAPTCHA task. + STEP-03 - Print the balance returned by the API. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -24,10 +31,10 @@ from captcha_solver_api import CaptchaClient # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/coordinates.py b/examples/sync/coordinates.py index 59c3421..97eee72 100644 --- a/examples/sync/coordinates.py +++ b/examples/sync/coordinates.py @@ -1,5 +1,13 @@ -""" -Example: Solve a click-based image captcha using CoordinatesTask. +"""Example: Solve click-based image captchas from bundled local images without a proxy. + +What it does: + This example shows how to solve click-based image CAPTCHAs from bundled local images without a proxy. It uses CoordinatesTask and CaptchaClient.solve(), returning pixel coordinates to click. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The image, optional instruction image, and click hints come from examples/assets and this file. + STEP-03 - Create CoordinatesTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print pixel coordinates to click. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -29,10 +37,10 @@ from captcha_solver_api.tasks import CoordinatesTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/geetest_v3_proxy.py b/examples/sync/geetest_v3_proxy.py index e91b441..d750b27 100644 --- a/examples/sync/geetest_v3_proxy.py +++ b/examples/sync/geetest_v3_proxy.py @@ -1,15 +1,23 @@ -""" -Example: Solve a GeeTest v3 challenge. +"""Example: Solve GeeTest v3 through your own proxy. + +What it does: + This example shows how to solve GeeTest v3 through your own proxy. It uses GeeTestTask and CaptchaClient.solve(), returning challenge, validate, and seccode values. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the GeeTest values from the target page, fetch a fresh challenge, and provide your proxy settings. + STEP-03 - Create GeeTestTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print challenge, validate, and seccode values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL, gt, and challenge with values from your target page. Important: the challenge value is dynamic. Fetch a fresh one for each request. -NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a -real endpoint -- this script will not run end-to-end as-is. Replace it with a request -to your actual target page (or wherever it exposes a fresh `challenge` value) before -running this example. It's here only to illustrate where that fetch belongs in the flow. + NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a + real endpoint -- this script will not run end-to-end as-is. Replace it with a request + to your actual target page (or wherever it exposes a fresh `challenge` value) before + running this example. It's here only to illustrate where that fetch belongs in the flow. """ import os @@ -33,10 +41,10 @@ from captcha_solver_api.tasks import GeeTestTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/geetest_v3_proxyless.py b/examples/sync/geetest_v3_proxyless.py index 10503e6..d0c8b7e 100644 --- a/examples/sync/geetest_v3_proxyless.py +++ b/examples/sync/geetest_v3_proxyless.py @@ -1,15 +1,23 @@ -""" -Example: Solve a GeeTest v3 challenge. +"""Example: Solve GeeTest v3 without a proxy. + +What it does: + This example shows how to solve GeeTest v3 without a proxy. It uses GeeTestTaskProxyless and CaptchaClient.solve(), returning challenge, validate, and seccode values. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and gt from the target page and fetch a fresh challenge for every request. + STEP-03 - Create GeeTestTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print challenge, validate, and seccode values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL, gt, and challenge with values from your target page. Important: the challenge value is dynamic. Fetch a fresh one for each request. -NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a -real endpoint -- this script will not run end-to-end as-is. Replace it with a request -to your actual target page (or wherever it exposes a fresh `challenge` value) before -running this example. It's here only to illustrate where that fetch belongs in the flow. + NOTE: "https://target-site.com/path/to/geetest/init" below is a PLACEHOLDER, not a + real endpoint -- this script will not run end-to-end as-is. Replace it with a request + to your actual target page (or wherever it exposes a fresh `challenge` value) before + running this example. It's here only to illustrate where that fetch belongs in the flow. """ import os @@ -33,10 +41,10 @@ from captcha_solver_api.tasks import GeeTestTaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/geetest_v4_proxy.py b/examples/sync/geetest_v4_proxy.py index 9d05bdf..dc5234b 100644 --- a/examples/sync/geetest_v4_proxy.py +++ b/examples/sync/geetest_v4_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a GeeTest v4 challenge. +"""Example: Solve GeeTest v4 through your own proxy. + +What it does: + This example shows how to solve GeeTest v4 through your own proxy. It uses GeeTestTask and CaptchaClient.solve(), returning captcha_output and related validation fields. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and captcha_id from the target page and provide your proxy settings. + STEP-03 - Create GeeTestTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print captcha_output and related validation fields. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -28,10 +36,10 @@ from captcha_solver_api.tasks import GeeTestTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/geetest_v4_proxyless.py b/examples/sync/geetest_v4_proxyless.py index 55cb061..9cd765d 100644 --- a/examples/sync/geetest_v4_proxyless.py +++ b/examples/sync/geetest_v4_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a GeeTest v4 challenge. +"""Example: Solve GeeTest v4 without a proxy. + +What it does: + This example shows how to solve GeeTest v4 without a proxy. It uses GeeTestTaskProxyless and CaptchaClient.solve(), returning captcha_output and related validation fields. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and captcha_id from the target page. + STEP-03 - Create GeeTestTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print captcha_output and related validation fields. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -28,10 +36,10 @@ from captcha_solver_api.tasks import GeeTestTaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/image_to_text.py b/examples/sync/image_to_text.py index 892d693..2d4436b 100644 --- a/examples/sync/image_to_text.py +++ b/examples/sync/image_to_text.py @@ -1,5 +1,13 @@ -""" -Example: Solve an Image to Text challenge. +"""Example: Recognize text in bundled local captcha images without a proxy. + +What it does: + This example shows how to recognize text in bundled local CAPTCHA images without a proxy. It uses ImageToTextTask and CaptchaClient.solve(), returning the recognized text. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The images and answer-format hints come from examples/assets and this file. + STEP-03 - Create ImageToTextTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print the recognized text. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -28,10 +36,10 @@ from captcha_solver_api.tasks import ImageToTextTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/recaptcha_v2_enterprise_proxy.py b/examples/sync/recaptcha_v2_enterprise_proxy.py index b2e5ba3..4993fe6 100644 --- a/examples/sync/recaptcha_v2_enterprise_proxy.py +++ b/examples/sync/recaptcha_v2_enterprise_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 Enterprise challenge. +"""Example: Solve reCAPTCHA v2 enterprise through your own proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 Enterprise through your own proxy. It uses RecaptchaV2EnterpriseTask and CaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any enterprisePayload from the target page, and provide your proxy settings. + STEP-03 - Create RecaptchaV2EnterpriseTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -26,10 +34,10 @@ from captcha_solver_api.tasks import RecaptchaV2EnterpriseTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/recaptcha_v2_enterprise_proxyless.py b/examples/sync/recaptcha_v2_enterprise_proxyless.py index bd7ebc5..5925688 100644 --- a/examples/sync/recaptcha_v2_enterprise_proxyless.py +++ b/examples/sync/recaptcha_v2_enterprise_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 Enterprise challenge. +"""Example: Solve reCAPTCHA v2 enterprise without a proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 Enterprise without a proxy. It uses RecaptchaV2EnterpriseTaskProxyless and CaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any enterprisePayload from the target page. + STEP-03 - Create RecaptchaV2EnterpriseTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -26,10 +34,10 @@ from captcha_solver_api.tasks import RecaptchaV2EnterpriseTaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/recaptcha_v2_proxy.py b/examples/sync/recaptcha_v2_proxy.py index 40f6674..ee6a21c 100644 --- a/examples/sync/recaptcha_v2_proxy.py +++ b/examples/sync/recaptcha_v2_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 challenge. +"""Example: Solve reCAPTCHA v2 through your own proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 through your own proxy. It uses RecaptchaV2Task and CaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page and provide your proxy settings. + STEP-03 - Create RecaptchaV2Task and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -25,10 +33,10 @@ from captcha_solver_api.tasks import RecaptchaV2Task # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/recaptcha_v2_proxyless.py b/examples/sync/recaptcha_v2_proxyless.py index 2670021..a0747dd 100644 --- a/examples/sync/recaptcha_v2_proxyless.py +++ b/examples/sync/recaptcha_v2_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v2 challenge. +"""Example: Solve reCAPTCHA v2 without a proxy. + +What it does: + This example shows how to solve reCAPTCHA v2 without a proxy. It uses RecaptchaV2TaskProxyless and CaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page. + STEP-03 - Create RecaptchaV2TaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -25,10 +33,10 @@ from captcha_solver_api.tasks import RecaptchaV2TaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/recaptcha_v3.py b/examples/sync/recaptcha_v3.py index cd2164b..69bc555 100644 --- a/examples/sync/recaptcha_v3.py +++ b/examples/sync/recaptcha_v3.py @@ -1,5 +1,13 @@ -""" -Example: Solve a reCAPTCHA v3 challenge. +"""Example: Solve score-based reCAPTCHA v3 without a proxy. + +What it does: + This example shows how to solve score-based reCAPTCHA v3 without a proxy. It uses RecaptchaV3TaskProxyless and CaptchaClient.solve(), returning a gRecaptchaResponse token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, pageAction, and the required minimum score from the target page. + STEP-03 - Create RecaptchaV3TaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -27,10 +35,10 @@ from captcha_solver_api.tasks import RecaptchaV3TaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/tencent_proxy.py b/examples/sync/tencent_proxy.py index 1314907..48a6288 100644 --- a/examples/sync/tencent_proxy.py +++ b/examples/sync/tencent_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Tencent captcha challenge. +"""Example: Solve Tencent captcha through your own proxy. + +What it does: + This example shows how to solve Tencent CAPTCHA through your own proxy. It uses TencentTask and CaptchaClient.solve(), returning appid, ret, ticket, and randstr values. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the Tencent parameters from the target page and provide your proxy settings. + STEP-03 - Create TencentTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/tencent_proxyless.py b/examples/sync/tencent_proxyless.py index fd620bc..1b0a3e7 100644 --- a/examples/sync/tencent_proxyless.py +++ b/examples/sync/tencent_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Tencent captcha challenge. +"""Example: Solve Tencent captcha without a proxy. + +What it does: + This example shows how to solve Tencent CAPTCHA without a proxy. It uses TencentTaskProxyless and CaptchaClient.solve(), returning appid, ret, ticket, and randstr values. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, appId, and any non-default captchaScript from the target page. + STEP-03 - Create TencentTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/turnstile_proxy.py b/examples/sync/turnstile_proxy.py index 29d61ac..bd3d268 100644 --- a/examples/sync/turnstile_proxy.py +++ b/examples/sync/turnstile_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Cloudflare Turnstile challenge. +"""Example: Solve Cloudflare turnstile through your own proxy. + +What it does: + This example shows how to solve Cloudflare Turnstile through your own proxy. It uses TurnstileTask and CaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract the Turnstile parameters from the target page and provide your proxy settings. + STEP-03 - Create TurnstileTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -26,10 +34,10 @@ from captcha_solver_api.tasks import TurnstileTask # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/turnstile_proxyless.py b/examples/sync/turnstile_proxyless.py index 258402d..c5719a7 100644 --- a/examples/sync/turnstile_proxyless.py +++ b/examples/sync/turnstile_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Cloudflare Turnstile challenge. +"""Example: Solve Cloudflare turnstile without a proxy. + +What it does: + This example shows how to solve Cloudflare Turnstile without a proxy. It uses TurnstileTaskProxyless and CaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any Challenge-page action, data, and pagedata values from the target page. + STEP-03 - Create TurnstileTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. @@ -26,10 +34,10 @@ from captcha_solver_api.tasks import TurnstileTaskProxyless # in this example we store the API key inside environment variables that can be set like: -# export CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS -# set CAPTCHA_API_KEY=1abc234de56fab7c89012d34e56fa7b8 on Windows +# export CAPTCHA_API_KEY=your_api_key on Linux or macOS +# set CAPTCHA_API_KEY=your_api_key on Windows # you can just set the API key directly to its value like: -# api_key="1abc234de56fab7c89012d34e56fa7b8" +# api_key="your_api_key" api_key = os.getenv("CAPTCHA_API_KEY", "YOUR_API_KEY") diff --git a/examples/sync/yandex_smartcaptcha_image.py b/examples/sync/yandex_smartcaptcha_image.py index 9973cdc..be93a52 100644 --- a/examples/sync/yandex_smartcaptcha_image.py +++ b/examples/sync/yandex_smartcaptcha_image.py @@ -1,4 +1,13 @@ -"""Example: Solve an image-based Yandex SmartCaptcha. +"""Example: Solve an image-based Yandex SmartCaptcha from bundled local images without a proxy. + +What it does: + This example shows how to solve an image-based Yandex SmartCaptcha from bundled local images without a proxy. It uses YandexSmartCaptchaImageTask and CaptchaClient.solve(), returning pixel coordinates to click. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The challenge and instruction images come from examples/assets. + STEP-03 - Create YandexSmartCaptchaImageTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print pixel coordinates to click. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/yandex_smartcaptcha_kaleidoscope.py b/examples/sync/yandex_smartcaptcha_kaleidoscope.py index 694e2f9..600b34f 100644 --- a/examples/sync/yandex_smartcaptcha_kaleidoscope.py +++ b/examples/sync/yandex_smartcaptcha_kaleidoscope.py @@ -1,15 +1,13 @@ -"""Example: Solve an image-based Yandex SmartCaptcha Kaleidoscope puzzle. +"""Example: Solve a Yandex smartcaptcha kaleidoscope puzzle from a bundled local image without a proxy. -This example reads the bundled Kaleidoscope challenge image, encodes it as -Base64, sends it together with the puzzle-step sequence without a proxy, and -prints how many times to click the slider arrow. It uses -YandexSmartCaptchaKaleidoscopeTask and CaptchaClient.solve(). +What it does: + This example shows how to solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. It uses YandexSmartCaptchaKaleidoscopeTask and CaptchaClient.solve(), returning the number of slider-arrow clicks. How it works: -STEP-01 - Configure CaptchaClient and locate the bundled challenge image. -STEP-02 - Encode the image and create a task with the captured puzzle steps. -STEP-03 - Call solve(), which creates the task and polls for its solution. -STEP-04 - Print the slider-arrow click count, or report the error. + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. The challenge image comes from examples/assets and the puzzle-step sequence is captured from the challenge. + STEP-03 - Create YandexSmartCaptchaKaleidoscopeTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print the number of slider-arrow clicks. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/yandex_smartcaptcha_proxy.py b/examples/sync/yandex_smartcaptcha_proxy.py index 08a2fc5..52bbeeb 100644 --- a/examples/sync/yandex_smartcaptcha_proxy.py +++ b/examples/sync/yandex_smartcaptcha_proxy.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Yandex SmartCaptcha challenge (token-based). +"""Example: Solve token-based Yandex smartcaptcha through your own proxy. + +What it does: + This example shows how to solve token-based Yandex SmartCaptcha through your own proxy. It uses YandexSmartCaptchaTask and CaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page and provide your proxy settings. + STEP-03 - Create YandexSmartCaptchaTask and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. diff --git a/examples/sync/yandex_smartcaptcha_proxyless.py b/examples/sync/yandex_smartcaptcha_proxyless.py index af1b089..87a979d 100644 --- a/examples/sync/yandex_smartcaptcha_proxyless.py +++ b/examples/sync/yandex_smartcaptcha_proxyless.py @@ -1,5 +1,13 @@ -""" -Example: Solve a Yandex SmartCaptcha challenge (token-based). +"""Example: Solve token-based Yandex smartcaptcha without a proxy. + +What it does: + This example shows how to solve token-based Yandex SmartCaptcha without a proxy. It uses YandexSmartCaptchaTaskProxyless and CaptchaClient.solve(), returning a token. + +How it works: + STEP-01 - Configure CaptchaClient with the API key. + STEP-02 - Obtain the task parameters. Extract websiteURL and websiteKey from the target page. + STEP-03 - Create YandexSmartCaptchaTaskProxyless and pass it to solver.solve(task), which creates and polls the task. + STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. From e3b5972f8d00df008663adbca792925b12c99688 Mon Sep 17 00:00:00 2001 From: dariyaanis Date: Wed, 18 Nov 2026 18:31:40 +0300 Subject: [PATCH 2/2] docs: align example instructions --- examples/async/balance.py | 3 +-- examples/async/coordinates.py | 2 +- examples/async/geetest_v3_proxy.py | 1 + examples/async/geetest_v4_proxy.py | 1 + examples/async/image_to_text.py | 3 ++- examples/async/recaptcha_v2_enterprise_proxy.py | 3 ++- examples/async/recaptcha_v2_enterprise_proxyless.py | 2 +- examples/async/recaptcha_v3.py | 8 ++++---- examples/async/tencent_proxy.py | 5 +++-- examples/async/tencent_proxyless.py | 2 +- examples/async/turnstile_proxy.py | 5 +++-- examples/async/turnstile_proxyless.py | 2 +- examples/async/yandex_smartcaptcha_kaleidoscope.py | 2 +- examples/async/yandex_smartcaptcha_proxy.py | 3 ++- examples/async/yandex_smartcaptcha_proxyless.py | 2 +- examples/sync/balance.py | 3 +-- examples/sync/coordinates.py | 2 +- examples/sync/geetest_v3_proxy.py | 1 + examples/sync/geetest_v4_proxy.py | 1 + examples/sync/image_to_text.py | 2 +- examples/sync/recaptcha_v2_enterprise_proxy.py | 3 ++- examples/sync/recaptcha_v2_enterprise_proxyless.py | 2 +- examples/sync/recaptcha_v2_proxy.py | 1 + examples/sync/recaptcha_v3.py | 8 ++++---- examples/sync/tencent_proxy.py | 5 +++-- examples/sync/tencent_proxyless.py | 2 +- examples/sync/turnstile_proxy.py | 5 +++-- examples/sync/turnstile_proxyless.py | 2 +- examples/sync/yandex_smartcaptcha_kaleidoscope.py | 2 +- examples/sync/yandex_smartcaptcha_proxy.py | 3 ++- examples/sync/yandex_smartcaptcha_proxyless.py | 2 +- 31 files changed, 50 insertions(+), 38 deletions(-) diff --git a/examples/async/balance.py b/examples/async/balance.py index 7d2b0e8..d581a7d 100644 --- a/examples/async/balance.py +++ b/examples/async/balance.py @@ -1,4 +1,4 @@ -"""Example: Check the current captcha solver account balance without creating a captcha task. +"""Example: Check the current Captcha Solver account balance without creating a CAPTCHA task. What it does: This example shows how to check the current Captcha Solver account balance without creating a CAPTCHA task. It uses AsyncCaptchaClient.get_balance() and returns the account balance. @@ -10,7 +10,6 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. - Returns the current available balance of your account. """ import asyncio diff --git a/examples/async/coordinates.py b/examples/async/coordinates.py index 7a4c8dc..b91645a 100644 --- a/examples/async/coordinates.py +++ b/examples/async/coordinates.py @@ -1,4 +1,4 @@ -"""Example: Solve click-based image captchas from bundled local images without a proxy. +"""Example: Solve click-based image CAPTCHAs from bundled local images without a proxy. What it does: This example shows how to solve click-based image CAPTCHAs from bundled local images without a proxy. It uses CoordinatesTask and AsyncCaptchaClient.solve(), returning pixel coordinates to click. diff --git a/examples/async/geetest_v3_proxy.py b/examples/async/geetest_v3_proxy.py index aa50051..c82445b 100644 --- a/examples/async/geetest_v3_proxy.py +++ b/examples/async/geetest_v3_proxy.py @@ -18,6 +18,7 @@ real endpoint -- this script will not run end-to-end as-is. Replace it with a request to your actual target page (or wherever it exposes a fresh `challenge` value) before running this example. It's here only to illustrate where that fetch belongs in the flow. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/geetest_v4_proxy.py b/examples/async/geetest_v4_proxy.py index bfdda7f..99184f0 100644 --- a/examples/async/geetest_v4_proxy.py +++ b/examples/async/geetest_v4_proxy.py @@ -15,6 +15,7 @@ GeeTest v4 drops gt/challenge entirely. It uses captcha_id instead, which (unlike v3's challenge) is static per site, so it doesn't need to be re-fetched for every request. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/image_to_text.py b/examples/async/image_to_text.py index 48a706d..bb9921a 100644 --- a/examples/async/image_to_text.py +++ b/examples/async/image_to_text.py @@ -1,4 +1,4 @@ -"""Example: Recognize text in bundled local captcha images without a proxy. +"""Example: Recognize text in bundled local CAPTCHA images without a proxy. What it does: This example shows how to recognize text in bundled local CAPTCHA images without a proxy. It uses ImageToTextTask and AsyncCaptchaClient.solve(), returning the recognized text. @@ -12,6 +12,7 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. Ready to run as-is: sample captcha images are bundled in examples/assets/. + Use optional fields to give hints to the worker for faster solving. """ import asyncio diff --git a/examples/async/recaptcha_v2_enterprise_proxy.py b/examples/async/recaptcha_v2_enterprise_proxy.py index 275f632..d4ede93 100644 --- a/examples/async/recaptcha_v2_enterprise_proxy.py +++ b/examples/async/recaptcha_v2_enterprise_proxy.py @@ -1,4 +1,4 @@ -"""Example: Solve reCAPTCHA v2 enterprise through your own proxy. +"""Example: Solve reCAPTCHA v2 Enterprise through your own proxy. What it does: This example shows how to solve reCAPTCHA v2 Enterprise through your own proxy. It uses RecaptchaV2EnterpriseTask and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. If the site uses enterprisePayload, extract and pass it or the token may be rejected. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/recaptcha_v2_enterprise_proxyless.py b/examples/async/recaptcha_v2_enterprise_proxyless.py index 4d6cfe2..fa59c9b 100644 --- a/examples/async/recaptcha_v2_enterprise_proxyless.py +++ b/examples/async/recaptcha_v2_enterprise_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve reCAPTCHA v2 enterprise without a proxy. +"""Example: Solve reCAPTCHA v2 Enterprise without a proxy. What it does: This example shows how to solve reCAPTCHA v2 Enterprise without a proxy. It uses RecaptchaV2EnterpriseTaskProxyless and AsyncCaptchaClient.solve(), returning a gRecaptchaResponse token. diff --git a/examples/async/recaptcha_v3.py b/examples/async/recaptcha_v3.py index e606d0d..e08da88 100644 --- a/examples/async/recaptcha_v3.py +++ b/examples/async/recaptcha_v3.py @@ -5,15 +5,15 @@ How it works: STEP-01 - Configure AsyncCaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, pageAction, and the required minimum score from the target page. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and pageAction from the target page, then choose the required minimum score. STEP-03 - Create RecaptchaV3TaskProxyless and pass it to await solver.solve(task), which creates and polls the task. STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. - Replace websiteURL, websiteKey, and minScore with values from your target - page, and pass pageAction if the site uses it -- this increases the - chance of the token being accepted. + Replace websiteURL and websiteKey with values from your target page, pass + pageAction if the site uses it, and choose the minimum score your + integration requires. """ import asyncio diff --git a/examples/async/tencent_proxy.py b/examples/async/tencent_proxy.py index d62943b..5263c8c 100644 --- a/examples/async/tencent_proxy.py +++ b/examples/async/tencent_proxy.py @@ -1,11 +1,11 @@ -"""Example: Solve Tencent captcha through your own proxy. +"""Example: Solve Tencent CAPTCHA through your own proxy. What it does: This example shows how to solve Tencent CAPTCHA through your own proxy. It uses TencentTask and AsyncCaptchaClient.solve(), returning appid, ret, ticket, and randstr values. How it works: STEP-01 - Configure AsyncCaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract the Tencent parameters from the target page and provide your proxy settings. + STEP-02 - Obtain the task parameters. Extract websiteURL, appId, and any non-default captchaScript from the target page, then provide your proxy settings. STEP-03 - Create TencentTask and pass it to await solver.solve(task), which creates and polls the task. STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and appId with values from your target page. Pass captchaScript if the site uses a non-default script URL. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/tencent_proxyless.py b/examples/async/tencent_proxyless.py index 55ceaec..e678b6b 100644 --- a/examples/async/tencent_proxyless.py +++ b/examples/async/tencent_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve Tencent captcha without a proxy. +"""Example: Solve Tencent CAPTCHA without a proxy. What it does: This example shows how to solve Tencent CAPTCHA without a proxy. It uses TencentTaskProxyless and AsyncCaptchaClient.solve(), returning appid, ret, ticket, and randstr values. diff --git a/examples/async/turnstile_proxy.py b/examples/async/turnstile_proxy.py index 56b6874..756a964 100644 --- a/examples/async/turnstile_proxy.py +++ b/examples/async/turnstile_proxy.py @@ -1,11 +1,11 @@ -"""Example: Solve Cloudflare turnstile through your own proxy. +"""Example: Solve Cloudflare Turnstile through your own proxy. What it does: This example shows how to solve Cloudflare Turnstile through your own proxy. It uses TurnstileTask and AsyncCaptchaClient.solve(), returning a token. How it works: STEP-01 - Configure AsyncCaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract the Turnstile parameters from the target page and provide your proxy settings. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any Challenge-page action, data, and pagedata values, then provide your proxy settings. STEP-03 - Create TurnstileTask and pass it to await solver.solve(task), which creates and polls the task. STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. For Cloudflare Challenge pages, also extract and pass action, data, and pagedata. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/turnstile_proxyless.py b/examples/async/turnstile_proxyless.py index 243b5e8..c4c380b 100644 --- a/examples/async/turnstile_proxyless.py +++ b/examples/async/turnstile_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve Cloudflare turnstile without a proxy. +"""Example: Solve Cloudflare Turnstile without a proxy. What it does: This example shows how to solve Cloudflare Turnstile without a proxy. It uses TurnstileTaskProxyless and AsyncCaptchaClient.solve(), returning a token. diff --git a/examples/async/yandex_smartcaptcha_kaleidoscope.py b/examples/async/yandex_smartcaptcha_kaleidoscope.py index 431d27c..0be5646 100644 --- a/examples/async/yandex_smartcaptcha_kaleidoscope.py +++ b/examples/async/yandex_smartcaptcha_kaleidoscope.py @@ -1,4 +1,4 @@ -"""Example: Solve a Yandex smartcaptcha kaleidoscope puzzle from a bundled local image without a proxy. +"""Example: Solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. What it does: This example shows how to solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. It uses YandexSmartCaptchaKaleidoscopeTask and AsyncCaptchaClient.solve(), returning the number of slider-arrow clicks. diff --git a/examples/async/yandex_smartcaptcha_proxy.py b/examples/async/yandex_smartcaptcha_proxy.py index 379b8f8..957f636 100644 --- a/examples/async/yandex_smartcaptcha_proxy.py +++ b/examples/async/yandex_smartcaptcha_proxy.py @@ -1,4 +1,4 @@ -"""Example: Solve token-based Yandex smartcaptcha through your own proxy. +"""Example: Solve token-based Yandex SmartCaptcha through your own proxy. What it does: This example shows how to solve token-based Yandex SmartCaptcha through your own proxy. It uses YandexSmartCaptchaTask and AsyncCaptchaClient.solve(), returning a token. @@ -12,6 +12,7 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. + Replace the proxy placeholders with your own proxy settings. """ import asyncio diff --git a/examples/async/yandex_smartcaptcha_proxyless.py b/examples/async/yandex_smartcaptcha_proxyless.py index 1899a24..3876f44 100644 --- a/examples/async/yandex_smartcaptcha_proxyless.py +++ b/examples/async/yandex_smartcaptcha_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve token-based Yandex smartcaptcha without a proxy. +"""Example: Solve token-based Yandex SmartCaptcha without a proxy. What it does: This example shows how to solve token-based Yandex SmartCaptcha without a proxy. It uses YandexSmartCaptchaTaskProxyless and AsyncCaptchaClient.solve(), returning a token. diff --git a/examples/sync/balance.py b/examples/sync/balance.py index f29f826..569fa69 100644 --- a/examples/sync/balance.py +++ b/examples/sync/balance.py @@ -1,4 +1,4 @@ -"""Example: Check the current captcha solver account balance without creating a captcha task. +"""Example: Check the current Captcha Solver account balance without creating a CAPTCHA task. What it does: This example shows how to check the current Captcha Solver account balance without creating a CAPTCHA task. It uses CaptchaClient.get_balance() and returns the account balance. @@ -10,7 +10,6 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. - Returns the current available balance of your account. """ import os diff --git a/examples/sync/coordinates.py b/examples/sync/coordinates.py index 97eee72..814d41d 100644 --- a/examples/sync/coordinates.py +++ b/examples/sync/coordinates.py @@ -1,4 +1,4 @@ -"""Example: Solve click-based image captchas from bundled local images without a proxy. +"""Example: Solve click-based image CAPTCHAs from bundled local images without a proxy. What it does: This example shows how to solve click-based image CAPTCHAs from bundled local images without a proxy. It uses CoordinatesTask and CaptchaClient.solve(), returning pixel coordinates to click. diff --git a/examples/sync/geetest_v3_proxy.py b/examples/sync/geetest_v3_proxy.py index d750b27..3ed05c6 100644 --- a/examples/sync/geetest_v3_proxy.py +++ b/examples/sync/geetest_v3_proxy.py @@ -18,6 +18,7 @@ real endpoint -- this script will not run end-to-end as-is. Replace it with a request to your actual target page (or wherever it exposes a fresh `challenge` value) before running this example. It's here only to illustrate where that fetch belongs in the flow. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/geetest_v4_proxy.py b/examples/sync/geetest_v4_proxy.py index dc5234b..cf559e8 100644 --- a/examples/sync/geetest_v4_proxy.py +++ b/examples/sync/geetest_v4_proxy.py @@ -15,6 +15,7 @@ GeeTest v4 drops gt/challenge entirely. It uses captcha_id instead, which (unlike v3's challenge) is static per site, so it doesn't need to be re-fetched for every request. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/image_to_text.py b/examples/sync/image_to_text.py index 2d4436b..efdf791 100644 --- a/examples/sync/image_to_text.py +++ b/examples/sync/image_to_text.py @@ -1,4 +1,4 @@ -"""Example: Recognize text in bundled local captcha images without a proxy. +"""Example: Recognize text in bundled local CAPTCHA images without a proxy. What it does: This example shows how to recognize text in bundled local CAPTCHA images without a proxy. It uses ImageToTextTask and CaptchaClient.solve(), returning the recognized text. diff --git a/examples/sync/recaptcha_v2_enterprise_proxy.py b/examples/sync/recaptcha_v2_enterprise_proxy.py index 4993fe6..9e515e0 100644 --- a/examples/sync/recaptcha_v2_enterprise_proxy.py +++ b/examples/sync/recaptcha_v2_enterprise_proxy.py @@ -1,4 +1,4 @@ -"""Example: Solve reCAPTCHA v2 enterprise through your own proxy. +"""Example: Solve reCAPTCHA v2 Enterprise through your own proxy. What it does: This example shows how to solve reCAPTCHA v2 Enterprise through your own proxy. It uses RecaptchaV2EnterpriseTask and CaptchaClient.solve(), returning a gRecaptchaResponse token. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. If the site uses enterprisePayload, extract and pass it or the token may be rejected. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/recaptcha_v2_enterprise_proxyless.py b/examples/sync/recaptcha_v2_enterprise_proxyless.py index 5925688..01f5ccb 100644 --- a/examples/sync/recaptcha_v2_enterprise_proxyless.py +++ b/examples/sync/recaptcha_v2_enterprise_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve reCAPTCHA v2 enterprise without a proxy. +"""Example: Solve reCAPTCHA v2 Enterprise without a proxy. What it does: This example shows how to solve reCAPTCHA v2 Enterprise without a proxy. It uses RecaptchaV2EnterpriseTaskProxyless and CaptchaClient.solve(), returning a gRecaptchaResponse token. diff --git a/examples/sync/recaptcha_v2_proxy.py b/examples/sync/recaptcha_v2_proxy.py index ee6a21c..ff959ef 100644 --- a/examples/sync/recaptcha_v2_proxy.py +++ b/examples/sync/recaptcha_v2_proxy.py @@ -12,6 +12,7 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/recaptcha_v3.py b/examples/sync/recaptcha_v3.py index 69bc555..2b143d7 100644 --- a/examples/sync/recaptcha_v3.py +++ b/examples/sync/recaptcha_v3.py @@ -5,15 +5,15 @@ How it works: STEP-01 - Configure CaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, pageAction, and the required minimum score from the target page. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and pageAction from the target page, then choose the required minimum score. STEP-03 - Create RecaptchaV3TaskProxyless and pass it to solver.solve(task), which creates and polls the task. STEP-04 - Print a gRecaptchaResponse token. Applying the solution and verifying acceptance are target-specific. Prerequisites: Set the CAPTCHA_API_KEY environment variable. - Replace websiteURL, websiteKey, and minScore with values from your target - page, and pass pageAction if the site uses it -- this increases the - chance of the token being accepted. + Replace websiteURL and websiteKey with values from your target page, pass + pageAction if the site uses it, and choose the minimum score your + integration requires. """ import os diff --git a/examples/sync/tencent_proxy.py b/examples/sync/tencent_proxy.py index 48a6288..2bff730 100644 --- a/examples/sync/tencent_proxy.py +++ b/examples/sync/tencent_proxy.py @@ -1,11 +1,11 @@ -"""Example: Solve Tencent captcha through your own proxy. +"""Example: Solve Tencent CAPTCHA through your own proxy. What it does: This example shows how to solve Tencent CAPTCHA through your own proxy. It uses TencentTask and CaptchaClient.solve(), returning appid, ret, ticket, and randstr values. How it works: STEP-01 - Configure CaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract the Tencent parameters from the target page and provide your proxy settings. + STEP-02 - Obtain the task parameters. Extract websiteURL, appId, and any non-default captchaScript from the target page, then provide your proxy settings. STEP-03 - Create TencentTask and pass it to solver.solve(task), which creates and polls the task. STEP-04 - Print appid, ret, ticket, and randstr values. Applying the solution and verifying acceptance are target-specific. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and appId with values from your target page. Pass captchaScript if the site uses a non-default script URL. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/tencent_proxyless.py b/examples/sync/tencent_proxyless.py index 1b0a3e7..3387e92 100644 --- a/examples/sync/tencent_proxyless.py +++ b/examples/sync/tencent_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve Tencent captcha without a proxy. +"""Example: Solve Tencent CAPTCHA without a proxy. What it does: This example shows how to solve Tencent CAPTCHA without a proxy. It uses TencentTaskProxyless and CaptchaClient.solve(), returning appid, ret, ticket, and randstr values. diff --git a/examples/sync/turnstile_proxy.py b/examples/sync/turnstile_proxy.py index bd3d268..16b3d1d 100644 --- a/examples/sync/turnstile_proxy.py +++ b/examples/sync/turnstile_proxy.py @@ -1,11 +1,11 @@ -"""Example: Solve Cloudflare turnstile through your own proxy. +"""Example: Solve Cloudflare Turnstile through your own proxy. What it does: This example shows how to solve Cloudflare Turnstile through your own proxy. It uses TurnstileTask and CaptchaClient.solve(), returning a token. How it works: STEP-01 - Configure CaptchaClient with the API key. - STEP-02 - Obtain the task parameters. Extract the Turnstile parameters from the target page and provide your proxy settings. + STEP-02 - Obtain the task parameters. Extract websiteURL, websiteKey, and any Challenge-page action, data, and pagedata values, then provide your proxy settings. STEP-03 - Create TurnstileTask and pass it to solver.solve(task), which creates and polls the task. STEP-04 - Print a token. Applying the solution and verifying acceptance are target-specific. @@ -13,6 +13,7 @@ Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. For Cloudflare Challenge pages, also extract and pass action, data, and pagedata. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/turnstile_proxyless.py b/examples/sync/turnstile_proxyless.py index c5719a7..7d7a0df 100644 --- a/examples/sync/turnstile_proxyless.py +++ b/examples/sync/turnstile_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve Cloudflare turnstile without a proxy. +"""Example: Solve Cloudflare Turnstile without a proxy. What it does: This example shows how to solve Cloudflare Turnstile without a proxy. It uses TurnstileTaskProxyless and CaptchaClient.solve(), returning a token. diff --git a/examples/sync/yandex_smartcaptcha_kaleidoscope.py b/examples/sync/yandex_smartcaptcha_kaleidoscope.py index 600b34f..574fa80 100644 --- a/examples/sync/yandex_smartcaptcha_kaleidoscope.py +++ b/examples/sync/yandex_smartcaptcha_kaleidoscope.py @@ -1,4 +1,4 @@ -"""Example: Solve a Yandex smartcaptcha kaleidoscope puzzle from a bundled local image without a proxy. +"""Example: Solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. What it does: This example shows how to solve a Yandex SmartCaptcha Kaleidoscope puzzle from a bundled local image without a proxy. It uses YandexSmartCaptchaKaleidoscopeTask and CaptchaClient.solve(), returning the number of slider-arrow clicks. diff --git a/examples/sync/yandex_smartcaptcha_proxy.py b/examples/sync/yandex_smartcaptcha_proxy.py index 52bbeeb..ebc1bd7 100644 --- a/examples/sync/yandex_smartcaptcha_proxy.py +++ b/examples/sync/yandex_smartcaptcha_proxy.py @@ -1,4 +1,4 @@ -"""Example: Solve token-based Yandex smartcaptcha through your own proxy. +"""Example: Solve token-based Yandex SmartCaptcha through your own proxy. What it does: This example shows how to solve token-based Yandex SmartCaptcha through your own proxy. It uses YandexSmartCaptchaTask and CaptchaClient.solve(), returning a token. @@ -12,6 +12,7 @@ Prerequisites: Set the CAPTCHA_API_KEY environment variable. Replace websiteURL and websiteKey with values from your target page. + Replace the proxy placeholders with your own proxy settings. """ import os diff --git a/examples/sync/yandex_smartcaptcha_proxyless.py b/examples/sync/yandex_smartcaptcha_proxyless.py index 87a979d..28c0bd3 100644 --- a/examples/sync/yandex_smartcaptcha_proxyless.py +++ b/examples/sync/yandex_smartcaptcha_proxyless.py @@ -1,4 +1,4 @@ -"""Example: Solve token-based Yandex smartcaptcha without a proxy. +"""Example: Solve token-based Yandex SmartCaptcha without a proxy. What it does: This example shows how to solve token-based Yandex SmartCaptcha without a proxy. It uses YandexSmartCaptchaTaskProxyless and CaptchaClient.solve(), returning a token.