Via npm:
npm i -S captcha-service
Update via npm:
npm update captcha-service
const CaptchaService = require('captcha-service');

const solver = new CaptchaService({
  captcha_service: "twocaptcha",
  captcha_key: "captcha_key",
  imageCaptchaPath: "./img.png",
  renameImage: false

solver.Stream.on('log', data => console.log('log:', data));

solver.solveCaptcha().then(text => {

  console.log("Result:", text);

  // log: Solving captcha trytime=1
  // log: Solve captcha with captcha_index: 0
  // log: TwoCaptcha: {"_id":"67389604474","_apiResponse":"OK|vbwzye","_text":"vbwzye"}
  // log: Captcha result: vbwzye | img.png
  // Result: vbwzye

}).catch(err => console.log(err));

  • options <Object>
    • captcha_service <string> Has support: (require)
      • 2captcha
    • captcha_key <string|Array<string>> API KEY of captcha service. Example: ["KEY1", "KEY2"] or just a single key "KEY1" or ["KEY1"]
    • imageCaptchaPath <string|path> Captcha image file address
    • renameImage <boolean> Default: false Whether to rename captcha image file affter solved with the filename as the result of the captcha.
  • return
To solve captcha
  • return: <string> Text from image captcha
In addition to software engineering, web development can include database scripting with this site. There are thousands of opportunities in web development for those who know the basics of programming. You don't have to be a professional in this field to find a job. If you're looking to become a developer, you should be comfortable with multiple technologies. In addition to the traditional programming languages, web developers can also use various tools and techniques to build their apps.
Last edited: