SwifCap hCaptcha API Reference
RESTful JSON-over-HTTP/HTTPS hCaptcha solver API. Send a target sitekey and page siteurl to receive a real, server-verified P1_ token, E0_ response key, and matching browser user_agent ready for h-captcha-response.
Authentication
Every API request requires your SwifCap API key (sc_...). Mint or rotate up to 5 keys anytime from your Dashboard → API Key page.
Pass your key via Authorization: Bearer sc_..., via the X-API-Key header, as key in your JSON request body, or as ?key=YOUR_API_KEY in the query string.
"sc_your_api_key"Sign in to auto-populate all code examples with your live API key.
hCaptcha & Enterprise Token API
Submit an hCaptcha solve job with the page's sitekey (UUID), siteurl, and optional sticky proxy, then poll /api/get_result until status is solved. Inject the returned P1_... token into your target form's h-captcha-response field and submit using the returned user_agent.
hcaptchaStandard and invisible hCaptcha widgets. Required: sitekey, siteurl. Optional: proxy, user_agent. Returns a P1_ token, E0_ resp_key, and browser user_agent.
hcaptcha_enterpriseEnterprise hCaptcha deployments. Required: sitekey, siteurl. Optional: rqdata (send whenever the page widget supplies one), sticky residential proxy, and user_agent.
# 1. Create hCaptcha / hCaptcha Enterprise Solve Task
POST https://swiftcaptcha.online/api/create_task
POST https://swiftcaptcha.online/api/v1/tasks/create
# 2. Poll Solve Task Result (Returns P1_ token, E0_ resp_key & user_agent)
GET https://swiftcaptcha.online/api/get_result/{task_id}?key=sc_your_api_key
POST https://swiftcaptcha.online/api/v1/tasks/result
# 3. Check Account Credit & Point Balance
GET https://swiftcaptcha.online/api/v1/balance?key=sc_your_api_key
# 4. Solve hCaptcha Visual Challenge (Grid / Area Select / Drag)
POST https://swiftcaptcha.online/api/v1/recognition/{task_type}
GET https://swiftcaptcha.online/api/v1/recognition/{task_type}?id={task_id}&key=sc_your_api_keyProxy Formats & Sticky Exit Passthrough
On enterprise sitekeys, hCaptcha verifies that the IP submitting the token matches the IP that solved the challenge. Pass a sticky residential or mobile proxy so page load, challenge solve, and token submission all leave from one exit IP. If you omit proxy, the solve runs through SwifCap's built-in solver network pool.
"proxy": {
"scheme": "socks5", // "http" | "https" | "socks5" | "socks5h" | "socks4"
"host": "1.2.3.4", // Must be a public IP or hostname
"port": 10000,
"username": "user",
"password": "pass"
}https://swiftcaptcha.online/api/create_task(Alias: /api/v1/tasks/create)Submit a standard hcaptcha solve job. Points are deducted per challenge round (1 Point / Round — e.g. 5 rounds = 5 points) only when a valid P1_ token is produced; failed, cancelled, or expired solves cost 0 PTS.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| key | string | Required | Your SwifCap secret API key (or send Authorization: Bearer). |
| type | string | Required | hcaptcha or hcaptcha_enterprise. |
| data.sitekey | string | Required | The hCaptcha sitekey UUID (the data-sitekey attribute on the target widget). |
| data.siteurl | string | Required | Full page URL where the hCaptcha challenge appears (also accepts url). |
| data.rqdata | string | Optional | Custom enterprise challenge token supplied by the page widget configuration, fresh per solve. |
| data.proxy | string | object | Recommended | Sticky residential or mobile proxy (HTTP, HTTPS, SOCKS5, SOCKS5h, SOCKS4). |
| data.useragent | string | Optional | Browser User-Agent that loaded the target page (also accepts user_agent). |
import requests, time
API_KEY = "sc_your_api_key"
BASE = "https://swiftcaptcha.online/api"
# 1. Create standard hCaptcha solve task (with sticky proxy passthrough)
task = requests.post(f"{BASE}/create_task", json={
"key": API_KEY,
"type": "hcaptcha",
"data": {
"sitekey": "4c672d35-0701-42b2-88c3-78380b0db560",
"siteurl": "https://example.com/login",
"proxy": "http://user:[email protected]:8080"
}
}).json()
task_id = task["task_id"]
print(f"Task created: {task_id}")
# 2. Poll for the solved P1_ token
while True:
res = requests.get(f"{BASE}/get_result/{task_id}?key={API_KEY}").json()
if res["status"] == "solved":
# Submit res["token"] as h-captcha-response with res["user_agent"]
print(f"Token: {res['token'][:60]}...")
print(f"Resp Key: {res.get('resp_key')}")
print(f"User-Agent: {res.get('user_agent')}")
break
elif res["status"] == "error":
print(f"Solve failed (0 PTS charged): {res.get('error')}")
break
time.sleep(1.5)https://swiftcaptcha.online/api/create_taskFor flows protected by hCaptcha Enterprise, set type to hcaptcha_enterprise and pass the session's rqdata (when present on the page) along with a sticky residential proxy. Parameters can be sent inside data or at the root level of the JSON body.
import requests, time
API_KEY = "sc_your_api_key"
BASE = "https://swiftcaptcha.online/api"
# 1. Create hCaptcha Enterprise solve task (with rqdata, useragent & sticky proxy)
task = requests.post(f"{BASE}/create_task", json={
"key": API_KEY,
"type": "hcaptcha_enterprise",
"data": {
"sitekey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
"siteurl": "https://example.com/register",
"proxy": "http://user:pass@residential-ip:port",
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
"rqdata": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
}).json()
task_id = task["task_id"]
# 2. Poll for solved P1_ token
while True:
res = requests.get(f"{BASE}/get_result/{task_id}?key={API_KEY}").json()
if res["status"] == "solved":
print("Solved P1_ Token:", res["token"])
print("Response Key (E0_):", res.get("resp_key"))
print("User-Agent:", res.get("user_agent"))
print("Solve Time:", res.get("solve_time"), "s")
break
elif res["status"] == "error":
print("Error (0 PTS charged):", res.get("error"))
break
time.sleep(1.5)https://swiftcaptcha.online/api/get_result/{task_id}?key=YOUR_API_KEYPoll every 1.5–2 seconds until status transitions from solving to solved. A solved response includes token (the P1_... string), resp_key (the E0_... value from hcaptcha.getRespKey()), and user_agent.
{
"status": "solving",
"success": true,
"task_id": "swif_8a91_f4c0",
"queue_ms": 12
}{
"status": "solved",
"success": true,
"task_id": "swif_8a91_f4c0",
"type": "hcaptcha_enterprise",
"token": "P1_eyJ0eXAiOiJKV...",
"solution": "P1_eyJ0eXAiOiJKV...",
"resp_key": "E0_eyJ0eXAi...",
"user_agent": "Mozilla/5.0...",
"queue_ms": 12,
"resolve_ms": 6820,
"solve_time": 6.82,
"pointsDeducted": 10
}{
"status": "error",
"success": false,
"task_id": "swif_8a91_f4c0",
"error": "challenge_not_loaded",
"pointsDeducted": 0
}https://swiftcaptcha.online/api/v1/balance?key=YOUR_API_KEYQuery your account's real-time point balance, remaining solve capacity, concurrency limit, and solves completed today.
{
"status": "success",
"credits": 15.200,
"points": 15200,
"solves_available": 1520,
"cost_per_solve_points": 10,
"concurrency_limit": 2,
"solves_today": 142
}hCaptcha Visual Challenge Recognition API
https://swiftcaptcha.online/api/v1/recognition/{task_type}For callers running their own browser automation that only need the visual challenge answer: send an hCaptcha challenge's images and prompt (hcaptcha for 3×3 tile grids, hcaptcha_area_select / image_label_area_select for point clicks, or image_drag_drop for drag puzzles) and receive the tile booleans or coordinates immediately in the same response.
import requests
# Simple 3x3 hCaptcha tile grid or single-image area select:
grid_res = requests.post(
"https://swiftcaptcha.online/api/v1/recognition/hcaptcha",
json={
"key": "sc_your_api_key",
"type": "hcaptcha",
"task": "Please click each image containing a bicycle",
"image_data": ["iVBORw0KGgo...", "...9 base64 tiles in order"]
}
).json()
print("Tile clicks (booleans):", grid_res.get("solution"))
# Full hCaptcha widget challenge object (image_label_binary, image_label_area_select, image_drag_drop):
drag_res = requests.post(
"https://swiftcaptcha.online/api/v1/recognition/image_drag_drop",
json={
"key": "sc_your_api_key",
"type": "image_drag_drop",
"requester_question": {"en": "Drag the puzzle piece to the matching slot"},
"tasklist": [
{
"datapoint_uri": "data:image/jpeg;base64,...",
"entities": [{"entity_id": "e1", "entity_uri": "data:image/png;base64,..."}]
}
]
}
).json()
print("Drag coordinates:", drag_res.get("solution"))https://swiftcaptcha.online/api/v1/recognition/{task_type}?id={task_id}&key=YOUR_API_KEYReturns [true, false, ...] for 3×3 hCaptcha tile grids, { x, y, w: 0, h: 0 } for area-select clicks, or [{ entity_id, x, y, w, h }] in percent of the image for drag puzzles.
Browser Extension Automation
For Chromium browser automation (nodriver, Selenium, Puppeteer, or Playwright), navigate to the SwifCap Setup URL to bind your API key to the browser session before visiting your target hCaptcha page:
https://swiftcaptcha.online/setup#key=sc_your_api_key|base_api=https://swiftcaptcha.online/api/extimport asyncio
import os
import truedriver as td
API_KEY = "sc_your_api_key"
EXT_DIR = os.path.abspath("./extension")
async def solve():
# 1. Launch browser with SwifCap hCaptcha Extension
browser = await td.start(
browser_args=[
f"--disable-extensions-except={EXT_DIR}",
f"--load-extension={EXT_DIR}",
],
headless=False
)
# 2. Activate your SwifCap API key
await browser.get(
f"https://swiftcaptcha.online/setup#key={API_KEY}|base_api=https://swiftcaptcha.online/api/ext"
)
await asyncio.sleep(4)
# 3. Navigate to target & wait for solved hCaptcha token
page = await browser.get("https://example.com")
for _ in range(60):
try:
token = await asyncio.wait_for(
page.evaluate("hcaptcha.getResponse()"), timeout=2
)
if token and len(token) > 30:
print(f"[✓] Token: {token[:60]}...")
return token
except Exception:
pass
await asyncio.sleep(1)
asyncio.run(solve())from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os, time
API_KEY = "sc_your_api_key"
EXT_DIR = os.path.abspath("./extension")
options = Options()
options.add_argument(f"--load-extension={EXT_DIR}")
options.add_argument(f"--disable-extensions-except={EXT_DIR}")
driver = webdriver.Chrome(options=options)
# Setup & Activate SwifCap Key
driver.get(f"https://swiftcaptcha.online/setup#key={API_KEY}|base_api=https://swiftcaptcha.online/api/ext")
time.sleep(4)
# Navigate to target site
driver.get("https://example.com")
for _ in range(60):
try:
token = driver.execute_script("return hcaptcha.getResponse()")
if token and len(token) > 30:
print("Token:", token)
break
except Exception:
pass
time.sleep(1)const puppeteer = require('puppeteer-extra');
const API_KEY = 'sc_your_api_key';
(async () => {
const browser = await puppeteer.launch({
headless: false,
args: [
'--disable-extensions-except=./extension',
'--load-extension=./extension'
],
});
// Activate SwifCap API Key
const setupPage = await browser.newPage();
await setupPage.goto(
`https://swiftcaptcha.online/setup#key=${API_KEY}|base_api=https://swiftcaptcha.online/api/ext`
);
await new Promise(r => setTimeout(r, 4000));
await setupPage.close();
// Navigate to target page
const page = await browser.newPage();
await page.goto('https://example.com');
const token = await page.evaluate(() => {
return new Promise(r => {
setInterval(() => {
try {
const t = hcaptcha.getResponse();
if (t) r(t);
} catch (e) {}
}, 1000);
});
});
console.log('Solved Token:', token);
})();hCaptcha Error Codes & Diagnostics
When a solve ends without producing a token, pointsDeducted is always 0. Inspect the returned error code to decide whether to rotate your proxy exit IP or retry:
challenge_not_loadedhCaptcha did not serve a challenge through your proxy (often due to low IP reputation or geo-restriction). Open a fresh sticky proxy session with a new exit IP. 0 PTS charged.
token_not_grantedThe challenge rounds were answered but hCaptcha did not issue a token. Switch to a residential proxy exit with higher reputation. 0 PTS charged.
proxy_error / proxy_rejectedYour proxy refused the connection, timed out, or intercepted TLS. Verify proxy credentials and ensure the host is a public IP. 0 PTS charged.
sitekey_rate_limited / CONCURRENCY_LIMIT_EXCEEDED (Max 2 concurrency only allowed.)Your account reached its concurrent thread cap or hCaptcha is throttling requests for this sitekey. Wait briefly or rotate your proxy pool.
challenge_expired / expiredThe challenge or proxy did not respond before the solve deadline. Retry with a faster residential proxy exit. 0 PTS charged.
Insufficient solve creditsAccount balance is below 10 PTS ($0.01 — $1 / 100 solves). Top up your balance from Dashboard → Billing.
hCaptcha Token Submission Rules
• Keep page load, solve, and form submit on one sticky IP: On hcaptcha_enterprise sitekeys, the target server checks that the IP submitting the P1_ token matches the IP that solved it. Use a sticky residential proxy session.
• Always use the returned User-Agent & resp_key: Each solved task returns the exact user_agent presented during the solve and the resp_key (E0_...). Submit your form with that User-Agent header and populate both h-captcha-response and (when required by the site) g-recaptcha-response.
• Submit within 120 seconds: hCaptcha tokens are single-use and expire roughly 2 minutes after issuance. Request a solve right before submitting your form.