npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

capsolver-npm

v1.0.9

Published

- **Manage to solve captcha challenges with AI in a NodeJS app (captcha service based).** - โ— An API key it's **required**. [**Get here.**](https://dashboard.capsolver.com/passport/register?inviteCode=CHhA_5os) - ๐Ÿ‘€ **Puppeteer integration at** [**pupp

Downloads

3,005

Readme

capsolver.com api wrapper๐Ÿง 

๐Ÿ”ฅ HCaptchaTurboTask (highest pass/valid rate). ๐Ÿ”ฅ AntiCloudflare.

โฌ‡๏ธ Install

npm i capsolver-npm

โœ‹ Usage

  1. Import module.

     const CapSolver = require('capsolver-npm')
  2. Define tasks handler (singleton).

     const handler = new CapSolver(apikey) // captcha task handler

โ— 2 version for handle captcha tasks results are the followind:

1๏ธโƒฃ task-binded methods (handle results in one step)

example: check capsolver.com balance + run for one hcaptcha token (.hcaptchaproxyless()):

const CapSolver = require('capsolver-npm')
const handler = new CapSolver('CAI-XXXX ...', 1) // verbose level 1
let b = await handler.balance()
if (b > 0) {  // usd balance
    await handler.hcaptchaproxyless('https://websiteurl.com/', '000000-000000000-0000000')
        .then(async response => {
            if (response.error === 0) {
                console.log(response.solution)
            } else {
                console.log(`[myapp][task error: ${response.apiResponse.errorCode}]`)
            }
        })
}

2๏ธโƒฃ build taskData schema for a task type and run any task.

Check task parameters at official docs in order to bind manually captcha tasks.

example: run for one hcaptcha token w/ custom proxy (.runAnyTask()):

const CapSolver = require('capsolver-npm')
const handler = new CapSolver('CAI-XXXX ...')

await handler.runAnyTask({
    type: 'HCaptchaTask',
    websiteURL: 'https://website.com/',
    websiteKey: '000000-00000-000000-000000000',
    proxyInfo: {
        // string format also supported
        // 'proxy': 'proxy.provider.io:23331:user1:password1',
        'proxyType': 'http',
        'proxyAddress': 'ip_address',
        'proxyPort': 3221,
        'proxyLogin': 'username',       // not required
        'proxyPassword': 'password'     // not required
    },
})
    .then(async response => {
        if (response.error === 0) {
            console.log(response.solution)
        } else {
            console.log(`[myapp][task error: ${response.apiResponse.errorCode}]`)
        }
    })

โ†ฉ๏ธ Get solutions

All methods returns the following schema:

| Parameter | Type | Description | |:--------------|:---------|:-----------------------------------------------------------| | error | number | [-1] Request/Solving error. [0] Success solve. | | statusText | string | HTTP status string. | | apiResponse | object | Results/solution (capsolver.com API response). | | solution | object | Solution got from success solve. |

// โœ… success response
{
    error: 0,
    statusText: '200 OK',
    apiResponse: {
        errorId: 0,
        taskId: '4e6c33f5-bc14-44d0-979e-d5f37b072c59',
        status: 'ready',
        solution: {
            gRecaptchaResponse: '03AIIukzgCys9brSNnrVbwXE9mTesvkxQ-ocK ...'
        }
    }
}
// โŒ Error response (invalid API key example)
{
    error: -1,
    statusText: '400 Bad Request',
    apiResponse: {
        errorId: 1
        errorCode: 'ERROR_INVALID_TASK_DATA',
        errorDescription: 'clientKey error',
    }
}

๐Ÿ“– Supported captcha tasks

| Method | Returns | |:-------------------------------------|:-------------------------------| | await handler.balance() | get balance as float number | | await handler.runAnyTask(taskData) | not use a specific task method |

For custom proxy usage in tasks build this schema:

// version 1
// (proxyLogin & proxyPassword are optionals)
const proxyInfo = {
    'proxyType': 'http',
    'proxyAddress': 'ip_address',
    'proxyPort': 3221,
    'proxyLogin': 'username',
    'proxyPassword': 'password'
}

// version 2
const proxyInfo = {
    proxy: 'proxyType:proxyAddress:proxyPort:proxyLogin:proxyPassword'
}

task-binded methods:

โš™๏ธ Cloudflare

// * check required parameters for a website with API docs.
await handler.anticloudflare(websiteURL, proxyInfo, metadata, html)
await handler.antiturnstile(websiteURL, websiteKey, proxyInfo, metadata)

โš™๏ธ HCaptcha

Parameter queries: base64 images array

await handler.hcaptcha(websiteURL, websiteKey, proxyInfo, userAgent, isInvisible, enterprisePayload)
await handler.hcaptchaproxyless(websiteURL, websiteKey, userAgent, isInvisible, enterprisePayload)
await handler.hcaptchaenterprise(websiteURL, websiteKey, proxyInfo, userAgent, isInvisible, enterprisePayload)
await handler.hcaptchaenterpriseproxyless(websiteURL, websiteKey, userAgent, isInvisible, enterprisePayload)
await handler.hcaptchaturbo(websiteURL, websiteKey, proxyInfo, userAgent, isInvisible, enterprisePayload) // proxy required

await handler.hcaptchaclassification(question, base64)

โš™๏ธ ReCaptcha

await handler.recaptchav2(websiteURL, websiteKey, proxyInfo, userAgent, isInvisible, recaptchaDataSValue, cookies)
await handler.recaptchav2proxyless(websiteURL, websiteKey, userAgent = null, isInvisible = null, recaptchaDataSValue = null, cookies = null)
await handler.recaptchav2enterprise(websiteURL, websiteKey, proxyInfo, userAgent = null, enterprisePayload = null, apiDomain = null, cookies = null)
await handler.recaptchav2enterpriseproxyless(websiteURL, websiteKey, userAgent = null, enterprisePayload = null, apiDomain = null, cookies = null)
await handler.recaptchav3(websiteURL, websiteKey, proxyInfo, pageAction, minScore = null)
await handler.recaptchav3proxyless(websiteURL, websiteKey, pageAction, minScore = null)
await handler.recaptchav3enterprise(websiteURL, websiteKey, proxyInfo, pageAction, minScore = null, enterprisePayload = null, apiDomain = null, userAgent = null, cookies = null)
await handler.recaptchav3enterpriseproxyless(websiteURL, websiteKey, pageAction, minScore = null, enterprisePayload = null, apiDomain = null, userAgent = null, cookies = null)

โš™๏ธ Datadome

await handler.datadome(websiteURL, userAgent, captchaUrl, proxyInfo)

โš™๏ธ FunCaptcha

Parameter image: base64 screenshot image

await handler.funcaptcha(websiteURL, websitePublicKey, proxyInfo, funcaptchaApiJSSubdomain, userAgent, data)
await handler.funcaptchaproxyless(websiteURL, websitePublicKey, funcaptchaApiJSSubdomain, userAgent, data)
await handler.funcaptchaclassification(image, question)

โš™๏ธ Geetest

โ— Supports for Geetest V3 & Geetest V4: Manage through GeetestTask documentation.

await handler.geetest(websiteURL, gt, challenge, proxyInfo, geetestApiServerSubdomain, captchaId)
await handler.geetestproxyless(websiteURL, gt, challenge, geetestApiServerSubdomain, captchaId)

โš™๏ธ MTCaptcha

await handler.mtcaptcha(websiteURL, websiteKey, proxyInfo)
await handler.mtcaptchaproxyless(websiteURL, websiteKey)

โš™๏ธ ImageToText

await handler.image2text(body)

Verbose level

// on CapSolver handler definition
const handler = new CapSolver(apikey, verbose) 

Verbose level undefined or 0: Dont print logs, just handle for solution.

Verbose level 1: Only log task status in console.

Verbose level 2: Log API response in console.

๐Ÿ“ Working examples

Figure out here all supported captcha examples.