API
Sync Client
- class python_anticaptcha.sync_client.AnticaptchaClient(client_key: str | None = None, language_pool: str = 'en', host: str = 'api.anti-captcha.com', use_ssl: bool = True)[source]
Synchronous client for the Anticaptcha.com API.
Create tasks, poll for results, check your balance, and report incorrect solutions. Can be used as a context manager to ensure the underlying HTTP session is closed:
with AnticaptchaClient("my-api-key") as client: job = client.create_task(task) job.join()
- Parameters:
client_key – Your Anticaptcha API key. If omitted, the
ANTICAPTCHA_API_KEYenvironment variable is used.language_pool – Language pool for workers —
"en"(default) or"rn"(Russian).host – API hostname (default:
"api.anti-captcha.com").use_ssl – Use HTTPS (default:
True).- Raises:
AnticaptchaException – If no API key is provided.
- APP_STAT_URL = '/getAppStats'
- BALANCE_URL = '/getBalance'
- CREATE_TASK_URL = '/createTask'
- REPORT_IMAGE_URL = '/reportIncorrectImageCaptcha'
- REPORT_RECAPTCHA_URL = '/reportIncorrectRecaptcha'
- SOFT_ID = 847
- TASK_RESULT_URL = '/getTaskResult'
- property client_ip: str
- client_key = None
- close() None[source]
Close the underlying HTTP session.
Called automatically when using the client as a context manager.
- createTask(task: BaseTask) Job[source]
Submit a captcha task and return a
Jobhandle.
- Parameters:
task – A task instance (e.g.
NoCaptchaTaskProxylessTask).- Returns:
A
Jobthat can be polled withJob.join().- Raises:
AnticaptchaException – If the API returns an error.
- createTaskSmee(task: BaseTask, timeout: int = 300) Job[source]
Beta method to stream response from smee.io
- create_task(task: BaseTask) Job
Alias for
createTask().
- create_task_smee(task: BaseTask, timeout: int = 300) Job
Alias for
createTaskSmee().
- getAppStats(soft_id: int, mode: str) dict[str, Any][source]
Retrieve application statistics.
- Parameters:
soft_id – Application ID.
mode – Statistics mode (e.g.
"errors","views","downloads").- Returns:
Raw API response dictionary with statistics data.
- Raises:
AnticaptchaException – If the API returns an error.
- getBalance() float[source]
Return the current account balance in USD.
- Returns:
Account balance as a float (e.g.
3.50).- Raises:
AnticaptchaException – If the API returns an error.
- getTaskResult(task_id: int) dict[str, Any][source]
Fetch the current result/status of a task.
- Parameters:
task_id – The task ID returned when the task was created.
- Returns:
Raw API response dictionary with
statusandsolutionkeys.- Raises:
AnticaptchaException – If the API returns an error.
- get_app_stats(soft_id: int, mode: str) dict[str, Any]
Alias for
getAppStats().
- get_balance() float
Alias for
getBalance().
- get_task_result(task_id: int) dict[str, Any]
Alias for
getTaskResult().
- language_pool = 'en'
- reportIncorrectImage(task_id: int) bool[source]
Report that an image captcha was solved incorrectly.
Use this to get a refund and improve solver accuracy.
- Parameters:
task_id – The task ID of the incorrectly solved task.
- Returns:
Trueif the report was accepted.- Raises:
AnticaptchaException – If the API returns an error.
- reportIncorrectRecaptcha(task_id: int) bool[source]
Report that a ReCAPTCHA was solved incorrectly.
Use this to get a refund and improve solver accuracy.
- Parameters:
task_id – The task ID of the incorrectly solved task.
- Returns:
Trueif the report was accepted.- Raises:
AnticaptchaException – If the API returns an error.
- report_incorrect_image(task_id: int) bool
Alias for
reportIncorrectImage().
- report_incorrect_recaptcha(task_id: int) bool
Alias for
reportIncorrectRecaptcha().
- response_timeout = 5
- class python_anticaptcha.sync_client.Job(client: AnticaptchaClient, task_id: int)[source]
A handle to a submitted captcha-solving task.
Returned by
AnticaptchaClient.create_task(). Usejoin()to wait for completion, then call one of theget_*methods to retrieve the solution.Example:
job = client.create_task(task) job.join() print(job.get_solution_response()) # for ReCAPTCHA / hCaptcha
- check_is_ready() bool[source]
Poll the API once and return whether the task is complete.
- Returns:
Trueif the solution is ready,Falseotherwise.
- client: AnticaptchaClient
- get_answers() dict[str, str][source]
Return the
answersdictionary from the solution.Use after solving AntiGate tasks. Call this only after
join()has returned.
- get_captcha_text() str[source]
Return the recognized text from an image captcha.
Use after solving
ImageToTextTasktasks. Call this only afterjoin()has returned.
- get_cells_numbers() list[int][source]
Return the list of selected cell numbers from a grid captcha.
Call this only after
join()has returned.
- get_solution() dict[str, Any][source]
Return the full solution dictionary from the API response.
Useful for task types where the solution has multiple fields (e.g. GeeTest returns
challenge,validate,seccode). Call this only afterjoin()has returned.
- get_solution_response() str[source]
Return the
gRecaptchaResponsetoken.Use after solving ReCAPTCHA v2, ReCAPTCHA v3, or hCaptcha tasks. Call this only after
join()has returned.
- get_token_response() str[source]
Return the
tokenstring from the solution.Use after solving FunCaptcha tasks. Call this only after
join()has returned.
- join(maximum_time: int | None = None, on_check: Callable[[int, str | None], None] | None = None, backoff: bool = False) None[source]
Poll for task completion, blocking until ready or timeout.
- Parameters:
maximum_time – Maximum seconds to wait (default:
MAXIMUM_JOIN_TIME).on_check – Optional callback invoked after each poll with
(elapsed_time, status)where elapsed_time is the total seconds waited so far and status is the last task status string (e.g."processing").backoff – When
True, use exponential backoff for polling intervals starting at 1 second and doubling up to a 10-second cap. DefaultFalsepreserves the fixed 3-second interval.- Raises:
AnticaptchaException – If maximum_time is exceeded.
- report_incorrect_image() bool[source]
Report that an image captcha was solved incorrectly.
- Returns:
Trueif the report was accepted.
- report_incorrect_recaptcha() bool[source]
Report that a ReCAPTCHA was solved incorrectly.
- Returns:
Trueif the report was accepted.
- task_id: int
Async Client
- class python_anticaptcha.async_client.AsyncAnticaptchaClient(client_key: str | None = None, language_pool: str = 'en', host: str = 'api.anti-captcha.com', use_ssl: bool = True)[source]
Asynchronous client for the Anticaptcha.com API.
Mirrors
AnticaptchaClientbut all network methods are coroutines. Requires thehttpxpackage — install withpip install python-anticaptcha[async].Can be used as an async context manager:
async with AsyncAnticaptchaClient("my-api-key") as client: job = await client.create_task(task) await job.join()
- Parameters:
client_key – Your Anticaptcha API key. If omitted, the
ANTICAPTCHA_API_KEYenvironment variable is used.language_pool – Language pool for workers —
"en"(default) or"rn"(Russian).host – API hostname (default:
"api.anti-captcha.com").use_ssl – Use HTTPS (default:
True).- Raises:
ImportError – If
httpxis not installed.AnticaptchaException – If no API key is provided.
- APP_STAT_URL = '/getAppStats'
- BALANCE_URL = '/getBalance'
- CREATE_TASK_URL = '/createTask'
- REPORT_IMAGE_URL = '/reportIncorrectImageCaptcha'
- REPORT_RECAPTCHA_URL = '/reportIncorrectRecaptcha'
- SOFT_ID = 847
- TASK_RESULT_URL = '/getTaskResult'
- client_key = None
- async close() None[source]
Close the underlying HTTP session.
Called automatically when using the client as an async context manager.
- async createTask(task: BaseTask) AsyncJob[source]
Submit a captcha task and return an
AsyncJobhandle.
- Parameters:
task – A task instance (e.g.
NoCaptchaTaskProxylessTask).- Returns:
An
AsyncJobthat can be polled withAsyncJob.join().- Raises:
AnticaptchaException – If the API returns an error.
- async create_task(task: BaseTask) AsyncJob
Alias for
createTask().
- async getAppStats(soft_id: int, mode: str) dict[str, Any][source]
Retrieve application statistics.
- Parameters:
soft_id – Application ID.
mode – Statistics mode (e.g.
"errors","views","downloads").- Returns:
Raw API response dictionary with statistics data.
- Raises:
AnticaptchaException – If the API returns an error.
- async getBalance() float[source]
Return the current account balance in USD.
- Returns:
Account balance as a float (e.g.
3.50).- Raises:
AnticaptchaException – If the API returns an error.
- async getTaskResult(task_id: int) dict[str, Any][source]
Fetch the current result/status of a task.
- Parameters:
task_id – The task ID returned when the task was created.
- Returns:
Raw API response dictionary with
statusandsolutionkeys.- Raises:
AnticaptchaException – If the API returns an error.
- async get_app_stats(soft_id: int, mode: str) dict[str, Any]
Alias for
getAppStats().
- async get_balance() float
Alias for
getBalance().
- async get_task_result(task_id: int) dict[str, Any]
Alias for
getTaskResult().
- language_pool = 'en'
- async reportIncorrectImage(task_id: int) bool[source]
Report that an image captcha was solved incorrectly.
Use this to get a refund and improve solver accuracy.
- Parameters:
task_id – The task ID of the incorrectly solved task.
- Returns:
Trueif the report was accepted.- Raises:
AnticaptchaException – If the API returns an error.
- async reportIncorrectRecaptcha(task_id: int) bool[source]
Report that a ReCAPTCHA was solved incorrectly.
Use this to get a refund and improve solver accuracy.
- Parameters:
task_id – The task ID of the incorrectly solved task.
- Returns:
Trueif the report was accepted.- Raises:
AnticaptchaException – If the API returns an error.
- async report_incorrect_image(task_id: int) bool
Alias for
reportIncorrectImage().
- async report_incorrect_recaptcha(task_id: int) bool
Alias for
reportIncorrectRecaptcha().
- response_timeout = 5
- class python_anticaptcha.async_client.AsyncJob(client: AsyncAnticaptchaClient, task_id: int)[source]
An async handle to a submitted captcha-solving task.
Returned by
AsyncAnticaptchaClient.create_task(). Usejoin()to wait for completion, then call one of theget_*methods to retrieve the solution.Example:
job = await client.create_task(task) await job.join() print(job.get_solution_response()) # for ReCAPTCHA / hCaptcha
- async check_is_ready() bool[source]
Poll the API once and return whether the task is complete.
- Returns:
Trueif the solution is ready,Falseotherwise.
- client: AsyncAnticaptchaClient
- get_answers() dict[str, str][source]
Return the
answersdictionary from the solution.Use after solving AntiGate tasks. Call this only after
join()has returned.
- get_captcha_text() str[source]
Return the recognized text from an image captcha.
Use after solving
ImageToTextTasktasks. Call this only afterjoin()has returned.
- get_cells_numbers() list[int][source]
Return the list of selected cell numbers from a grid captcha.
Call this only after
join()has returned.
- get_solution() dict[str, Any][source]
Return the full solution dictionary from the API response.
Useful for task types where the solution has multiple fields (e.g. GeeTest returns
challenge,validate,seccode). Call this only afterjoin()has returned.
- get_solution_response() str[source]
Return the
gRecaptchaResponsetoken.Use after solving ReCAPTCHA v2, ReCAPTCHA v3, or hCaptcha tasks. Call this only after
join()has returned.
- get_token_response() str[source]
Return the
tokenstring from the solution.Use after solving FunCaptcha tasks. Call this only after
join()has returned.
- async join(maximum_time: int | None = None, on_check: Callable[[int, str | None], None] | None = None, backoff: bool = False) None[source]
Poll for task completion, sleeping asynchronously until ready or timeout.
- Parameters:
maximum_time – Maximum seconds to wait (default:
MAXIMUM_JOIN_TIME).on_check – Optional callback invoked after each poll with
(elapsed_time, status)where elapsed_time is the total seconds waited so far and status is the last task status string (e.g."processing").backoff – When
True, use exponential backoff for polling intervals starting at 1 second and doubling up to a 10-second cap. DefaultFalsepreserves the fixed 3-second interval.- Raises:
AnticaptchaException – If maximum_time is exceeded.
- async report_incorrect_image() bool[source]
Report that an image captcha was solved incorrectly.
- Returns:
Trueif the report was accepted.
- async report_incorrect_recaptcha() bool[source]
Report that a ReCAPTCHA was solved incorrectly.
- Returns:
Trueif the report was accepted.
- task_id: int
Exceptions
- exception python_anticaptcha.exceptions.AnticaptchaException(error_id: int | str | None, error_code: int | str, error_description: str, *args: object)[source]
Base exception for all Anticaptcha API errors.
Raised when the API returns a non-zero
errorId. Inspecterror_codeto determine the cause:try: job = client.create_task(task) except AnticaptchaException as e: if e.error_code == "ERROR_ZERO_BALANCE": print("Please top up your balance") else: raise
- Parameters:
error_id – Numeric error ID from the API (or a local identifier).
error_code – Error code string (e.g.
"ERROR_ZERO_BALANCE").error_description – Human-readable error description.
- python_anticaptcha.exceptions.AnticatpchaException
Backward-compatible alias (legacy misspelling).
Tasks
- class python_anticaptcha.tasks.AntiGateTask(*args: Any, **kwargs: Any)[source]
Solve a custom AntiGate task through a proxy.
Same as
AntiGateTaskProxylessbut additionally requires proxy parameters.
- class python_anticaptcha.tasks.AntiGateTaskProxyless(website_url: str, template_name: str, variables: dict[str, Any], *args: Any, **kwargs: Any)[source]
Solve a custom AntiGate task using a predefined template.
AntiGate tasks use templates to automate complex browser-based actions. Browse available templates at https://anti-captcha.com/antigate.
After the job completes, use
Job.get_solution()to get the full solution dictionary.
- Parameters:
website_url – Full URL of the page to process.
template_name – Name of the AntiGate template (e.g.
"Sign up on MailChimp").variables – Dictionary of template variables (keys and values depend on the template).
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- templateName = None
- variables = None
- websiteURL = None
- class python_anticaptcha.tasks.BaseTask[source]
Base class for all Anticaptcha task types.
Each subclass represents a specific captcha type (ReCAPTCHA, hCaptcha, etc.) and serializes its parameters into the format expected by the Anticaptcha API.
You do not use this class directly — instead, instantiate one of the concrete task classes and pass it to
AnticaptchaClient.create_task().
- class python_anticaptcha.tasks.CookieMixin(*args: Any, **kwargs: Any)[source]
Mixin that adds an optional
cookiesparameter to a task.Pass cookies when the target page requires them for the captcha to render correctly.
- Parameters:
cookies – Cookie string to include with the request (optional).
- cookies: str
- class python_anticaptcha.tasks.FunCaptchaProxylessTask(website_url: str, website_key: str, subdomain: str | None = None, data: str | None = None, *args: Any, **kwargs: Any)[source]
Solve an Arkose Labs FunCaptcha challenge without a proxy.
After the job completes, retrieve the token with
Job.get_token_response().
- Parameters:
website_url – Full URL of the page where the captcha appears.
website_key – The FunCaptcha public key (e.g.
"DE0B0BB7-1EE4-4D70-1853-31B835D4506B").subdomain – Custom FunCaptcha API subdomain, if the site uses one (e.g.
"mysite-api.arkoselabs.com").data – Additional data blob required by some FunCaptcha implementations.
- data = None
- funcaptchaApiJSSubdomain = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteKey = None
- websiteURL = None
- class python_anticaptcha.tasks.FunCaptchaTask(*args: Any, **kwargs: Any)[source]
Solve an Arkose Labs FunCaptcha challenge through a proxy.
Same as
FunCaptchaProxylessTaskbut additionally requires proxy, user-agent, and optional cookie parameters.
- class python_anticaptcha.tasks.GeeTestTask(*args: Any, **kwargs: Any)[source]
Solve a GeeTest captcha through a proxy.
Same as
GeeTestTaskProxylessbut additionally requires proxy and user-agent parameters.
- class python_anticaptcha.tasks.GeeTestTaskProxyless(website_url: str, gt: str, challenge: str, subdomain: str | None = None, lib: str | None = None, *args: Any, **kwargs: Any)[source]
Solve a GeeTest (slide / click) captcha without a proxy.
After the job completes, use
Job.get_solution()to get the full solution dictionary containingchallenge,validate, andseccode.
- Parameters:
website_url – Full URL of the page where the captcha appears.
gt – The
gtparameter value from the GeeTest script.challenge – The
challengetoken obtained from the GeeTest API.subdomain – Custom GeeTest API subdomain, if the site uses one.
lib – Custom
getLibparameter value, if required.
- challenge = None
- geetestApiServerSubdomain = None
- geetestGetLib = None
- gt = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteURL = None
- class python_anticaptcha.tasks.HCaptchaTask(*args: Any, **kwargs: Any)[source]
Solve an hCaptcha challenge through a proxy.
Same as
HCaptchaTaskProxylessbut additionally requires proxy, user-agent, and optional cookie parameters.
- class python_anticaptcha.tasks.HCaptchaTaskProxyless(website_url: str, website_key: str, *args: Any, **kwargs: Any)[source]
Solve an hCaptcha challenge without a proxy.
After the job completes, retrieve the token with
Job.get_solution_response().
- Parameters:
website_url – Full URL of the page where the captcha appears.
website_key – The
data-sitekeyvalue from the hCaptcha element.
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteKey = None
- websiteURL = None
- class python_anticaptcha.tasks.ImageToTextTask(image: str | Path | bytes | BinaryIO, phrase: bool | None = None, case: bool | None = None, numeric: int | None = None, math: bool | None = None, min_length: int | None = None, max_length: int | None = None, comment: str | None = None, website_url: str | None = None, *args: Any, **kwargs: Any)[source]
Solve a classic image-based captcha by extracting text from an image.
The image is automatically base64-encoded. You can pass a file path, raw
bytes, or an open binary file object.After the job completes, retrieve the text with
Job.get_captcha_text().
- Parameters:
image – Captcha image as a file path (
strorPath), rawbytes, or a binary file-like object.phrase –
Trueif the answer contains multiple words.case –
Trueif the answer is case-sensitive.numeric –
0— no requirements,1— numbers only,2— letters only.math –
Trueif the captcha is a math expression to solve.min_length – Minimum number of characters in the answer.
max_length – Maximum number of characters in the answer.
comment – Hint text shown to the worker (e.g.
"Enter red letters").website_url – URL of the page where the captcha was found (optional, used for context).
Example:
task = ImageToTextTask("captcha.png") task = ImageToTextTask(open("captcha.png", "rb").read())
- case = None
- comment = None
- math = None
- maxLength = None
- minLength = None
- numeric = None
- phrase = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteUrl = None
- class python_anticaptcha.tasks.NoCaptchaTask(*args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 challenge through a proxy.
Same as
NoCaptchaTaskProxylessTaskbut additionally requires proxy and user-agent parameters. UseProxyto build the proxy keyword arguments conveniently:proxy = Proxy.parse_url("socks5://user:pass@host:port") task = NoCaptchaTask(url, site_key, user_agent=UA, **proxy.to_kwargs())
- Parameters:
user_agent – Browser User-Agent string.
cookies – Optional cookie string (default:
"").proxy_type – Proxy protocol (
"http","socks4","socks5").proxy_address – Proxy server hostname or IP.
proxy_port – Proxy server port.
proxy_login – Proxy username (empty string if none).
proxy_password – Proxy password (empty string if none).
- class python_anticaptcha.tasks.NoCaptchaTaskProxylessTask(website_url: str, website_key: str, website_s_token: str | None = None, is_invisible: bool | None = None, recaptcha_data_s_value: str | None = None, *args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 challenge without a proxy.
This is the most common task type. The solver will access the target page directly from Anticaptcha’s servers.
After the job completes, retrieve the token with
Job.get_solution_response().
- Parameters:
website_url – Full URL of the page where the captcha appears.
website_key – The
data-sitekeyvalue from the ReCAPTCHA element.website_s_token – Optional
data-stoken for Google Search captchas.is_invisible – Set to
Truefor invisible ReCAPTCHA. The system auto-detects this, so the parameter is optional.recaptcha_data_s_value – Value of the
data-sparameter if present.Example:
task = NoCaptchaTaskProxylessTask( website_url="https://example.com", website_key="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-", )
- recaptchaDataSValue = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteKey = None
- websiteSToken = None
- websiteURL = None
- class python_anticaptcha.tasks.ProxyMixin(*args: Any, **kwargs: Any)[source]
Mixin that adds proxy parameters to a task.
Use this (via proxy-enabled task variants like
NoCaptchaTask) when the captcha must be solved through a specific proxy. You can build the keyword arguments conveniently withProxy.to_kwargs().
- Parameters:
proxy_type – Proxy protocol —
"http","socks4", or"socks5".proxy_address – Proxy server hostname or IP address.
proxy_port – Proxy server port.
proxy_login – Username for proxy authentication (empty string if none).
proxy_password – Password for proxy authentication (empty string if none).
- proxyAddress: str
- proxyLogin: str
- proxyPassword: str
- proxyPort: int
- proxyType: str
- class python_anticaptcha.tasks.RecaptchaV2EnterpriseTask(*args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 Enterprise challenge through a proxy.
Same as
RecaptchaV2EnterpriseTaskProxylessbut additionally requires proxy, user-agent, and optional cookie parameters.
- class python_anticaptcha.tasks.RecaptchaV2EnterpriseTaskProxyless(website_url: str, website_key: str, enterprise_payload: dict[str, Any] | None, api_domain: str | None, *args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 Enterprise challenge without a proxy.
Use this for sites that use the Enterprise version of ReCAPTCHA v2.
After the job completes, retrieve the token with
Job.get_solution_response().
- Parameters:
website_url – Full URL of the page where the captcha appears.
website_key – The
data-sitekeyvalue from the ReCAPTCHA element.enterprise_payload – Optional dictionary with Enterprise-specific parameters (e.g.
{"s": "...", "action": "..."}) orNone.api_domain – Custom API domain if the site uses a non-standard ReCAPTCHA endpoint (e.g.
"recaptcha.net") orNone.
- apiDomain = None
- enterprisePayload = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteKey = None
- websiteURL = None
- class python_anticaptcha.tasks.RecaptchaV2Task(*args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 challenge through a proxy (newer API type name).
Identical to
NoCaptchaTaskbut uses the updatedRecaptchaV2Tasktype identifier.
- class python_anticaptcha.tasks.RecaptchaV2TaskProxyless(website_url: str, website_key: str, website_s_token: str | None = None, is_invisible: bool | None = None, recaptcha_data_s_value: str | None = None, *args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v2 challenge without a proxy (newer API type name).
Identical to
NoCaptchaTaskProxylessTaskbut uses the updatedRecaptchaV2TaskProxylesstype identifier.
- class python_anticaptcha.tasks.RecaptchaV3TaskProxyless(website_url: str, website_key: str, min_score: float, page_action: str, is_enterprise: bool = False, *args: Any, **kwargs: Any)[source]
Solve a Google ReCAPTCHA v3 challenge (score-based, proxyless only).
ReCAPTCHA v3 returns a score (0.0–1.0) rather than a visual challenge. You must specify the minimum acceptable score and the page action.
After the job completes, retrieve the token with
Job.get_solution_response().
- Parameters:
website_url – Full URL of the page where the captcha appears.
website_key – The
data-sitekeyvalue from the ReCAPTCHA element.min_score – Minimum score threshold (e.g.
0.3,0.7,0.9).page_action – The action value from
grecaptcha.execute(key, {action: ...}).is_enterprise – Set to
Trueif the site uses the Enterprise version of ReCAPTCHA v3.
- isEnterprise = False
- minScore = None
- pageAction = None
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- websiteKey = None
- websiteURL = None
- class python_anticaptcha.tasks.UserAgentMixin(*args: Any, **kwargs: Any)[source]
Mixin that adds a
user_agentparameter to a task.Required by proxy-enabled task variants so the captcha solver can emulate the same browser.
- Parameters:
user_agent – Browser User-Agent string to use when solving.
- serialize(**result: Any) dict[str, Any][source]
Serialize the task into a dictionary for the Anticaptcha API request.
- Returns:
Dictionary with task parameters including the
typefield.
- userAgent: str