Code Monkey home page Code Monkey logo

2captcha-node's Introduction

Welcome to 2captcha-node ๐Ÿ‘‹

NPM version Bundle size MIT

A NodeJS wrapper to solve image captchas with 2captcha

Prerequisites:

You will need a 2Captcha API key

Install

npm install 2captcha-node

or

yarn add 2captcha-node

Usage

Set up your api key:

import captchaSolver from '2captcha-node';

const captcha = captchaSolver('your-api-key');

It'll return an object with the solve function, and you'll be able to use it inside of your script

const options = {
  image: 'base64-image',
  maxAttempts: 60, // Optional
};

const { id, text } = await captcha.solve(options);

And this solvedCaptcha will return object, with captcha id and captcha text

You can use the balance function too, to see your balance at 2Captcha

const balance = await captcha.balance();

You can use the Report Captcha is valid or not.

await captcha.report(id, isValid);

Author

๐Ÿ‘ค Pedro Filho [email protected]

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

Buy Me A Coffee

2captcha-node's People

Contributors

marutichintan avatar pedroapfilho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2captcha-node's Issues

Add retry limit

Currently solve will attempt to request for a solution for as long as the response is {"status":0,"request":"CAPCHA_NOT_READY"}. I have observed cases where this has persisted for a very long time. It would be handy to have a way to configure a hard limit or to have cancel method.

TypeError: Cannot read property 'name' of undefined

Hi, as of today I'm having a little trouble using the library, every time I call the solve method I get the following error:

Error: TypeError: Cannot read property 'name' of undefined\n at /Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:78:27\n at step (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:33:23)\n at Object.next (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:14:53)\n at /Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:8:71\n at new Promise (<anonymous>)\n at __awaiter (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:4:12)\n at postCaptcha (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:47:49)\n at /Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:127:50\n at step (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:33:23)\n at Object.next (/Users/gabriel/repos/invoice-parser/node_modules/2captcha-node/dist/index.js:14:53)

Any ideia of what could be or how to fix it ? Thanks for the awesome work!

reCaptcha support

Do you plan to add support to reCaptcha ? I would be glad to help if needed.

Thanks for the libary.

Can you add set api key?

Hi,

I want to use it like following.

const recapcha = require("2captcha-node");

recapcha.setApiKey("my-api-key");

Can you make that function?

best regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.