Skip to content

alperensert/capmonster_java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capmonster.cloud for Java

GitHub repo size GitHub Maven Central Sonatype Nexus (Releases) GitHub last commit GitHub Release Date GitHub Repo stars

Capmonster.cloud package for Java

If you have any problem with usage, read the documentation or create an issue

At least 2x cheaper, up to 30x faster than manual recognition services.

Installation

  • Maven
    <dependency>
        <groupId>io.github.alperensert</groupId>
        <artifactId>capmonster_java</artifactId>
        <version>RELEASE</version>
    </dependency>
  • Gradle
    implementation group: 'io.github.alperensert', name: 'capmonster_java', version: 'RELEASE'

Supported captcha types

  • Image to text
  • Recaptcha v2
  • Recaptcha v3
  • Fun Captcha
  • HCaptcha
  • GeeTest

Usage Examples

Image to text

import io.github.alperensert.capmonster_java.tasks.ImageToTextTask;
import org.json.JSONObject;

public class Capmonster {
    public static void main(String[] args) throws InterruptedException {
        ImageToTextTask imageToTextTask = new ImageToTextTask("API_KEY");
        ImageToTextTask.TaskBuilder taskBuilder = new ImageToTextTask.TaskBuilder(
                "BASE_64_ENCODED_IMAGE")
                .setModuleName("universal");
        int taskId = imageToTextTask.createTask(taskBuilder);
        JSONObject result = imageToTextTask.joinTaskResult(taskId);
        System.out.println(result);
    }
}

Recaptcha v2

import io.github.alperensert.capmonster_java.tasks.RecaptchaV2Task;
import io.github.alperensert.capmonster_java.utilities.UserAgent;
import org.json.JSONObject;

public class Capmonster {
    public static void main(String[] args) throws InterruptedException {
        UserAgent userAgent = new UserAgent("some user agent");
        RecaptchaV2Task recaptchaV2Task = new RecaptchaV2Task("API_KEY");
        RecaptchaV2Task.TaskBuilder taskBuilder = new RecaptchaV2Task.TaskBuilder(
                "WEBSITE_URL",
                "WEBSITE_KEY")
                .setUserAgent(userAgent)
                .setCache(true);
        int taskId = recaptchaV2Task.createTask(taskBuilder);
        JSONObject result = recaptchaV2Task.joinTaskResult(taskId);
        System.out.println(result);
    }
}

For other examples and api documentation please visit wiki