Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capsolver-npm

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capsolver-npm

Manage to solve captcha challenges with AI in a NodeJS app (captcha service based).

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
increased by217.27%
Maintainers
0
Weekly downloads
 
Created
Source

capsolver.com api wrapper🧠

  • Manage to solve captcha challenges with AI in a NodeJS app (captcha service based).
  • ❗ An API key it's required. Get here.
  • 👀 Puppeteer-extra integration at puppeteer-extra-plugin-capsolver.

🔥 Promise based 🔥 Catch TaskException with error code and description

⬇️ Install

npm i capsolver-npm

✋ Usage

❗ You need to debug each website and the captcha use case, in order to adjust the correct implementation parameters.

  • Initialize Solver :
const { Solver } = require("capsolver-npm");
const solver = new Solver("CAP-XXXXXX ...");  // one solver by apikey
  • Handle any api.capsolver.com supported task.

📚 Docs

Request a custom tasks (in case this lib doesn't support it yet):

  • It's possible to specify the task type within the JSON object and add the rest of parameters using .runCustomTaskType({}).
  • mustPoll indicates if this task requires to poll the solution after create the task.
  • When using proxy-required tasks, add your proxy connection matching the following:
    • { proxy: "ip:port:user:pass", ... parameters }
const { Solver } = require("capsolver-npm");

const solver = new Solver("CAP-XXXXXX ...");
await solver.runCustomTaskType({ 
    task: {
        type: "AkamaiTask", // suppose this task exists at docs.capsolver.com
        proxy: "ip:port:user:pass" // custom proxy usage
        ... parameters
    }
    mustPoll: true
    })
    .then(solution => { console.log(solution) })
    .catch(e => { console.error(e) });
  • Check the balance with .balance().
if(await solver.balance() < 5.00){
    console.log("Your CapSolver balance is under 5 USD")
}

📁 Working examples

Figure out here.

🔨 Native methods

  • Parameters that have a null by default are optional sometimes, it depends on implementation.
  • Read the "Solving ..." docs.

Solving recaptchav2

await solver.recaptchav2({ websiteURL, websiteKey, proxy, pageAction: null, enterprisePayload: null, isInvisible: false, apiDomain: null, userAgent: null, cookie: null });
await solver.recaptchav2proxyless({ websiteURL, websiteKey, pageAction: null, enterprisePayload: null, isInvisible: false, apiDomain: null, userAgent: null, cookie: null });
await solver.recaptchav2enterprise({ websiteURL, websiteKey, proxy, pageAction: null, enterprisePayload: null, isInvisible: false, apiDomain: null, userAgent: null, cookie: null });
await solver.recaptchav2enterpriseproxyless({ websiteURL, websiteKey, pageAction: null, enterprisePayload: null, isInvisible: false, apiDomain: null, userAgent: null, cookie: null });

Solving recaptchav3

await solver.recaptchav3({ websiteURL, websiteKey, proxy, pageAction, enterprisePayload: null, apiDomain: null, userAgent: null, cookies: null });
await solver.recaptchav3proxyless({ websiteURL, websiteKey, pageAction, enterprisePayload: null, apiDomain: null, userAgent: null, cookies: null });
await solver.recaptchav3enterprise({ websiteURL, websiteKey, proxy, pageAction, enterprisePayload: null, apiDomain: null, userAgent: null, cookies: null });
await solver.recaptchav3enterpriseproxyless({ websiteURL, websiteKey, pageAction, enterprisePayload: null, apiDomain: null, userAgent: null, cookies: null });

Solving hcaptcha

await solver.hcaptcha({ websiteURL, websiteKey, proxy, isInvisible: null, enterprisePayload: null, userAgent: null })
await solver.hcaptchaproxyless({ websiteURL, websiteKey, isInvisible: null, enterprisePayload: null, userAgent: null })

// under manteniance at 27-07-2024
await solver.hcaptchaclassification({ websiteURL: null, websiteKey: null, queries, question })

Solving funcaptcha

await solver.funcaptcha({ websiteURL, websitePublicKey, data: null, userAgent: null, proxy });
await solver.funcaptchaproxyless({ websiteURL, websitePublicKey, data: null, userAgent: null })
await solver.funcaptchaclassification({ websiteURL: null, websiteKey: null, images, module: null, question });

Solving geetest V3 & V4

await solver.geetest({ websiteURL, gt: null, challenge: null, proxy, geetestApiServerSubdomain: null, captchaId: null });
await solver.geetest_proxyless({ websiteURL, gt: null, challenge: null, captchaId: null, geetestApiServerSubdomain: null });

Solving datadome

await solver.datadome({ websiteURL, userAgent, captchaUrl, proxy });

Solving turnstile

// under manteniance at 27-07-2024
await solver.antiturnstile({ websiteURL, websiteKey, metadata: null });

Solving mtcaptcha

await.solver.mtcatpcha({ websiteURL, websiteKey, proxy });

Solving image2text captcha

await solver.image2text({ websiteURL: null, body, module: null, score: null, caseSensitive: null });
  • ❌ Unsupported:
    • AwsWaf (token)
    • AwsWafClassification
    • ReCaptchaClassification
    • VisionEngine

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc