Skip to content
🍬 Simple API wrapper for https://2captcha.com/
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
2Captcha.Sandbox Renamed 2Captcha.Test project to 2Captcha.Sandbox Jul 5, 2019
2Captcha Updated assembly version Mar 6, 2019
.gitattributes Initial commit Dec 29, 2018
.gitignore Initial commit Dec 29, 2018
2Captcha.sln Renamed 2Captcha.Test project to 2Captcha.Sandbox Jul 5, 2019
LICENSE
README.md

README.md

2Captcha logo

Simple HTTP API wrapper for https://2captcha.com/
An online captcha solving and image recognition service.

πŸ”— Download

β˜• Support me

If you find this project useful and you are new to 2captcha please consider registering from my referrral link.

🏁 Sample code

var twoCaptcha = new TwoCaptcha(" ## YOUR API KEY ## ");

// Get current balance
var balance = await twoCaptcha.GetBalance();

// Solve image captcha
var image1 = await twoCaptcha.SolveImage(new FileStream("captcha.png", FileMode.Open));
var image2 = await twoCaptcha.SolveImage("data:image/png;base64,iVBORw0KGgo...");

// Solve text captcha
var question = await twoCaptcha.SolveQuestion("1 + 3 = ?");

// Solve ReCaptchaV2
var recaptcha = await twoCaptcha.SolveReCaptchaV2("GOOGLE_SITE_KEY", "https://example.com");
var recaptchaInvisible = await twoCaptcha.SolveReCaptchaV2("GOOGLE_SITE_KEY", "https://example.com", true);

// Solve ClickCaptcha
var click1 = await twoCaptcha.SolveClickCaptcha(new FileStream("captcha.png", FileMode.Open), "Click on ghosts");
var click2 = await twoCaptcha.SolveClickCaptcha("data:image/png;base64,iVBORw0KGgo...", "Click on ghosts");

// Solve RotateCaptcha
var rotate = await twoCaptcha.SolveRotateCaptcha(new Stream[] {new FileStream("captcha.png", FileMode.Open)}, "40");

// Solve FunCaptcha
var fun = await twoCaptcha.SolveFunCaptcha("FUN_CAPTCHA_PUBLIC_KEY", "https://example.com");
var funNoJavaScript = await twoCaptcha.SolveFunCaptcha("FUN_CAPTCHA_PUBLIC_KEY", "https://example.com", true);

// Solve KeyCaptcha
var key = await twoCaptcha.SolveKeyCaptcha("USER_ID", "SESSION_ID", "WEB_SIGN_1", "WEB_SIGN_2", "https://example.com");

And here is the result structure (same for all methods):

public struct TwoCaptchaResult
{
	public bool Success;
	public string Response;

	public TwoCaptchaResult(bool success, string response)
	{
		Success = success;
		Response = response;
	}
}

πŸ“Ž License

MIT License

Copyright (c) 2018 Kamil Monicz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.