Package: unicaps
UnicapsUnicaps is a unified Python API for CAPTCHA solving services.⚠PLEASE NOTE⚠ A solving service API key is required to use this package!⚠ The list of the supported services you can find in the table below.Key FeaturesA unified Python interface that is independent of the service usedUses native service protocol/endpoints (eg, no needs in patchinghostsfile)Has both synchronous and asynchronous clientSupports 10 types of CAPTCHAsSupports 7 CAPTCHA solving servicesWritten Pythonic way and is intended for humansInstallationpip install -U unicapsSimple Usage Example>>>fromunicapsimportCaptchaSolver,CaptchaSolvingService>>>solver=CaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,api_key="<PLACE_YOUR_API_KEY_HERE>")>>>solver.get_balance()2.84161>>>solved=solver.solve_image_captcha(open("captcha.jpg","rb"),is_phrase=False,is_case_sensitive=True)>>>solved.solution.text'w93Bx'>>>solved.cost0.00078>>>solved.report_good()TrueAsynchronous ExampleimportasynciofrompathlibimportPathfromunicapsimportAsyncCaptchaSolver,CaptchaSolvingServiceAPI_KEY='<PLACE_YOUR_API_KEY_HERE>'asyncdefmain():asyncwithAsyncCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,API_KEY)assolver:solved=awaitsolver.solve_image_captcha(Path("captcha.jpg"),is_phrase=False,is_case_sensitive=True)print(f'CAPTCHA text:{solved.solution.text}')awaitsolved.report_good()if__name__=='__main__':asyncio.run(main())Supported CAPTCHAs / ServicesCAPTCHA➡ \ Service⬇ImageTextreCAPTCHA v2reCAPTCHA v3FunCaptchaKeyCAPTCHAGeetestGeetest v4hCaptchaCapy2captcha.com✅✅✅✅✅✅✅✅✅✅anti-captcha.com✅❌✅✅✅❌✅✅✅❌azcaptcha.com✅❌✅✅✅❌❌❌✅❌captcha.guru✅❌✅✅❌❌✅❌✅❌cptch.net✅❌✅✅❌❌❌❌❌❌deathbycaptcha.com✅❌✅✅✅❌❌❌✅❌rucaptcha.com✅✅✅✅✅✅✅✅✅✅Image CAPTCHAServiceRegularCase SensitivePhraseNumbers onlyLetters onlyMathLengthLanguageComment for worker2captcha.com✅✅✅✅✅✅✅Cyrillic/Latin✅anti-captcha.com✅✅✅✅✅✅✅Latin✅azcaptcha.com✅❌❌❌❌❌❌Latin✅captcha.guru✅❌❌❌❌❌❌Latin✅cptch.net✅❌❌❌❌❌❌Cyrillic/Latin❌deathbycaptcha.com✅❌❌❌❌❌❌Latin❌rucaptcha.com✅✅✅✅✅✅✅Cyrillic/Latin✅Text CAPTCHAWhat is this?Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification.
For example: "If tomorrow is Saturday, what day is today?".ServiceLanguage2captcha.comEnglish, Russiananti-captcha.com❌azcaptcha.com❌captcha.guru❌cptch.net❌deathbycaptcha.com❌rucaptcha.comEnglish, RussianreCAPTCHA v2ServiceRegularInvisibleEnterpriseGoogle service1Proxy2Cookies3User-Agent42captcha.com✅✅✅✅✅✅✅anti-captcha.com✅✅✅✅✅✅✅azcaptcha.com✅✅❌✅✅✅✅captcha.guru✅✅❌✅✅✅✅cptch.net✅✅❌❌❌❌❌deathbycaptcha.com✅✅❌✅✅❌❌rucaptcha.com✅✅✅✅✅✅✅1Support of solving reCAPTCHA on Google services (e.g. Google Search)2Support of solving via proxy server3Support of passing custom cookies4Support of passing custom User-Agent headerreCAPTCHA v3ServiceRegularEnterpriseProxyCookiesUser-Agent2captcha.com✅✅❌❌❌anti-captcha.com✅✅❌❌❌azcaptcha.com✅❌✅❌❌captcha.guru✅❌✅✅✅cptch.net✅❌❌❌❌deathbycaptcha.com✅❌✅❌❌rucaptcha.com✅✅❌❌❌FunCaptcha (Arkose Labs)ServiceRegularData (BLOB)ProxyCookiesUser-Agent2captcha.com✅✅✅❌✅anti-captcha.com✅✅✅❌✅azcaptcha.com✅✅✅❌✅captcha.guru❌❌❌❌❌cptch.net❌❌❌❌❌deathbycaptcha.com✅❌✅❌❌rucaptcha.com✅✅✅❌✅KeyCAPTCHAServiceRegularProxyCookiesUser-Agent2captcha.com✅❌❌❌anti-captcha.com❌❌❌❌azcaptcha.com❌❌❌❌captcha.guru❌❌❌❌cptch.net❌❌❌❌deathbycaptcha.com❌❌❌❌rucaptcha.com✅❌❌❌GeetestServiceRegularAPI serverGetLibProxyCookiesUser-Agent2captcha.com✅✅❌✅❌✅anti-captcha.com✅✅✅✅❌✅azcaptcha.com❌❌❌❌❌❌captcha.guru✅❌❌✅❌❌cptch.net❌❌❌❌❌❌deathbycaptcha.com❌❌❌❌❌❌rucaptcha.com✅✅❌✅❌✅Geetest v4ServiceRegularProxyCookiesUser-Agent2captcha.com✅✅❌✅anti-captcha.com✅✅❌✅azcaptcha.com❌❌❌❌captcha.guru❌❌❌❌cptch.net❌❌❌❌deathbycaptcha.com❌❌❌❌rucaptcha.com✅✅❌✅hCaptchaServiceRegularInvisibleCustom DataProxyCookiesUser-Agent2captcha.com✅✅✅✅❌✅anti-captcha.com✅✅❌✅❌✅azcaptcha.com✅❌❌✅❌❌captcha.guru✅❌❌✅❌❌cptch.net❌❌❌❌❌❌deathbycaptcha.com✅❌❌✅❌❌rucaptcha.com✅✅✅✅❌✅Capy PuzzleServiceRegularAPI serverProxyCookiesUser-Agent2captcha.com✅✅✅❌❌anti-captcha.com❌❌❌❌❌azcaptcha.com❌❌❌❌❌captcha.guru❌❌❌❌❌cptch.net❌❌❌❌❌deathbycaptcha.com❌❌❌❌❌rucaptcha.com✅✅✅❌❌Supported Proxy typesServiceHTTPHTTPSSOCKS 4SOCKS 52captcha.com✅✅✅✅anti-captcha.com✅✅✅✅azcaptcha.com✅✅✅✅captcha.guru✅✅✅✅cptch.net❌❌❌❌deathbycaptcha.com✅❌❌❌rucaptcha.com✅✅✅✅How to...CommonGet balancefromunicapsimportCaptchaSolver,CaptchaSolvingService# init captcha solverwithCaptchaSolver(CaptchaSolvingService.ANTI_CAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:balance=solver.get_balance()Get service status (is the service is up?)fromunicapsimportCaptchaSolver,CaptchaSolvingService# init captcha solverwithCaptchaSolver(CaptchaSolvingService.ANTI_CAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# get status of the service (True - everything is Okay, False - probably the service is down)status=solver.get_status()Get technical details after solvingfromunicapsimportCaptchaSolver,CaptchaSolvingService# init captcha solver and solve the captchawithCaptchaSolver(CaptchaSolvingService.ANTI_CAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:solved=solver.solve_...(...)# get cost of the solvingcost=solved.cost# get cookies (if any)cookies=solved.cookies# report good captchasolved.report_good()# report bad captchasolved.report_bad()# get solving start timestart_time=solved.start_time# get solving end timeend_time=solved.end_timeCAPTCHAsSolve Image CAPTCHAimportpathlibfromunicapsimportCaptchaSolver,CaptchaSolvingServicefromunicaps.commonimportCaptchaCharType,CaptchaAlphabet# image file: it can be a Path, file-object or bytes.image_file=pathlib.Path(r'/tmp/captcha.png')# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_image_captcha(image=image_file,char_type=CaptchaCharType.ALPHA,# optionalis_phrase=False,# optionalis_case_sensitive=True,# optionalis_math=False,# optionalmin_len=4,# optionalmax_len=6,# optionalalphabet=CaptchaAlphabet.LATIN,# optionalcomment='Type RED letters only'# optional)# get CAPTCHA texttoken=solved.solution.textSolve reCAPTCHA v2fromunicapsimportCaptchaSolver,CaptchaSolvingService# get page URL and site_key from your pagepage_url=...site_key=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v2(site_key=site_key,page_url=page_url,data_s='<data-s value>',# optionalapi_domain='<"google.com" or "recaptcha.net">'# optional)# get response tokentoken=solved.solution.tokenSolve reCAPTCHA v2 InvisiblefromunicapsimportCaptchaSolver,CaptchaSolvingService# get page url and site_key from your pagepage_url=...site_key=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v2(site_key=site_key,page_url=page_url,is_invisible=True,data_s='<data-s value>',# optionalapi_domain='<"google.com" or "recaptcha.net">'# optional)# get response tokentoken=solved.solution.tokenSolve reCAPTCHA v2 EnterprisefromunicapsimportCaptchaSolver,CaptchaSolvingService# get page URL, site_key and data_s from your pagepage_url=...site_key=...data_s=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v2(site_key=site_key,page_url=page_url,is_enterprise=True,data_s=data_s,# optionalapi_domain='<"google.com" or "recaptcha.net">'# optional)# get response tokentoken=solved.solution.tokenSolve reCAPTCHA v3fromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...site_key=...action=...min_score=0.7# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v3(site_key=site_key,page_url=page_url,action=action,# optionalmin_score=min_score,# optionalapi_domain='<"google.com" or "recaptcha.net">'# optional)# get response tokentoken=solved.solution.tokenSolve reCAPTCHA v3 EnterprisefromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...site_key=...action=...min_score=0.7# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v3(site_key=site_key,page_url=page_url,is_enterprise=True,action=action,# optionalmin_score=min_score,# optionalapi_domain='<"google.com" or "recaptcha.net">'# optional)# get response tokentoken=solved.solution.tokenSolve hCaptchafromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...site_key=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_hcaptcha(site_key=site_key,page_url=page_url,api_domain=<"hcaptcha.com"or"js.hcaptcha.com"># optional)# get response tokentoken=solved.solution.tokenSolve hCaptcha InvisiblefromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...site_key=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_hcaptcha(site_key=site_key,page_url=page_url,is_invisible=True,api_domain=<"hcaptcha.com"or"js.hcaptcha.com"># optional)# get response tokentoken=solved.solution.tokenSolve FunCaptchafromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepublic_key=...page_url=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_funcaptcha(public_key=public_key,page_url=page_url,service_url='<value of surl parameter>',# optionalblob='<value of data[blob] parameter>'# optional)# get response tokentoken=solved.solution.tokenSolve KeyCaptchafromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...user_id=...session_id=...ws_sign=...ws_sign2=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_keycaptcha(page_url=page_url,user_id=user_id,session_id=session_id,ws_sign=ws_sign,ws_sign2=ws_sign2)# get response tokentoken=solved.solution.tokenSolve GeetestfromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...gt_key=...challenge=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_geetest(page_url=page_url,gt_key=gt_key,challenge=challenge,api_server='<value of api_server parameter>'# optional)# get response tokentoken=solved.solution.tokenSolve Geetest v4fromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitepage_url=...captcha_id=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_geetest_v4(page_url=page_url,captcha_id=captcha_id)# get solution datalot_number=solved.solution.lot_numberpass_token=solved.solution.pass_tokengen_time=solved.solution.gen_timecaptcha_output=solved.solution.captcha_outputSolve Capy PuzzlefromunicapsimportCaptchaSolver,CaptchaSolvingService# get CAPTCHA params from the target page/sitesite_key=...page_url=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_capy_puzzle(site_key=site_key,page_url=page_url,api_server='<for example "https://api.capy.me">',# optionalchallenge_type='<"puzzle" or "avatar">'# optional)# get solution datacaptchakey=solved.solution.captchakeychallengekey=solved.solution.challengekeyanswer=solved.solution.answerSolve a text CAPTCHAfromunicapsimportCaptchaSolver,CaptchaSolvingServicefromunicaps.commonimportCaptchaAlphabet,WorkerLanguage# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_text_captcha(text='Si mañana es domingo, ¿qué día es hoy?',alphabet=CaptchaAlphabet.LATIN,# optionallanguage=WorkerLanguage.SPANISH# optional)# get answeranswer=solved.solution.text# SábadoError handlingCatch exceptionsfromunicapsimportCaptchaSolver,CaptchaSolvingService,exceptions# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAtry:solved=solver.solve_recaptcha_v2(site_key=site_key,page_url=page_url)exceptexceptions.AccessDeniedError:# wrong API key or the current IP is bannedpassexceptexceptions.LowBalanceError:# low balancepassexceptexceptions.ServiceTooBusy:# no available slots to solve CAPTCHApassexceptexceptions.SolutionWaitTimeout:# haven't received a solution within N minutespassexceptexceptions.TooManyRequestsError:# request limit exceededpassexceptexceptions.BadInputDataError:# bad CAPTCHA data (bad image, wrong URL, etc.)passexceptexceptions.UnableToSolveError:# CAPTCHA unsolvablepassexceptexceptions.ProxyError:# bad proxypassexceptexceptions.NetworkError:# network connection errorpasselse:# get response tokentoken=solved.solution.tokenMiscCreate a task and wait for the resultfromunicapsimportCaptchaSolver,CaptchaSolvingServicefromunicaps.captchaimportRecaptchaV2# get page URL and site_key from your pagepage_url=...site_key=...# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# create a tasktask=solver.create_task(RecaptchaV2(site_key,page_url))# print task IDprint(task.task_id)# wait for task to be completedsolved=task.wait()# get response tokentoken=solved.solution.tokenAdd proxy, cookies and User-AgentfromunicapsimportCaptchaSolver,CaptchaSolvingServicefromunicaps.proxyimportProxyServer# get page URL and site_key from your pagepage_url=...site_key=...proxy='http://user:password@domain.com:8080'user_agent='<USER AGENT STRING>'cookies={'name':'value',...}# init captcha solverwithCaptchaSolver(CaptchaSolvingService.TWOCAPTCHA,"<PLACE YOUR API KEY HERE>")assolver:# solve CAPTCHAsolved=solver.solve_recaptcha_v2(site_key=site_key,page_url=page_url,proxy=ProxyServer(proxy),user_agent=user_agent,cookies=cookies)# get response tokentoken=solved.solution.tokenReal-life code examplesExamples