# rucaptcha-client

> node.js client for https://rucaptcha.com and https://2captcha.com

Latest version **2.0.8** (published 2021-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install rucaptcha-client
pnpm add rucaptcha-client
yarn add rucaptcha-client
bun add rucaptcha-client
```

## 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 | 2.0.8 |
| Published | 2021-07-29 |
| First published | 2017-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | ivan-podgornov |
| Maintainers | ivan-podgornov |
| Keywords | 2captcha, rucaptcha, captcha, solve, капча, решить |

## Links

- npm: https://www.npmjs.com/package/rucaptcha-client
- Repository: https://github.com/ivan-podgornov/rucaptcha-client
- Homepage: https://github.com/ivan-podgornov/rucaptcha-client#readme
- Issues: https://github.com/ivan-podgornov/rucaptcha-client/issues
- npm.io page: https://npm.io/package/rucaptcha-client

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.8 (latest) — 2021-07-29
- 2.0.7 — 2021-07-29
- 2.0.6 — 2021-07-29
- 2.0.5 — 2021-07-29
- 2.0.4 — 2021-07-28
- 2.0.3 — 2021-05-26
- 2.0.2 — 2021-01-15
- 2.0.1 — 2019-09-22
- 2.0.0 — 2019-09-22
- 1.0.4 — 2017-07-06
- 1.0.3 — 2017-07-06
- 1.0.2 — 2017-07-06
- 1.0.1 — 2017-07-06
- 1.0.0 — 2017-07-06

## README

# Rucaptcha Client

Клиент для сайтов https://rucaptcha.com и https://2captcha.com. Удобен в
использовании, потому что полностью базируется на промисах.

## Установка

```bash
npm install rucaptcha-client
```

## Пример использования

```javascript
import Rucaptcha from 'rucaptcha-client';

async () => {
  const rucaptcha = new Rucaptcha('YOUR_APIKEY');

  // Если хотите использовать 2captcha в качестве endpoint
  // По умолчанию будет использоваться rucaptcha.com
  rucaptcha.baseUrl = 'https://2captcha.com';

  // Если ключ API был указан неверно, выбросит RucaptchaError с кодом
  // ERROR_KEY_DOES_NOT_EXIST. Полезно вызывать этот метод сразу после
  // инициализации, чтобы убедиться, что ключ API указан верно.
  const balance = await rucaptcha.getBalance();

  const imageUrl =
    'https://raw.githubusercontent.com/ivan-podgornov/rucaptcha-client/master/src/rucaptcha/images/captcha.jpg';
  const answer = await rucaptcha.solve(imageUrl);
  console.log(answer.text); // -> cyku если работники правильно разгадали капчу
};
```

## Свойства

- `balance: number` - результат последнего getBalance или null.
- `baseUrl: string = 'https://rucaptcha.com'` - базовый URL на который нужно
делать запрос. Если Вы хотите изменить его на https://2captcha.com, после
создания объекта рукапчи, измените свойство baseUrl. См. пример выше

## Методы

- `constructor(apikey: string)` - ключ можно найти здесь: https://rucaptcha.com/setting.
- `async getBalance: Promise<number>` - возвращает баланс текущего пользователя.
- `async solve(url: string): Promise<{ text: string }>` - решает капчу с
  изображением, которое можно скачать по указанному url.

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