pip3 install 2captcha-pythonWe invite you to explore our GitHub repository where you can find libraries and SDK for easy integration with our API.
Description of all the necessary parameters to configure the installed package
An instance of the TwoCaptcha class can be created like this:
from twocaptcha import TwoCaptcha
solver = TwoCaptcha('YOUR_API_KEY')
You also have the ability to customize some of the options for the created instance:
config = {
'server': '2captcha.com',
'apiKey': 'YOUR_API_KEY',
'softId': 123,
'callback': 'https://your.site/result-receiver',
'defaultTimeout': 120,
'recaptchaTimeout': 600,
'pollingInterval': 10,
}
solver = TwoCaptcha(**config)
| Option | Default value | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| server | '2captcha.com' | API server. You can set it to 'rucaptcha.com' if your account is registered there | ||||||||||||||||||||||||||||||
| softId | - | your software ID obtained after publishing in getResult methodSolve captchaWhen you submit any image-based captcha use can provide additional options to help 2Captcha workers to solve it properly Captcha options
To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image. This method can be used to bypass a captcha that requires to answer a question provided in clear text. Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection. This method provides reCAPTCHA V3 solver and returns a token. FunCaptcha (Arkoselabs) solving method. Returns a token. Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON. Token-based method to solve KeyCaptcha. Token-based method to bypass Capy puzzle captcha. Grid method is originally called Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes. Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon. ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image. This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle. Other methodsAdditional valid methods used during the work of the main scripts send / getResultThese methods can be used for manual captcha submission and answer polling. balanceUse this method to get your account's balance. reportUse this method to report good or bad captcha answer. Error handlingPossible variants of standard errors returned by the service when processing requests If case of an error captcha solver throws an exception. It's important to properly handle these cases. We recommend to use ProxiesYou can pass your proxy as an additional arguments for methods: recaptcha, funcaptcha and geetest. The proxy will be forwarded to the API to solve the captcha. Async callsYou can also make async calls with asyncio, for example: Other languages for integration with the service API |