# 2captcha-api

> A wrapper for the 2Captcha API

Latest version **1.0.0** (published 2017-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install 2captcha-api
pnpm add 2captcha-api
yarn add 2captcha-api
bun add 2captcha-api
```

## 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.0.0 |
| Published | 2017-08-07 |
| First published | 2017-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Artyom Bochkarev |
| Maintainers | artyom.bochkarev |
| Keywords | captcha |

## Links

- npm: https://www.npmjs.com/package/2captcha-api
- Repository: https://github.com/bochkarev-artem/2captcha
- Homepage: https://github.com/bochkarev-artem/2captcha#readme
- Issues: https://github.com/bochkarev-artem/2captcha/issues
- npm.io page: https://npm.io/package/2captcha-api

## Recent versions

- 1.0.0 (latest) — 2017-08-07

## README

# 2Captcha API wrapper for Node.js

Post a captcha to the [2Captcha](https://2captcha.com/) service, then polls until the captcha is decoded.

## Installation

    npm install 2captcha


## Usage


Set up your api key:

    var solver = require('2captcha');

    solver.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');


Decode from a url, with a 10 seconds polling interval: (default = 2000ms)

    solver.decodeUrl(url, {pollingInterval: 10000}, function(err, result, invalid) {
        console.log(result.text);
    });

Decode reCaptcha, with a 10 seconds polling interval: (default = 2000ms)

    solver.decodeReCaptcha(captcha, pageUrl, {pollingInterval: 10000}, function(err, result, invalid) {
        console.log(result.text);
    });

Decode from a url retrying 5 times if invalid is called (default = 3)

    solver.decodeUrl(url, {retries: 5}, function(err, result, invalid) {
        if(!checkIfCaptchaIsValid(result.text)){
        	return invalid();
        }
    });

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