bestcaptchasolver-client - Bestcaptchasolver JS client API library
Bypass image captcha and reCAPTCHA with bestcaptchasolver service, JS library
Installation
npm install bestcaptchasolver-client
or
git clone https://github.com/bestcaptchasolver/bestcaptchasolver-javascript
Usage
Promises are used inside the library, for better code management
Simply require the module, set the auth details and start using the captcha service:
<!-- Load jQuery (dependency) -->
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<!-- Load the API library -->
<script src="../lib/bestcaptchasolver.js"></script>
Set access token, before using the library
bestcaptchasolverapi.set_access_token('access token from /account');
Get balance
bestcaptchasolverapi.account_balance().then(function (balance) {
console.log('Balance: $', balance);
})
Submit image captcha
The submission of image captcha is done by sending us the image as a b64 encoded string.
bestcaptchasolverapi.submit_captcha({
b64image: captcha,
}).then(function (id)) { };
Submit reCAPTCHA
The page_url
and site_key
are the only requirements. There are other optional parameters though.
bestcaptchasolverapi.submit_recaptcha({
page_url: 'PAGE_URL_HERE',
site_key: 'SITE_KEY_HERE',
}).then(function (id)) { };
Just like the image submission method, this method also returns an ID, which is then used
to get the text or gresponse.
Submit Geetest
- domain
- gt
- challenge
- api_server (optional)
- user_agent (optional)
- proxy (optional)
bestcaptchasolverapi.submit_geetest({
domain: 'DOMAIN_HERE',
gt: 'GT_HERE',
challenge: 'CHALLENGE_HERE',
}).then(function (id)) { };
Submit GeetestV4
- domain
- captchaid
- user_agent (optional)
- proxy (optional)
Important: This is not the captchaid that's in our system that you receive while submitting a captcha. Gather this from HTML source of page with geetestv4 captcha, inside the <script>
tag you'll find a link that looks like this: https://i.imgur.com/XcZd47y.png
bestcaptchasolverapi.submit_geetest_v4({
domain: 'https://example.com',
captchaid: '647f5ed2ed8acb4be36784e01556bb71',
}).then(function (id)) { };
Submit Capy
- page_url
- site_key
- user_agent (optional)
- proxy (optional)
bestcaptchasolverapi.submit_capy({
page_url: 'PAGE_URL_HERE',
site_key: 'SITE_KEY_HERE',
}).then(function (id)) { };
Submit hCaptcha
- page_url
- site_key
- invisible (optional)
- payload (optional)
- domain (optional)
- user_agent (optional)
- proxy (optional)
- affiliate_id (optional)
bestcaptchasolverapi.submit_hcaptcha({
page_url: 'PAGE_URL_HERE',
site_key: 'SITE_KEY_HERE',
}).then(function (id)) { };
Submit FunCaptcha (Arkose Labs)
- page_url
- s_url
- site_key
- data (optional)
- user_agent (optional)
- proxy (optional)
bestcaptchasolverapi.submit_funcaptcha({
page_url: 'https://abc.com',
s_url: 'https://api.arkoselabs.com',
site_key: '11111111-1111-1111-1111-111111111111',
}).then(function (id)) { };
Submit Turnstile (Cloudflare)
- page_url
- site_key
- action (optional)
- cdata (optional)
- domain (optional)
- user_agent (optional)
- proxy (optional)
bestcaptchasolverapi.submit_turnstile({
page_url: 'PAGE_URL_HERE',
site_key: 'SITE_KEY_HERE',
}).then(function (id)) { };
Task
- template_name
- page_url
- variables
- user_agent (optional)
- proxy (optional)
- affiliate_id (optional)
bestcaptchasolverapi.submit_task({
template_name: 'Login test page',
page_url: 'https://bestcaptchasolver.com/automation/login',
variables: {"username": "xyz", "password": "0000"},
}).then(function (id)) { };
Task pushVariables
Update task variables while it is being solved by the worker. Useful when dealing with data / variables, of which
value you don't know, only after a certain step or action of the task. For example, in websites that require 2 factor
authentication code.
When the task (while running on workers machine) is getting to an action defined in the template, that requires a variable, but variable was not
set with the task submission, it will wait until the variable is updated through push.
The bestcaptchasolver.task_push_variables(captcha_id, push_variables)
method can be used as many times as it is needed.
bestcaptchasolverapi.task_push_variables(captcha_id, {"tfa_code": "49651"})
Retrieve
Retrieval is done by passing the ID, for all captchas
bestcaptchasolverapi.retrieve_captcha(id).then(function (data) { console.log(JSON.stringify(data)); });
This method returns an object, with the text
attribute for image captcha or gresponse
if submission was done for reCAPTCHA
or solution
for geetest and capy
If reCAPTCHA is submitted with proxy, get proxy status
log('Recaptcha response: ' + data.gresponse);
log('Proxy status: ' + data.proxy_status);
Set captcha bad
bestcaptchasolverapi.set_captcha_bad(captcha_id);
Examples
Check the examples
folder
License
API library is licensed under the MIT License
More information
More info about the API parameters can be found here
captcha, bypasscaptcha, decaptcher, decaptcha, 2captcha, deathbycaptcha, anticaptcha,
bypassrecaptchav2, bypassnocaptcharecaptcha, bypassinvisiblerecaptcha, captchaservicesforrecaptchav2,
recaptchav2captchasolver, googlerecaptchasolver, recaptchasolverpython, recaptchabypassscript