定制 cap_monster/client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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/guzzle with php-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
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固