Drop-in libraries for the most popular languages. Every SDK wraps the same unified API — same request format, same error codes, same behaviour.
npm install @onecaptcha/sdk
Full async/await support. Works with both ESM and CommonJS. Per-type sync + async convenience methods. Zero dependencies.
import { OneCaptchaClient } from '@onecaptcha/sdk';
const client = new OneCaptchaClient({
apiKey: 'oc_...'
});
// Sync solve
const r = await client.solveRecaptchaV2({
url: 'https://example.com',
sitekey: '6Le-wvk...',
});
console.log(r.token);
await r.reportGood(); // report success
// Image OCR — just pass the base64
const img = await client.solveImageToText(b64);
await img.reportGood();
pip install onecaptcha
Typed request classes for every captcha type. Type hints throughout. Python 3.10+. Zero dependencies.
from onecaptcha import (
OneCaptchaClient, RecaptchaV2
)
client = OneCaptchaClient(api_key="oc_...")
result = client.solve(RecaptchaV2(
url="https://example.com",
sitekey="6Le-wvk...",
))
print(result.token)
result.report_good() # report success
go get github.com/onecaptcha/sdk-go
Idiomatic Go with context support. Typed request structs. Functional options pattern. Zero dependencies.
client := onecaptcha.New("oc_...")
result, err := client.Solve(ctx,
onecaptcha.RecaptchaV2{
URL: "https://example.com",
SiteKey: "6Le-wvk...",
},
)
fmt.Println(result.Token)
result.ReportGood(ctx) // report success
com.onecaptcha:onecaptcha-sdk
Java 17+ with HttpClient. Builder pattern. Sealed request interface with typed records. Zero runtime dependencies.
var client = OneCaptchaClient
.builder().apiKey("oc_...").build();
var result = client.solve(
SolveRequest.RecaptchaV2.of(
"https://example.com",
"6Le-wvk..."
)
);
System.out.println(result.token());
result.reportGood().run(); // report success
CMake FetchContent
C++17 static library. WinHTTP on Windows, BSD sockets on POSIX. Zero external dependencies.
onecaptcha::OneCaptchaClient client(
{.apiKey = "oc_..."}
);
auto result = client.solve(
onecaptcha::RecaptchaV2{
.url = "https://example.com",
.sitekey = "6Le-wvk...",
}
);
std::cout << result.token << "\n";
result.reportGood(); // report success
build.zig.zon dependency
Native Zig with std.http. Comptime-validated request types. No libc dependency. Zero external deps.
const oc = @import("onecaptcha");
var client = try oc.Client.init(
gpa, io, .{ .api_key = "oc_..." },
);
var outcome = try client.solve(
oc.RecaptchaV2{
.url = "https://example.com",
.sitekey = "6Le-wvk...",
}, .{},
);
// try client.reportGood(task_ref);
The API is a simple JSON-over-HTTPS interface. Any language with an HTTP client works — no SDK required. See the docs for cURL examples and the full endpoint reference.