Node.js wrapper for SolveCaptcha.com API. Bypass recaptcha, hcaptcha, cloudflare capthca and more.
npm install solvecaptcha-javascriptsh
npm install solvecaptcha-javascript
`
or Yarn:
`sh
yarn add solvecaptcha-javascript
`
To install directly from GitHub:
`sh
npm install github:solvercaptcha/solvecaptcha-javascript
`
Configuration
You can create a SolveCaptcha instance as follows:
`js
const SolveCaptcha = require("solvecaptcha-javascript")
const solver = new SolveCaptcha.Solver("")
`
Additionally, several configuration options are available:
`javascript
const apiKey = 'YOUR_API_KEY'
const pollingInterval = 10
const solver = new SolveCaptcha.Solver(apiKey, pollingInterval)
`
$3
| Option | Default value | Description |
| ---------------- | -------------- | -------------------------------------------------------------------------------------------- |
| apiKey | - | Your personal API key |
| pollingInterval | 5000 | The delay in milliseconds between each request to the res.php API endpoint. It's not recommended to set this value below 5000 milliseconds (5 seconds). |
Solve captcha
When submitting an image-based captcha, you can include extra parameters to assist Solvecaptcha workers in solving it accurately.
$3
| Option | Default Value | Description |
| --------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
| numeric | 0 | Indicates whether the captcha includes only numbers, letters, or a mix [see more info in the API docs][post options] |
| min_len | 0 | Minimum number of characters expected in the answer |
| max_len | 0 | Maximum number of characters allowed in the answer |
| phrase | 0 | Specifies whether the answer should consist of multiple words |
| regsense | 0 | Indicates if case sensitivity should be considered in the answer |
| calc | 0 | Specifies whether the captcha involves a mathematical expression to solve |
| lang | - | Sets the language of the captcha; refer to the [list of supported languages] |
| textinstructions| - | A hint or instruction shown to the workers along with the captcha image |
Below are simple examples for each captcha type β take a look at the code samples provided.
$3
Description of the API method.
To solve a standard captcha (distorted text within an image), use the method below. It can also be applied for general text recognition in images.
`js
const imageBase64 = fs.readFileSync("./examples/media/imageCaptcha_6e584.png", "base64")
solver.imageCaptcha({
body: imageBase64,
numeric: 4,
min_len: 5,
max_len: 5
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve reCAPTCHA V2 and retrieve a token that allows you to bypass the verification.
`js
solver.recaptcha({
pageurl: 'https://solvecaptcha.com/demo/recaptcha-v2',
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
This method is used to solve reCAPTCHA V3 and returns a token for verification.
`js
solver.recaptcha({
pageurl: 'https://solvecaptcha.com/demo/recaptcha-v3',
googlekey: '6Lcyqq8oAAAAAJE7eVJ3aZp_hnJcI6LgGdYD8lge',
version: "v3",
min_score: "0.4",
action: 'demo_action'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve hCaptcha and retrieve a token that allows you to bypass the verification.
`js
solver.hcaptcha({
pageurl: 'https://portalunico.siscomex.gov.br',
sitekey: 'bf8ccfbf-6a05-45f6-982a-7a7964c2f50c',
invisible: 0,
domain: 'hcaptcha.com',
// proxy: {
// type: 'HTTPS',
// uri: 'login:password@IP_address:PORT'
// }
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
})
`
$3
Description of the API method.
Method for solving FunCaptcha (Arkoselabs). Returns a verification token.
`js
solver.funCaptcha({
pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en",
publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Method for solving GeeTest puzzle captcha. Returns a JSON object containing the required tokens.
`js
// Read more about challenge on the page https://solvecaptcha.com/p/geetest
solver.geetest({
pageurl: 'https://solvecaptcha.com/demo/geetest',
gt: '81388ea1fc187e0c335c0a8907ff2625',
challenge: ''
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve GeeTest v4 captcha. The response is returned in JSON format.
`js
solver.geetestV4({
pageurl: 'https://solvecaptcha.com/demo/geetest-v4',
captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Use this method to solve Yandex Smart Captcha and receive a token that allows you to bypass the verification.
`js
solver.yandexSmart({
pageurl: "https://captcha-api.yandex.ru/demo",
sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Lemin captcha and obtain a token to bypass the verification process..
`js
solver.lemin({
pageurl:'https://solvecaptcha.com/demo/lemin',
captcha_id: 'CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b',
div_id: 'lemin-cropped-captcha',
api_server: 'api.leminnow.com'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Cloudflare Turnstile captcha. Returns a JSON response containing the token.
Turnstile captcha comes in two variants, one of which is the Cloudflare Turnstile Challenge page. For handling this type, we offer a demo. Check out this demo if you need to solve captchas on the Cloudflare Turnstile Challenge page.
`js
solver.cloudflareTurnstile({
pageurl: "https://app.nodecraft.com/login",
sitekey: "0x4AAAAAAAAkg0s3VIOD10y4"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Amazon WAF Captcha, also known as AWS WAF Captcha, which is part of Amazon AWS's intelligent threat mitigation system. Returns a JSON response containing the token.
`js
//INFO: The context parameter is dynamic and must be retrieved from the page in real time for each request.
solver.amazonWaf({
pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest",
sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRt...",
context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ...",
iv: "CgAHbCe2GgAAAAAj",
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Token-based method for bypassing Capy puzzle captcha verification.
`js
solver.capyPuzzle({
pageurl: "https://www.capy.me/account/register/",
captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve DataDome captcha and get a token to bypass the protection.
> [!IMPORTANT]
> A proxy is required to solve the DataDome captcha. It is recommended to use residential proxies.
`js
solver.dataDome({
pageurl: "https://rendezvousparis.hermes.com/client/register",
captcha_url: "https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAEuQtkf4k1c0ABZhYZA%3D%3D&hash=789361B674144528D0B7EE76B35826&cid=mY4z7GNmh7Nt1lAFwpbNHAOcWPhyPgjHD2K1Pm~Od1iEKYLUnK3t7N2ZGUj8OqDK65cnwJHtHwd~t902vlwpSBA5l4ZHbS1Qszv~jEuEUJNQ_jMAjar2Kj3kq20MRJYh&t=fe&referer=https%3A%2F%2Frendezvousparis.hermes.com%2Fclient%2Fregister&s=40119&e=67fef144ac1a54dbd7507776367d2f9d5e36ec3add17fa22f3cb881db8385838",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy
proxytype: "http" // The 'Type' of proxy, http, https, socks, ect.
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve CyberSiARA captcha and receive a token to bypass the verification.
`js
solver.cyberSiARA({
pageurl: "https://www.cybersiara.com/book-a-demo",
master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve MTCaptcha and get a token that allows you to bypass the verification.
`js
solver.mtCaptcha({
pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
sitekey: "MTPublic-DemoKey9M"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Friendly Captcha and retrieve a token to bypass the verification process.
> [!IMPORTANT]
> For the token to work correctly, the captcha widget must not be loaded on the page. You need to block the request to /friendlycaptcha/...module.min.js. If the widget has already been loaded, there is a high chance the obtained token will be invalid.
`js
solver.friendlyCaptcha({
pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356",
sitekey: "FCMST5VUMCBOCGQ9"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
The ClickCaptcha method returns coordinates of specific points on the captcha image. It's useful when the task requires clicking on certain areas within the image.
`js
const imageBase64 = fs.readFileSync("./tests/media/coordinates.jpg", "base64")
solver.coordinates({
body: imageBase64,
textinstructions: 'Select all photos containing the boat'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use the Bounding Box Method when you need to highlight specific objects in an image. To do this, provide both the image and the corresponding instructions for markup. Instructions can be submitted either as plain text or as a base64-encoded image.
> [!IMPORTANT]
> You must include either the imginstructions or textinstructions parameter.
`js
solver.boundingBox({
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...",
textinstructions: "Circle all the cars in the image.",
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
This method is suitable for solving captchas where the image can be split into equal-sized segments, such as reCAPTCHA V2. A grid is overlaid on the image, and the response contains the numbers of the selected boxes.
> [!IMPORTANT]
> You must include either the imginstructions or textinstructions parameter.
`js
solver.grid({
body: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...",
textinstructions: "Select cars in the image"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
This method is used to bypass captchas that present a question in plain text and require a text-based answer.
`js
solver.textCaptcha({
textcaptcha: "If tomorrow is Saturday, what day is today?",
lang: 'en'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
The canvas method is used when you need to outline an object on an image by drawing a line around it. It returns a set of coordinates for points that form a polygon.
`js
solver.canvas({
body: 'iVBORw0KGgoAAAANSgAAAcIA...',
imginstructions: '/9j/4AAQSkZJRgABAQEA...',
textinstructions: 'Highlight the red CIRCLE'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
This method is intended for solving captchas that require rotating an object, commonly used in FunCaptcha. It returns the angle of rotation needed.
`js
solver.rotate({
body: imageBase64,
textinstructions: "Rotate the object to the correct position"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Token-based method for solving KeyCaptcha challenges.
`js
solver.keyCaptcha({
pageurl: "https://solvecaptcha.com/demo/keycaptcha",
userId: '184015',
sessionId: '0917788cad24ad3a69813c4fcd556061',
webServerSign: '02f7f9669f1269595c4c69bcd4a3c52e',
webServerSign2: 'd888700f6f324ec0f32b44c32c50bde1'
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Cutcaptcha. The response is returned in JSON format.
`js
solver.cutCaptcha({
pageurl: "https://mysite.com/page/with/cutcaptcha",
misery_key: "098e6a849af406142e3150dbf4e6d0538db2b51f",
api_key: "SAs61IAI",
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve Tencent captcha. The response is provided in JSON format.
`js
solver.tencent({
pageurl: "https://mysite.com/page/with/tencent",
appId: "189956587"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use this method to solve the atbCAPTCHA challenge. It returns a token that allows you to bypass the captcha verification.
`js
solver.atbCaptcha({
pageurl: "https://mysite.com/page/with/atbCAPTCHA",
appId: "af25e409b33d722a95e56a230ff8771c",
apiServer: "https://cap.aisecurius.com"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
$3
Description of the API method.
Use the method below to bypass an audio captcha (only mp3 format is supported). You must specify the language using lang = 'en'. Supported languages include: "en", "ru", "de", "el", "pt", and "fr".
`js
solver.audio({
body: "SUQzBAAAAAAAHFRTU0UAAAA...",
lang: "en"
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
`
Other methods
$3
Description of the API method.
Use this method to report a correct captcha solution.
`js
solver.goodReport('7031846604')
`
$3
Description of the API method.
Use this method to report an incorrect captcha solution.
`js
solver.badReport('7031854546')
`
$3
Description of the API method.
Use this method to check the balance of your account.
`js
solver.balance()
.then((res) => {
console.log(res)
})
`
Proxies
You can include your proxy as an additional parameter when using methods like: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf, DataDome, CyberSiARA, MTCaptcha, Friendly Captcha, and others. The proxy will be passed to the API to assist in solving the captcha.
Example: Solving reCAPTCHA V2 with a proxy:
`js
solver.recaptcha({
pageurl: 'https://solvecaptcha.com/demo/recaptcha-v2',
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u',
proxy: 'HTTPS',
proxytype: 'login:password@123.123.123.123:3128'
})
``