⚠ Deprecated: Legacy, CriticalBugs
A robust, production-ready async client library for the FreeCap captcha solving service. Supports all captcha types including hCaptcha, FunCaptcha, Geetest, and more.
$ dotnet add package FreeCap.ClientA robust, production-ready async client library for the FreeCap captcha solving service. Supports all captcha types including hCaptcha, FunCaptcha, Geetest, and more.
Install the package via NuGet Package Manager:
dotnet add package FreeCap.Client
Or via Package Manager Console:
Install-Package FreeCap.Client
using FreeCap.Client;
using FreeCap.Client.Models;
using FreeCap.Client.Enums;
// Using the main client
using var client = new FreeCapClient("your-api-key");
var task = new CaptchaTask
{
SiteKey = "a9b5fb07-92ff-493f-86fe-352a2803b3df",
SiteUrl = "discord.com",
RqData = "your-rq-data-here",
GroqApiKey = "your-groq-api-key"
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.HCaptcha);
Console.WriteLine($"Captcha solved: {solution}");
using FreeCap.Client;
// Quick hCaptcha solving
var solution = await FreeCapSolver.SolveHCaptchaAsync(
apiKey: "your-api-key",
siteKey: "a9b5fb07-92ff-493f-86fe-352a2803b3df",
siteUrl: "discord.com",
rqData: "your-rq-data-here",
groqApiKey: "your-groq-api-key"
);
// Quick FunCaptcha solving
var funcaptchaSolution = await FreeCapSolver.SolveFunCaptchaAsync(
apiKey: "your-api-key",
preset: FunCaptchaPreset.RobloxLogin
);
var task = new CaptchaTask
{
SiteKey = "your-site-key",
SiteUrl = "your-site-url",
RqData = "your-rq-data",
GroqApiKey = "your-groq-api-key",
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.HCaptcha);
var task = new CaptchaTask
{
Preset = FunCaptchaPreset.RobloxLogin,
ChromeVersion = "137", // 136 or 137
Blob = "undefined",
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.FunCaptcha);
var task = new CaptchaTask
{
Challenge = "your-challenge",
RiskType = RiskType.Slide, // Slide, Gobang, Icon, Ai
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.Geetest);
var task = new CaptchaTask
{
SiteKey = "your-site-key",
SiteUrl = "your-site-url",
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.CaptchaFox);
var task = new CaptchaTask
{
SiteKey = "your-site-key",
SiteUrl = "your-site-url",
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.DiscordId);
var task = new CaptchaTask
{
Proxy = "http://user:pass@host:port" // Optional
};
var solution = await client.SolveCaptchaAsync(task, CaptchaType.AuroNetwork);
var config = new ClientConfig
{
ApiUrl = "https://freecap.su", // Default API URL
RequestTimeout = TimeSpan.FromSeconds(30), // HTTP request timeout
MaxRetries = 3, // Maximum retry attempts
RetryDelay = TimeSpan.FromSeconds(1), // Base retry delay
DefaultTaskTimeout = TimeSpan.FromSeconds(120), // Task completion timeout
DefaultCheckInterval = TimeSpan.FromSeconds(3), // Status check interval
UserAgent = "Mozilla/5.0..." // Custom User-Agent
};
using var client = new FreeCapClient("your-api-key", config);
using Microsoft.Extensions.Logging;
using var loggerFactory = LoggerFactory.Create(builder =>
builder.AddConsole().SetMinimumLevel(LogLevel.Information));
var logger = loggerFactory.CreateLogger<FreeCapClient>();
using var client = new FreeCapClient("your-api-key", logger: logger);
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Custom-Header", "value");
using var client = new FreeCapClient("your-api-key", httpClient: httpClient);
The library provides specific exception types for different error scenarios:
try
{
var solution = await client.SolveCaptchaAsync(task, CaptchaType.HCaptcha);
}
catch (FreeCapValidationException ex)
{
// Invalid task configuration
Console.WriteLine($"Validation error: {ex.Message}");
}
catch (FreeCapTimeoutException ex)
{
// Task timed out
Console.WriteLine($"Timeout: {ex.Message}");
}
catch (FreeCapApiException ex)
{
// API error response
Console.WriteLine($"API error: {ex.Message}");
if (ex.StatusCode.HasValue)
Console.WriteLine($"Status code: {ex.StatusCode}");
}
catch (FreeCapException ex)
{
// Base FreeCap exception
Console.WriteLine($"FreeCap error: {ex.Message}");
}
// Create task
var taskId = await client.CreateTaskAsync(task, CaptchaType.HCaptcha);
// Check status manually
var result = await client.GetTaskResultAsync(taskId);
// Poll until completion with custom logic
while (true)
{
var status = await client.GetTaskResultAsync(taskId);
// Handle status...
await Task.Delay(5000); // Custom delay
}
using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
try
{
var solution = await client.SolveCaptchaAsync(
task,
CaptchaType.HCaptcha,
cancellationToken: cts.Token
);
}
catch (OperationCanceledException)
{
Console.WriteLine("Operation was cancelled");
}
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
For issues and feature requests, please visit the GitHub repository.
Contributions are welcome! Please feel free to submit a Pull Request.