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.
- 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'
- Image to text
- Recaptcha v2
- Recaptcha v3
- Fun Captcha
- HCaptcha
- GeeTest
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);
}
}
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