AZcaptcha.Sdk 1.0.0

dotnet add package AZcaptcha.Sdk --version 1.0.0
                    
NuGet\Install-Package AZcaptcha.Sdk -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AZcaptcha.Sdk" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AZcaptcha.Sdk" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AZcaptcha.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AZcaptcha.Sdk --version 1.0.0
                    
#r "nuget: AZcaptcha.Sdk, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AZcaptcha.Sdk@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AZcaptcha.Sdk&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AZcaptcha.Sdk&version=1.0.0
                    
Install as a Cake Tool

AZcaptcha .NET SDK

Official .NET client for AZcaptcha — image captchas, reCAPTCHA v2/v3, hCaptcha, Cloudflare Turnstile, FunCaptcha and GeeTest.

  • Async/await throughout (Task), CancellationToken on every call.
  • Targets netstandard2.0 and net8.0.
  • 2Captcha-compatible surface (SolveAsync, ResultAsync, BalanceAsync, ReportBadAsync) plus the modern JSON API (CreateTaskAsync, GetTaskResultAsync).
  • Typed AzcaptchaException with Code, Category and Retryable (spec-v1.0.0).
  • Contract polling with NO_SLOT backoff and per-type deadlines.

Install

dotnet add package AZcaptcha.Sdk

Quickstart

using Azcaptcha;

var client = new AzcaptchaClient("YOUR_API_KEY");

// reCAPTCHA v2
string token = await client.SolveRecaptchaV2Async(
    "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    "https://example.com/login");

// Image captcha (bytes, file path or base64/data: URI)
string answer = await client.SolveImageFileAsync("captcha.png");

// hCaptcha / Turnstile
string h = await client.SolveHCaptchaAsync("SITEKEY", "https://example.com/");
string t = await client.SolveTurnstileAsync("0x4AAAAAAA...", "https://example.com/");

Low-level (2Captcha style)

string taskId = await client.SubmitAsync("userrecaptcha", new Dictionary<string, object?>
{
    ["googlekey"] = "SITEKEY",
    ["pageurl"] = "https://example.com/"
});
string token = await client.WaitResultAsync(taskId, TimeSpan.FromSeconds(300));

Modern JSON API

int taskId = await client.CreateTaskAsync("RecaptchaV2TaskProxyless",
    new Dictionary<string, object?>
    {
        ["websiteURL"] = "https://example.com/login",
        ["websiteKey"] = "SITEKEY"
    });
var solution = await client.WaitTaskResultAsync(taskId);
Console.WriteLine(solution["gRecaptchaResponse"].GetString());

Proxies

await client.SolveRecaptchaV2Async(sitekey, pageurl, invisible: false, enterprise: false,
    parameters: new Dictionary<string, object?>
    {
        ["proxy"] = "socks5://user:pass@1.2.3.4:1080"
    });

Any accepted spelling works (scheme://user:pass@host:port, host:port:user:pass, user:pass@host:port). The scheme is never sent upstream; proxytype is derived (http/https → HTTP, socks4, socks5).

Errors

try
{
    string token = await client.SolveTurnstileAsync(sitekey, pageurl);
}
catch (AzcaptchaException error) when (error.Category == ErrorCategory.Balance)
{
    // ERROR_ZERO_BALANCE
}
catch (AzcaptchaException error) when (error.Category == ErrorCategory.Capacity)
{
    // ERROR_NO_SLOT_AVAILABLE — retry with backoff
}

WaitResultAsync retries only codes marked retryable and backs off 10s ×1.5 up to 60s.

Timeouts

Defaults match server settings: image 120s, hCaptcha 120s, Turnstile 180s, reCAPTCHA and others 300s. Override with client.SolveAsync(method, parameters, TimeSpan.FromSeconds(90)).

Custom transport

var client = new AzcaptchaClient("KEY", new AzcaptchaConfig
{
    Transport = myTransport,
    Delay = (duration, token) => Task.Delay(duration, token)
});

ITransport requires PostFormAsync, PostJsonAsync and GetAsync.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 5 11/18/2026