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. ESM and CommonJS. Per-type convenience methods. Zero dependencies beyond built-in fetch.
import { OneCaptchaClient } from '@onecaptcha/sdk';
const client = new OneCaptchaClient({
apiKey: 'oc_...'
});
const result = await client.solveRecaptchaV2({
url: 'https://example.com',
sitekey: '6Le-wvk...',
});
console.log(result.token);
pip install onecaptcha
Typed request classes for every captcha type. Type hints throughout. Python 3.8+.
from onecaptcha import (
OneCaptchaClient, RecaptchaV2
)
client = OneCaptchaClient(api_key="oc_...")
result = client.solve(RecaptchaV2(
url="https://example.com",
sitekey="6Le-wvk...",
))
print(result.token)
go get onecaptcha
Idiomatic Go with context support. Typed request structs. Functional options pattern.
client := onecaptcha.New("oc_...")
result, err := client.Solve(
ctx,
onecaptcha.RecaptchaV2{
URL: "https://example.com",
SiteKey: "6Le-wvk...",
},
)
com.onecaptcha:sdk
Java 11+ with HttpClient. Builder pattern. Sealed request interfaces with typed records.
var client = OneCaptchaClient
.builder()
.apiKey("oc_...")
.build();
var result = client.solve(
SolveRequest.RecaptchaV2.of(
"https://example.com",
"6Le-wvk..."
)
);
CMake FetchContent
C++17 with designated initializers. Depends on libcurl. CMake FetchContent or header-only.
onecaptcha::OneCaptchaClient client(
{.apiKey = "oc_..."}
);
auto result = client.solve(
onecaptcha::RecaptchaV2{
.url = "https://example.com",
.sitekey = "6Le-wvk...",
}
);
build.zig.zon dependency
Native Zig with async I/O. Comptime-validated request types. No libc dependency.
const oc = @import("onecaptcha");
var client = try oc.Client.init(
allocator, io,
.{ .api_key = "oc_..." },
);
const outcome = try client.solve(
oc.RecaptchaV2{
.url = "https://example.com",
.sitekey = "6Le-wvk...",
}, .{},
);
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.