cap_monster/client
Composer 安装命令:
composer require cap_monster/client
包简介
PHP client for the CapMonster Cloud captcha-solving API (reCAPTCHA v2/v3, hCaptcha, FunCaptcha, GeeTest, Turnstile, image-to-text and more)
关键字:
README 文档
README
A PHP 8.2+ client for the CapMonster Cloud captcha-solving API. Bring your own PSR-18 HTTP client, build a task DTO, get a solution back.
Requirements
- PHP 8.2+
- A PSR-18 HTTP client implementation (e.g.
symfony/http-client,guzzlehttp/guzzlewithphp-http/guzzle7-adapter, etc.)
Installation
composer require cap_monster/client
Usage
use CapMonsterClient\CapMonsterClient; use CapMonsterClient\CapMonsterConfiguration; use CapMonsterClient\Dto\Task\NoCaptchaTask; $configuration = new CapMonsterConfiguration('YOUR_CAPMONSTER_CLIENT_KEY'); $client = new CapMonsterClient($yourPsr18HttpClient, $configuration); $task = new NoCaptchaTask( websiteUrl: 'https://example.com/page-with-captcha', websiteKey: 'site-key-from-the-page' ); $solution = $client->runTask($task); // blocks, polling getTaskResult until ready or timeout echo $solution->getGRecaptchaResponse(); $balance = $client->getBalance();
runTask() handles createTask + polling getTaskResult for you, and throws CapMonsterClient\Common\Exception\CapMonsterException (wrapping a CapMonsterClient\Enum\ErrorType) on any API or timeout error.
Supported captcha types
ImageToTextTask, NoCaptchaTask/NoCaptchaTaskProxyless (reCAPTCHA v2), RecaptchaV2EnterpriseTask, RecaptchaV3TaskProxyless, RecaptchaV3EnterpriseTask, FunCaptchaTask/FunCaptchaTaskProxyless, HCaptchaTask/HCaptchaTaskProxyless, GeeTestTask (v3 & v4), TurnstileTask, TurnstileChallengeTask, TurnstileWaitingRoomTask, ComplexImageTask, DataDomeTask, ImpervaTask, BasiliskTask, TenDITask, AmazonTask, BinanceTask, ProsopoTask, YidunTask, MTCaptchaTask, AltchaTask, CastleTask, TSPDTask, HuntTask, AlibabaTask.
Each task's exact request/response shape is documented in the source repository's docs/API_CONTRACT.md (not shipped in the installed package — see the GitHub repo).
Configuration
CapMonsterConfiguration accepts an optional array of overrides (base URL, per-task polling timeouts, HTTP headers, callback URL, max poll attempts) — see CapMonsterConfiguration::__construct() for the full option set.
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-04