![Best-Captcha-Solving-Services[1].jpg](/data/attachments/0/992-4d885268edd06edfd2610084f7fe9fc0.jpg)
bestcaptchasolver-php is a super easy to use bypass captcha php API wrapper for bestcaptchasolver.com captcha service
Installation
composer require bestcaptchasolver/bestcaptchasolver
or
git clone https://github.com/bestcaptchasolver/bestcaptchasolver-php
How to use?
Simply require the module, set the auth details and start using the captcha service:
require('lib/bestcaptchasolver.php');
Initialize library with access token
Get token from https://bestcaptchasolver.com/account
$bcs = new BestCaptchaSolver($ACCESS_TOKEN);
Once you've set your authentication details, you can start using the API
Get balance
Returns balance in USD
$balance = $bcs->account_balance();
Submit image captcha
You can give it a b64 encoded string or a file path as image parameter
Code:
$p = array();
$p['image'] = '../captcha.jpg';
// $p['is_case'] = FALSE; // is case sensitive, default: False
// $p['is_phrase'] = FALSE; // has at least one space, default: FALSE, optional
// $p['is_math'] = FALSE; // math captcha calculation, default: FALSE, optional
// $p['alphanumeric'] = 1; // 1 - digits only, 2 - letters only, default: all, optional
// $p['minlength'] = 2; // minimum text length, default: any, optional
// $p['maxlength'] = 3; // maximum text length, default: any, optional
// $p['affiliate_id'] = 'affiliate_id'; // get it from /account, optional
$id = $bcs->submit_image_captcha($p);
Once you have the captcha ID, you can check for completion of captcha
Code:
$image_text = NULL;
while($image_text === NULL) {
$image_text = $bcs->retrieve($id)['text']; // get the image text (if completed)
sleep(2); // retry every 2 seconds
}
For recaptcha submission there are two parameters that are required an others that are optional
- page_url
- site_key
- type (optional, defaults to 1 if not given)
- 1 - v2
- 2 - invisible
- 3 - v3
- 4 - enterprise v2
- 5 - enterprise v3
- v3_action (optional)
- v3_min_score (optional)
- data_s (optional)
- cookie_input (optional)
- user_agent (optional)
- affiliate_id (optional)
- proxy (optional)
Code:
$p = array();
$p['page_url'] = $PAGE_URL;
$p['site_key'] = $SITE_KEY;
$id = $bcs->submit_recaptcha($p);
Just as the image captcha, once you have the ID, you can start checking for it's completion using the same retrieve method. The response (when ready) will be a gresponse code
Code:
$gresponse = NULL;
while($gresponse === NULL) {
$gresponse = $bcs->retrieve($id)['gresponse']; // get the image text (if completed)
sleep(2); // retry every 2 seconds
}
$proxy_status = $bcs->retrieve($id)['proxy_status']
Geetest
- domain
- gt
- challenge
- api_server (optional)
Code:
$p = array();
$p['domain'] = 'DOMAIN_HERE';
$p['gt'] = 'GT_HERE';
$p['challenge'] = 'CHALLENGE_HERE';
//$p['api_server'] = 'GT_DOMAIN_HERE'; // optional
//$p["affiliate_id"] = "affiliate_id";
$id = $bcs->submit_geetest($p);
// get solution
$solution = $bcs->retrieve($id)['solution']; // get the image text (if completed)
- page_url
- site_key
Code:
$p = array();
$p['page_url'] = 'PAGE_URL_HERE';
$p['site_key'] = 'SITE_KEY_HERE';
//$p["affiliate_id"] = "affiliate_id";
$id = $bcs->submit_capy($p);
// get solution
$solution = $bcs->retrieve($id)['solution'];
- page_url
- site_key
Code:
$p = array();
$p['page_url'] = 'PAGE_URL_HERE';
$p['site_key'] = 'SITE_KEY_HERE';
//$p["affiliate_id"] = "affiliate_id";
$id = $bcs->submit_hcaptcha($p);
// get solution
$solution = $bcs->retrieve($id)['solution'];
- page_url
- s_url
- site_key
Code:
$p = array();
$p['page_url'] = 'https://abc.com';
$p['s_url'] = 'https://api.arkoselabs.com';
$p['site_key'] = '11111111-1111-1111-1111-111111111111';
//$p['data'] = '{"x":"y"}'; // optional
//$p["affiliate_id"] = "affiliate_id"; // get it from /account
$id = $bcs->submit_funcaptcha($p);
$solution = $bcs->retrieve($id)['solution'];
When a captcha was solved wrong by our workers, you can notify the server with it's ID, so we know something went wrong.
$bcs->set_captcha_bad(50);
Documentation https://github.com/bestcaptchasolver/bestcaptchasolver-php