solvercaptcha/solvecaptcha-php
Composer 安装命令:
composer require solvercaptcha/solvecaptcha-php
包简介
PHP package for easy integration with solvecaptcha API.
关键字:
README 文档
README
PHP Captcha Solver: Bypass reCAPTCHA, Cloudflare, Amazon and more
Use the PHP captcha solver to automatically bypass any captcha — including reCAPTCHA v2, Invisible, v3, Enterprise, Cloudflare Turnstile, GeeTest, sliders, Amazon AWS WAF, FunCaptcha, and both image and text based captchas.
✅ Supported captcha solvers
To get started quickly, check out the Captcha Solver API documentation.
Helpful links:
- reCAPTCHA v2 solver
- reCAPTCHA v3 solver
- Text and image captcha solver
- Cloudflare captcha solver (Turnstile)
- Amazon captcha solver (AWS WAF)
- GeeTest solver
- FunCaptcha (Arkose Labs) solver
- Other types
🛠️ Features
- Fast and fully automated captcha bypass
- Native support for PHP 7.4+ / 8.x
- Works with cURL, Guzzle, Symfony HTTP client, and any - REST-compatible tool
- Easy integration with frameworks like Laravel, Symfony, CodeIgniter
- Clean, promise-like async handling via callbacks or jobs
- Pay only for successful solves
- 99.9% uptime
- 24/7 developer support
📦 Use cases
- Accesability
- Web scraping
- Automating form submissions in Laravel or other PHP apps
- Captcha solving in background workers or job queues
- QA testing of protected flows
- Security research
Need help integrating with your PHP application? Open an issue or fork this repo to contribute.
- PHP Captcha Solver: Bypass reCAPTCHA, Cloudflare, Amazon and more
Installation
This package can be installed via composer or manually
- Download composer from https://getcomposer.org/installer to your project directory
- Run
php composer.phar install
Composer
composer require solvecaptcha/solvecaptcha
Manual
Clone it manually:
git clone https://github.com/solvercaptcha/solvecaptcha-php.git
Copy src directory to your project and then require autoloader (src/autoloader.php) where needed:
require 'path/to/solvecaptcha-php/src/autoloader.php';
Configuration
SolveCaptcha instance can be created like this:
$solver = new \SolveCaptcha\SolveCaptcha('YOUR_API_KEY');
Also there are few options that can be configured:
$solver = new \SolveCaptcha\SolveCaptcha([ 'server' => 'https://solvecaptcha.com', 'apiKey' => 'YOUR_API_KEY', 'defaultTimeout' => 120, 'recaptchaTimeout' => 600, 'pollingInterval' => 10, 'json' => 1, ]);
SolveCaptcha instance options
| Option | Default value | Description |
|---|---|---|
| defaultTimeout | 120 | Polling timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from res.php API endpoint |
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from res.php API endpoint |
| pollingInterval | 10 | Interval in seconds between requests to res.php API endpoint, setting values less than 5 seconds is not recommended |
| json | 0 | Json or String format response from res.php API endpoint, json = 1 returns JSON format response |
To get the answer manually use getResult method
Solve captcha
When you submit any image-based captcha use can provide additional options to help solvecaptcha workers to solve it properly.
Captcha options
| Option | Default Value | Description |
|---|---|---|
| numeric | 0 | Defines if captcha contains numeric or other symbols see more info in the API docs |
| minLength | 0 | minimal answer length |
| maxLength | 0 | maximum answer length |
| phrase | 0 | defines if the answer contains multiple words or not |
| caseSensitive | 0 | defines if the answer is case sensitive |
| calc | 0 | defines captcha requires calculation |
| lang | - | defines the captcha language, see the list of supported languages |
| hintImg | - | an image with hint shown to workers with the captcha |
| hintText | - | hint or task text shown to workers with the captcha |
Below you can find basic examples for every captcha type. Check out examples directory to find more examples with all available options.
Normal Captcha
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.
$result = $solver->normal('path/to/captcha.jpg');
Text Captcha
This method can be used to bypass a captcha that requires to answer a question provided in clear text.
$result = $solver->text('If tomorrow is Saturday, what day is today?');
reCAPTCHA v2
Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
$result = $solver->recaptcha([ 'sitekey' => '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-', 'url' => 'https://mysite.com/page/with/recaptcha', ]);
reCAPTCHA v3
This method provides reCAPTCHA V3 solver and returns a token.
$result = $solver->recaptcha([ 'sitekey' => '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-', 'url' => 'https://mysite.com/page/with/recaptcha', 'version' => 'v3', ]);
FunCaptcha
FunCaptcha (Arkoselabs) solving method. Returns a token.
$result = $solver->funcaptcha([ 'sitekey' => '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-', 'url' => 'https://mysite.com/page/with/funcaptcha', ]);
GeeTest
Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.
$result = $solver->geetest([ 'gt' => 'f1ab2cdefa3456789012345b6c78d90e', 'challenge' => '12345678abc90123d45678ef90123a456b', 'url' => 'https://www.site.com/page/', ]);
GeeTest V4
Method to solve GeeTest V4 puzzle captcha. Returns a set of tokens as JSON.
$result = $solver->geetest_v4([ 'captchaId' => '72bf15796d0b69c43867452fea615052', 'url' => 'https://mysite.com/captcha.html', ]);
KeyCaptcha
Token-based method to solve KeyCaptcha.
$result = $solver->keycaptcha([ 's_s_c_user_id' => 10, 's_s_c_session_id' => '493e52c37c10c2bcdf4a00cbc9ccd1e8', 's_s_c_web_server_sign' => '9006dc725760858e4c0715b835472f22-pz-', 's_s_c_web_server_sign2' => '2ca3abe86d90c6142d5571db98af6714', 'url' => 'https://www.keycaptcha.ru/demo-magnetic/', ]);
Capy
Token-based method to bypass Capy puzzle captcha.
$result = $solver->capy([ 'sitekey' => 'PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v', 'url' => 'http://mysite.com/', 'api_server' => 'https://jp.api.capy.me/', ]);
Grid
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.
$result = $solver->grid('path/to/captcha.jpg');
Canvas
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.
$result = $solver->canvas('path/to/captcha.jpg');
ClickCaptcha
ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.
$result = $solver->coordinates('path/to/captcha.jpg');
Rotate
This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle.
$result = $solver->rotate('path/to/captcha.jpg');
Audio
This method can be used to solve a audio captcha
$result = $solver->audio('path/to/audio.mp3');
Yandex
Use this method to solve Yandex and obtain a token to bypass the protection.
$result = $solver->yandex([ 'sitekey' => 'Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV', 'url' => 'https://rutube.ru', ]);
Lemin Cropped Captcha
Use this method to solve Lemin and obtain a token to bypass the protection.
$result = $solver->lemin([ 'captchaId' => 'CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d', 'apiServer' => 'api.leminnow.com', 'url' => 'https://www.site.com/page/', ]);
Cloudflare Turnstile
Use this method to solve Turnstile and obtain a token to bypass the protection.
$result = $solver->turnstile([ 'sitekey' => '0x4AAAAAAAChNiVJM_WtShFf', 'url' => 'https://ace.fusionist.io', ]);
Amazon WAF
Use this method to solve Amazon WAF and obtain a token to bypass the protection.
$result = $solver->amazon_waf([ 'sitekey' => 'AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg', 'url' => 'https://non-existent-example.execute-api.us-east-1.amazonaws.com', 'iv' => 'test_iv', 'context' => 'test_context' ]);
Tencent
Use this method to bypass Tencent.
$result = $solver->tencent([ 'sitekey' => '123456789', 'url' => 'https://www.site.com/page/', ]);
MTCaptcha
Use this method to bypass MTCaptcha.
$result = $solver->mt_captcha([ 'sitekey' => 'MTPublic-KzqLY1cKH', 'url' => 'https://solvecaptcha.com/demo/mtcaptcha', ]);
Cutcaptcha
Use this method to bypass Cutcaptcha.
$result = $solver->cutcaptcha([ 'misery_key' => 'a1488b66da00bf332a1488993a5443c79047e752', 'api_key' => 'SAb83IIB', 'url' => 'https://example.cc/foo/bar.html', ]);
Friendly Captcha
Use this method to bypass Friendly Captcha.
$result = $solver->friendly_captcha([ 'sitekey' => '2FZFEVS1FZCGQ9', 'url' => 'https://example.com/', ]);
atbCAPTCHA
Use this method to bypass atbCAPTCHA.
$result = $solver->atb_captcha([ 'sitekey' => 'af23e041b22d000a11e22a230fa8991c', 'api_server' => 'https://cap.aisecurius.com', 'url' => 'https://example.com/', ]);
DataDome
Use this method to bypass DataDome.
Important
To solve the DataDome captcha, you must use a proxy. It is recommended to use residential proxies.
$result = $solver->datadome([ 'captcha_url' => 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAA...P~XFrBVptk&t=fe&referer=https%3A%2F%2Fhexample.com&s=45239&e=c538be..c510a00ea', 'userAgent' => 'https://cap.aisecurius.com', 'url' => 'https://example.com/', 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321', ], ]);
CyberSiARA
Use this method to bypass CyberSiARA.
$result = $solver->cybersiara([ 'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv', 'pageurl' => 'https://demo.mycybersiara.com/', 'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', ]);
Other methods
send / getResult
These methods can be used for manual captcha submission and answer polling.
$id = $solver->send(['file' => 'path/to/captcha.jpg', ...]); sleep(20); $code = $solver->getResult($id);
balance
Use this method to get your account's balance
$balance = $solver->balance();
report
Use this method to report good or bad captcha answer.
$solver->report($id, true); // captcha solved correctly $solver->report($id, false); // captcha solved incorrectly
Proxies
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf and etc. The proxy will be forwarded to the API to solve the captcha.
Example solving reCAPTCHA V2 using proxy:
$result = $solver->recaptcha([ 'sitekey' => '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-', 'url' => 'https://mysite.com/page/with/recaptcha', 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'login:password@IP_address:PORT', ], ]);
Error handling
If case of an error captch solver throws an exception. It's important to properly handle these cases. We recommend to use try catch to handle exceptions.
try { $result = $solver->text('If tomorrow is Saturday, what day is today?'); } catch (\SolveCaptcha\Exception\ValidationException $e) { // invalid parameters passed } catch (\SolveCaptcha\Exception\NetworkException $e) { // network error occurred } catch (\SolveCaptcha\Exception\ApiException $e) { // api respond with error } catch (\SolveCaptcha\Exception\TimeoutException $e) { // captcha is not solved so far }
Examples
Examples of solving all supported captcha types are located in the examples directory.
Get in touch
License
The code in this repository is licensed under the MIT License. See the LICENSE file for more details.
solvercaptcha/solvecaptcha-php 适用场景与选型建议
solvercaptcha/solvecaptcha-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.62k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2025 年 04 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「recaptcha」 「captcha」 「decaptcha」 「tencent」 「keycaptcha」 「funcaptcha」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 solvercaptcha/solvecaptcha-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 solvercaptcha/solvecaptcha-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 solvercaptcha/solvecaptcha-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ImagetyperzAPI PHP is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
PHP package for easy integration with 2captcha API
Client library for reCAPTCHA with proxy support, a free service that protects websites from spam and abuse.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
ImagetyperzAPI PHP is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
A simple and easy to use Google ReCaptcha v3 package for Laravel
统计信息
- 总下载量: 2.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-21