https://github.com/zaczero/anticaptcha
🍬 Simple HTTP API wrapper for https://anti-captcha.com
https://github.com/zaczero/anticaptcha
anticaptcha api captcha geetest google hcaptcha image-captcha recaptcha solver text-captcha wrapper
Last synced: 11 months ago
JSON representation
🍬 Simple HTTP API wrapper for https://anti-captcha.com
- Host: GitHub
- URL: https://github.com/zaczero/anticaptcha
- Owner: Zaczero
- License: mit
- Created: 2019-04-18T19:25:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-23T15:53:47.000Z (almost 4 years ago)
- Last Synced: 2025-05-20T10:55:36.449Z (about 1 year ago)
- Topics: anticaptcha, api, captcha, geetest, google, hcaptcha, image-captcha, recaptcha, solver, text-captcha, wrapper
- Language: C#
- Homepage:
- Size: 46.9 KB
- Stars: 19
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
[](https://github.com/Zaczero/AntiCaptcha/releases/latest)
[](https://www.nuget.org/packages/AntiCaptchaAPI/)
[](https://github.com/Zaczero/AntiCaptcha/blob/master/LICENSE)
Simple HTTP API wrapper for [anti-captcha.com](https://anti-captcha.com/).
An online captcha solving and image recognition service.
## 🌤️ Installation
### Install with NuGet (recommended)
`Install-Package AntiCaptchaAPI`
### Install manually
[Browse latest GitHub release](https://github.com/Zaczero/AntiCaptcha/releases/latest)
## 🏁 Getting started
### Sample code
```cs
/*
* Class initialization
* Optionally you can pass 2nd parameter `httpClient` with custom HttpClient to use while requesting API
*/
var captcha = new AntiCaptcha("API_KEY");
var captchaCustomHttp = new AntiCaptcha("API_KEY", new HttpClient());
/*
* Get current balance
*/
var balance = await captcha.GetBalance();
/*
* Type: Image
*
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/image
*/
var image = await captcha.SolveImage("BASE64_IMAGE");
/*
* Type: ReCaptcha V2
* Optionally you can pass 3rd parameter `isInvisible` to indicate if the reCaptcha is setup as invisible
*
* Homepage: https://www.google.com/recaptcha/
* Documentation (vendor): https://developers.google.com/recaptcha/docs/display
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/recaptcha
*/
var reCaptcha = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL");
var reCaptchaInvisible = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL", true);
var reCaptchaWithProxy = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL", new AntiCaptchaProxy(ProxyType.Http, "PROXY_ADDRESS", 8080), "USER_AGENT");
/*
* Type: ReCaptcha V3
* If you get ERROR_INCORRECT_SESSION_DATA error you may need to increase minScore value
*
* Homepage: https://www.google.com/recaptcha/
* Documentation (vendor): https://developers.google.com/recaptcha/docs/v3
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/recaptcha
*/
var reCaptchaV3 = await captcha.SolveReCaptchaV3("SITE_KEY", "https://WEBSITE_URL", 0.9, "SOME_ACTION");
/*
* Type: hCaptcha
*
* Homepage: https://www.hcaptcha.com/
* Documentation (vendor): https://docs.hcaptcha.com/
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/hcaptcha
*/
var hCaptcha = await captcha.SolveHCaptcha("SITE_KEY", "https://WEBSITE_URL");
var hCaptchaWithProxy = await captcha.SolveHCaptcha("SITE_KEY", "https://WEBSITE_URL", new AntiCaptchaProxy(ProxyType.Http, "PROXY_ADDRESS", 8080), "USER_AGENT");
/*
* Type: GeeTest
*
* Homepage: https://www.geetest.com/en
* Documentation (vendor): https://docs.geetest.com/en
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/geetest
*/
var geeTest = await captcha.SolveGeeTest("SITE_KEY", "https://WEBSITE_URL", "CHALLENGE");
var geeTestWithProxy = await captcha.SolveGeeTest("SITE_KEY", "https://WEBSITE_URL", "CHALLENGE", new AntiCaptchaProxy(ProxyType.Http, "PROXY_ADDRESS", 8080), "USER_AGENT");
/*
* Type: FunCaptcha
*
* Documentation (anti-captcha): https://anti-captcha.com/apidoc/funcaptcha
*/
var funCaptcha = await captcha.SolveFunCaptcha("SITE_KEY", "https://WEBSITE_URL");
var funCaptchaWithProxy = await captcha.SolveFunCaptcha("SITE_KEY", "https://WEBSITE_URL", new AntiCaptchaProxy(ProxyType.Http, "PROXY_ADDRESS", 8080), "USER_AGENT");
/*
* Type: SquareNet
*/
var squareNet = await captcha.SolveSquareNet("BASE64_IMAGE", "OBJECT_NAME", 3, 3);
```
### And here is the result structure *(the same for all methods)*
```cs
public struct AntiCaptchaResult
{
public bool Success;
public string Response;
public AntiCaptchaResult(bool success, string response)
{
Success = success;
Response = response;
}
}
```
## Footer
### 📧 Contact
* Email: [kamil@monicz.pl](mailto:kamil@monicz.pl)
* PGP: [0x9D7BC5B97BB0A707](https://gist.github.com/Zaczero/158da01bfd5b6d236f2b8ceb62dd9698)
### 📃 License
* [Zaczero/AntiCaptcha](https://github.com/Zaczero/AntiCaptcha/blob/master/LICENSE)
* [JamesNK/Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)