getTaskResult
Returns the state of a task and, once it is solved, the token.
POST https://api.silentcap.fun/getTaskResult
Request body
| Field | Type | Description |
|---|---|---|
clientKey Required | string | Your API key. |
taskId Required | string | The ID returned by createTask. |
{
"clientKey": "YOUR_API_KEY",
"taskId": "b1f2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}Response
| Field | Type | Description |
|---|---|---|
errorId Required | number | 0 unless the task failed. |
status Required | string | processing while we work on it, ready once the token is available. |
solution Optional | object | Present when status is ready. Its fields depend on the task type. |
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "0.xK3fQ9...Lm2"
}
}Polling
Poll about once a second. Polling faster doesn't speed up the solve. Stop when status is ready or errorId is not 0, and give up after a timeout
you choose.
def wait_for_token(task_id, timeout=120):
deadline = time.time() + timeout
while time.time() < deadline:
time.sleep(1)
res = requests.post(f"{API}/getTaskResult", json={
"clientKey": KEY, "taskId": task_id,
}).json()
if res["errorId"] != 0:
raise RuntimeError(res["errorCode"])
if res["status"] == "ready":
return res["solution"]["token"]
raise TimeoutError("task did not finish in time")A task that fails returns an error such as ERROR_CAPTCHA_UNSOLVABLE and is not charged.
Create a new task to try again.
The fields inside solution are listed on the FunCaptcha and Turnstile pages.