How it works
The API is asynchronous:
- Send
createTaskand keep the returnedtaskId. - Wait 5 seconds, then call
getTaskResult. - While
statusisprocessing, poll every 5 seconds. - When
statusisready, use thesolutionobject. IferrorIdis non-zero, handle the error.
An unsolved task expires after 5 minutes and reserved funds are refunded. Submit the returned solution to the target website — see Using the solution.
Waiting with the Python SDK#
solve(task) creates a new task and waits for a solution. create_task(task) returns only the ID; get_task_result(task_id) makes one status request.
Set polling_interval=5 explicitly: the published SDK 1.0.0 defaults to 3 seconds. To control the first poll precisely, use the manual polling example in Code examples.
The default SDK polling window is 120 seconds after task creation. The timeout argument to solve() changes that window. HTTP requests have a separate 30-second timeout, so an in-flight request may finish after the polling window ends.
A local timeout does not cancel the server task. Calling solve() again creates a new task. To continue waiting for the original task, keep its ID with create_task() and use get_task_result() before the task expires.