# captcha-service

> Lib support to solve 2D captcha with 2captcha, anticaptcha, deathcaptcha, azcaptcha and ...

Latest version **1.1.0** (published 2023-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install captcha-service
pnpm add captcha-service
yarn add captcha-service
bun add captcha-service
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-06-07 |
| First published | 2021-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 57.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Nguyen Van Tai |
| Maintainers | vantai.nguyen |
| Keywords | 2captcha, anticaptcha, deathcaptcha, azcaptcha, captcha, service, captcha, solver, captcha service, captcha solver, 2captcha solver, anticaptcha solver, deathcaptcha solver, deathcaptcha solver, azcaptcha solver, bypasscaptcha, captchaservice, captcha solver in one, captcha-service, captcha-solver |

## Links

- npm: https://www.npmjs.com/package/captcha-service
- Repository: https://github.com/mrluaf/captcha-service
- Homepage: https://github.com/mrluaf/captcha-service#readme
- Issues: https://github.com/mrluaf/captcha-service/issues
- npm.io page: https://npm.io/package/captcha-service

## Dependencies (6)

- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [request](https://npm.io/package/request.md) ^2.88.2
- [bluebird](https://npm.io/package/bluebird.md) ^3.7.2
- [image-to-base64](https://npm.io/package/image-to-base64.md) ^2.2.0
- [@infosimples/node_two_captcha](https://npm.io/package/@infosimples/node_two_captcha.md) ^1.1.0

## Recent versions

- 1.1.0 (latest) — 2023-06-07
- 1.0.10 — 2023-04-23
- 1.0.9 — 2021-12-03
- 1.0.8 — 2021-11-26
- 1.0.7 — 2021-11-16
- 1.0.6 — 2021-11-15
- 1.0.5 — 2021-07-06
- 1.0.4 — 2021-07-01
- 1.0.3 — 2021-07-01
- 1.0.2 — 2021-07-01
- 1.0.1 — 2021-07-01
- 1.0.0 — 2021-07-01

## README

# Captcha Service

## Supported captcha services
- [2Captcha](https://2captcha.com?from=9511131)
- [AntiCaptcha](http://getcaptchasolution.com/7hyxwizehv)
- [deathbycaptcha](https://www.deathbycaptcha.com)
- [AZcaptcha](https://azcaptcha.com)

## Installation

Via npm:
```sh
npm i -S captcha-service
```

Update via npm:
```sh
npm update captcha-service
```

## Usage

```js
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));
```

## API
### CaptchaService([options])
- `options` <[Object]>
  - `captcha_service` <[string]> Has support: **(require)**
    - azcaptcha
    - twocaptcha
    - anticaptcha
    - deathbycaptcha
  - `captchaType` <[string]> Has support: `Default: "image"` 
    - image
    - recaptchav2
  - `websiteURL` <[string]> For Recaptcha: Website URL
  - `websiteKey` <[string]> For Recaptcha: recaptcha website key
  - `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 <Object>

### .solveCaptcha()
To solve captcha
- return: <[string]> Text from image captcha

### .solveRecapchaV2()
To solve captcha
- return: <[string]> gRecaptchaResponse

## Author

👤 **[Văn Tài](https://nguyenvantai.vn)**

- Twitter: [@mrluaf](https://twitter.com/mrluaf)
- Facebook: [@LuaAcoustic](https://www.facebook.com/LuaAcoustic)
- Github: [@mrluaf](https://github.com/mrluaf)
- Gitlab: [@mrluaf](https://gitlab.com/mrluaf)

---

Made with ❤️ by [Văn Tài](https://nguyenvantai.vn)

[axnode]: #accessibilitysnapshotoptions 'AXNode'
[accessibility]: #class-accessibility 'Accessibility'
[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array 'Array'
[body]: #class-body 'Body'
[browsercontext]: #class-browsercontext 'BrowserContext'
[browserfetcher]: #class-browserfetcher 'BrowserFetcher'
[browser]: #class-browser 'Browser'
[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer 'Buffer'
[cdpsession]: #class-cdpsession 'CDPSession'
[childprocess]: https://nodejs.org/api/child_process.html 'ChildProcess'
[connectiontransport]: ../src/WebSocketTransport.js 'ConnectionTransport'
[consolemessage]: #class-consolemessage 'ConsoleMessage'
[coverage]: #class-coverage 'Coverage'
[dialog]: #class-dialog 'Dialog'
[elementhandle]: #class-elementhandle 'ElementHandle'
[element]: https://developer.mozilla.org/en-US/docs/Web/API/element 'Element'
[error]: https://nodejs.org/api/errors.html#errors_class_error 'Error'
[executioncontext]: #class-executioncontext 'ExecutionContext'
[filechooser]: #class-filechooser 'FileChooser'
[frame]: #class-frame 'Frame'
[jshandle]: #class-jshandle 'JSHandle'
[keyboard]: #class-keyboard 'Keyboard'
[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map 'Map'
[mouse]: #class-mouse 'Mouse'
[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object 'Object'
[page]: #class-page 'Page'
[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise 'Promise'
[httprequest]: #class-httprequest 'HTTPRequest'
[httpresponse]: #class-httpresponse 'HTTPResponse'
[securitydetails]: #class-securitydetails 'SecurityDetails'
[serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description 'Serializable'
[target]: #class-target 'Target'
[timeouterror]: #class-timeouterror 'TimeoutError'
[touchscreen]: #class-touchscreen 'Touchscreen'
[tracing]: #class-tracing 'Tracing'
[uievent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail 'UIEvent.detail'
[uskeyboardlayout]: ../src/common/USKeyboardLayout.ts 'USKeyboardLayout'
[unixtime]: https://en.wikipedia.org/wiki/Unix_time 'Unix Time'
[webworker]: #class-webworker 'Worker'
[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type 'Boolean'
[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function 'Function'
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols 'Iterator'
[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type 'Number'
[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin 'Origin'
[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors 'selector'
[stream.readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable 'stream.Readable'
[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type 'String'
[symbol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Symbol_type 'Symbol'
[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath 'xpath'
[customqueryhandler]: #interface-customqueryhandler 'CustomQueryHandler'

---
_Source: https://npm.io/package/captcha-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
