getTaskResult

Returns the state of a task and, once it is solved, the token.

POST https://api.silentcap.fun/getTaskResult

Request body

getTaskResult request fields
FieldTypeDescription
clientKey RequiredstringYour API key.
taskId RequiredstringThe ID returned by createTask.
JSON
{
  "clientKey": "YOUR_API_KEY",
  "taskId": "b1f2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}

Response

getTaskResult response fields
FieldTypeDescription
errorId Requirednumber0 unless the task failed.
status Requiredstringprocessing while we work on it, ready once the token is available.
solution OptionalobjectPresent 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.