Python is a high-level, interpreted programming language. It is known for its simplicity and readability. It is a versatile language that can be used for web development, data analysis, artificial intelligence, and more.
Integrate our Python captcha solver package to automatically solve CAPTCHA on any website.
Easy integration with the API of captcha solving service to bypass reCAPTCHA and solve any other CAPTCHA
Install NextCaptcha Python SDK with pip or manually
pip install nextcaptcha-python
pip install git+https://github.com/nextcaptcha/nextcaptcha-python.git
git clone https://github.com/nextcaptcha/nextcaptcha-python.git
cd nextcaptcha-python
pip install .
python setup.py install
import nextcaptcha
print(nextcaptcha.__version__)
pip install -r requirements.txt
Configure the NextCaptcha Python SDK with necessary parameters
client_key
: Your API key from NextCaptchasoft_id
: Your software ID (optional)callback_url
: The URL for receiving responses asynchronously (if using callback mode)open_log
: Enable logging for debuggingfrom nextcaptcha import NextCaptchaAPI
# Configuration settings
config = {
"client_key": "your_client_key_here", # Replace with your NextCaptcha API key
"soft_id": 12345, # Your software ID (optional, replace if required)
"callback_url": "https://your-callback-url.com", # Callback URL (optional)
"open_log": True # Enable logging for debugging
}
# Initialize the NextCaptcha client
solver = NextCaptchaAPI(**config)
# Test request (example: solving a reCAPTCHA)
task = {
"type": "ReCaptchaV2TaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "your_recaptcha_site_key"
}
# Send the task and get the result
try:
task_id = solver.create_task(task)
result = solver.get_result(task_id)
print("Captcha solution:", result)
except Exception as e:
print("Error:", str(e))
Parameter | Description |
---|---|
client_key | Your NextCaptcha API key (required) |
soft_id | Your software ID (optional) |
callback_url | A URL where the results will be sent (optional, only for async tasks) |
open_log | If `True`, enables logging for debugging |
Solve reCAPTCHA v2/v3/Enterprise via Token-based method
# {props.t('solve6')}
result = api.recaptchav2(website_url="https://example.com", website_key="SITE_KEY")
# {props.t('solve6')}
result = api.recaptchav2enterprise(website_url="https://example.com", website_key="SITE_KEY")
result = api.recaptchav2hs_enterprise(website_url="https://example.com", website_key="SITE_KEY")
result = api.recaptchav3(website_url="https://example.com", website_key="SITE_KEY")
result = api.recaptchav3hs(website_url="https://example.com", website_key="SITE_KEY")
result = api.recaptcha_mobile(app_key="APP_KEY", app_package_name="com.example.app", app_action="APP_ACTION", app_device="ios")
<input type="hidden" name="g-recaptcha-response" value="your_token_here" />
Parameter | Description |
---|---|
website_url | The URL of the website where the reCAPTCHA is located |
website_key | The sitekey of the reCAPTCHA |
page_action | The action parameter to use for the reCAPTCHA |
api_domain | The domain of the reCAPTCHA API if different from the default |
website_info | Detailed reCAPTCHA config about a target website the |
✅ Supports reCAPTCHA v2, v3, Enterprise, and Mobile
✅ Proxyless mode is available (use a proxy if the site requires specific IPs)
✅ Token-based method allows seamless captcha bypassing.
Id | Code | Description |
---|---|---|
0 | - | no error occurred |
1 | ERROR_KEY_DOES_NOT_EXIST | Your API key is incorrect, please make sure you have set it up correctly and copy it from client or developer mode in Control Panel |
10 | ERROR_ZERO_BALANCE | Your account balance is zero |
11 | ERROR_IP_NOT_ALLOWED | The request was made from an IP address that is not in your trusted IP list |
12 | ERROR_CAPTCHA_UNSOLVABLE | The captcha cannot be solved normally. It may encounter a proxy, or the solution fails for various network reasons. In general, you can try again. |
14 | ERROR_NO_SUCH_METHOD | A method that does not exist in the API was requested |
15 | ERROR_IMAGE_TYPE_NOT_SUPPORTED | The image cannot be processed because the image format or size is incorrect, or the image is corrupted. Please check the image in your request |
16 | ERROR_NO_SUCH_CAPCHA_ID | The Captcha ID you provided is incorrect |
21 | ERROR_IP_BLOCKED | Your IP address has been banned due to inappropriate use of the API |
22 | ERROR_TASK_ABSENT | You did not include the task attribute in the createTask method call |
23 | ERROR_TASK_NOT_SUPPORTED | The task attribute in your createTask method call contains a task type that is not support by Our API, or the type attribute is incorrect. |
31 | ERROR_RECAPTCHA_INVALID_SITEKEY | The reCAPTCHA sitekey value you provided is invalid |
55 | ERROR_ACCOUNT_SUSPENDED | Your account has been suspended due to improper use of API. Please Connect Via Telegram support team to resolve this issue |
130 | ERROR_BAD_PROXY | The proxy parameters are incorrect or the connection cannot be established through the proxy |
110 | ERROR_BAD_PARAMETERS | A required captcha parameter is missing from your request, or the parameter format is incorrect. Please ensure that your request payload format is appropriate for the selected task type |
500 | ERROR_UNKNOWN | Unknown error. It may be an unexpected error in the system. You can contact the administrator who sent the error to solve the problem. |