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

Solving 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

How to Solve Funcaptcha
How to Solve Funcaptcha by Using Python and GO

Due to the continuous development of online security measures, FunCaptcha has become an attractive and effective variant of CAPTCHA. However...

FunCaptcha

26-Apr-2024

Funcaptcha solving service
Best Arkose Labs FunCaptcha captcha solving service

Traditional captchas have been rendered ineffective by bots that can bypass them with ease. Arkose Labs' MatchKey challenges, however...

FunCaptcha

08-Mar-2024

Fastest-FunCaptcha-Solving
Fastest FunCaptcha Solving Service, Top CAPTCHA Solvers in 2024

As online security measures continue to evolve, FunCaptcha has emerged as an engaging and effective CAPTCHA variant. However...

FunCaptcha

02-Feb-2024

Captcha-Solving-Service
Captcha Solving Service, Solving reCAPTCHA/FunCaptcha/hCaptcha and Other Types of Captcha

In today's digital age, the internet is teeming with security measures to protect websites and distinguish humans from bots. One of the most commonly encountered security measures is the captcha, a challenge-response test designed to ensure that the user is a real person.

FunCaptcha

19-Jan-2024

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