Blog
How to solve FunCaptcha with Node.JS

How to solve FunCaptcha with Node.JS

Logo of Capsolver

CapSolver Blogger

How to use capsolver

26-Sep-2023

Bypassing FunCaptcha, FunCaptcha with Node.JS, FunCaptcha Node.JS solver

##⚙️ Prerequisites

  • Proxy (Optional)
  • Node.JS installed
  • Capsolver API key

🤖 Step 1: Install Necessary Packages

Execute the following commands to install the required packages:

npm install axios

👨‍💻 Node.JS Code for solve FunCaptcha without proxy

Here's a Node.JS sample script to accomplish the task:

const axios = require('axios');

const PAGE_URL = "Page URL with FunCaptcha"; // Replace with your Website
const CLIENT_KEY = "Your Capsolver Key";  // Replace with your CAPSOLVER API Key
const SITE_KEY = "Public Site Key" // Replace with the site key that the captcha have

async function createTask(payload) {
  try {
    const res = await axios.post('https://api.capsolver.com/createTask', {
      clientKey: CLIENT_KEY,
      task: payload
    });
    return res.data;
  } catch (error) {
    console.error(error);
  }
}
async function getTaskResult(taskId) {
    try {
        success = false;
        while(success == false){

            await sleep(1000);
        console.log("Getting task result for task ID: " + taskId);
      const res = await axios.post('https://api.capsolver.com/getTaskResult', {
        clientKey: CLIENT_KEY,
        taskId: taskId
      });
      if( res.data.status == "ready") {
        success = true;
        console.log(res.data)
        return res.data;
      }
    }
  
    } catch (error) {
      console.error(error);
      return null;
    }
  }
  

async function solveFuncaptcha(pageURL, siteKey, data = "") {
  const taskPayload = {
    type: "FunCaptchaTaskProxyless",
    websiteURL: pageURL,
    websitePublicKey: siteKey,
    data: data,
  };
  const taskData = await createTask(taskPayload);
  return await getTaskResult(taskData.taskId);
}
function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}
async function main() {
  try {
   
      const response = await solveFuncaptcha(PAGE_URL, SITE_KEY );
      console.log(`Received FunCaptcha Token: ${response.solution.token}`);
        
    }
catch (error) {
    console.error(`Error: ${error}`);
  }

}
main();

👨‍💻Node.JS Code for solve FunCaptcha with proxy

Here's a Node.JS sample script to accomplish the task:

const axios = require('axios');

const PAGE_URL = "Page URL with FunCaptcha"; // Replace with your Website
const CLIENT_KEY = "Your Capsolver Key";  // Replace with your CAPSOLVER API Key
const SITE_KEY = "Public Site Key" // Replace with the site key that the captcha have
const PROXY = "http://username:password@host:port" // Replace with the site key that the captcha have


async function createTask(payload) {
  try {
    const res = await axios.post('https://api.capsolver.com/createTask', {
      clientKey: CLIENT_KEY,
      task: payload
    });
    return res.data;
  } catch (error) {
    console.error(error);
  }
}
async function getTaskResult(taskId) {
    try {
        success = false;
        while(success == false){

            await sleep(1000);
        console.log("Getting task result for task ID: " + taskId);
      const res = await axios.post('https://api.capsolver.com/getTaskResult', {
        clientKey: CLIENT_KEY,
        taskId: taskId
      });
      if( res.data.status == "ready") {
        success = true;
        console.log(res.data)
        return res.data;
      }
    }
  
    } catch (error) {
      console.error(error);
      return null;
    }
  }
  

async function solveFuncaptcha(pageURL, siteKey, data = "") {
  const taskPayload = {
    type: "FunCaptchaTask",
    websiteURL: pageURL,
    websitePublicKey: siteKey,
    data: data,
    proxy: PROXY
  };
  const taskData = await createTask(taskPayload);
  return await getTaskResult(taskData.taskId);
}
function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}
async function main() {
  try {
   
      const response = await solveFuncaptcha(PAGE_URL, SITE_KEY );
      console.log(`Received FunCaptcha Token: ${response.solution.token}`);
        
    }
catch (error) {
    console.error(`Error: ${error}`);
  }

}
main();

⚠️ Change these variables

  • PROXY: Change to your proxy, only if you use FuncaptchaTask.
  • CLIENT_KEY: Obtain your API key from the Capsolver Dashboard.
  • PAGE_URL: Replace with the URL of the website for which you wish to solve FunCaptcha
  • SITE_KEY: Replace with the site key of the website for which you wish to solve FunCaptcha

👀 More information

More

FunCaptcha,extension
Solution for extension's inability to recognize certain FunCaptcha images

Due to browser environment issues, the extension may encounter difficult challenges in recognizing certain images in FunCaptcha. Please follow the steps below to address this: 1. Attempt to manually solve all image challenges yourself. 2. If you still encounter new challenges or cannot proceed with the intended workflow, it indicates that your browser environment or IP has been baned. In such cases, try changing your browser environment or changeing your proxy and then attempt manual solving again. 3. If you can successfully proceed with the workflow after manually solving the challenges, it suggests that your environment is not the issue. Please report the images that the extension failed to recognize to us, and we will work on fixing it as soon as possible.

FunCaptcha

28-Nov-2023

How identify and obtain FunCaptcha data[blob]
How identify and obtain FunCaptcha data[blob]

Learn to identify and obtain FunCaptcha data[blob] for effective captcha solving. Follow our step-by-step guide on using Capsolver's tools and techniques.

FunCaptcha

20-Nov-2023

What is FunCaptcha and How to Solve with Human Score
What is FunCaptcha and How to Solve with Human Score

In this article we will teach you what funCaptcha is and how to easily solve the FunCaptcha with human score using CapSolver.

FunCaptcha

13-Nov-2023

How to solve FunCaptcha with Go
How to solve FunCaptcha with Go

In this article, we will show you how to solve FunCaptcha with Go.

FunCaptcha

28-Sep-2023

How to solve FunCaptcha with Node.JS
How to solve FunCaptcha with Node.JS

In this article, we will show you how to solve FunCaptcha with Node.JS.

FunCaptcha

26-Sep-2023

How to solve FunCaptcha with Python
How to solve FunCaptcha with Python

In this article, we will show you how to solve FunCaptcha with Python

FunCaptcha

21-Sep-2023