Glossary
Task polling
Task polling is the loop your code runs after creating a task: it asks for the result at a fixed interval until the status is ready or failed.
Definition
Solving takes time, from under a second for a text image to several seconds for a token widget. Instead of holding one HTTP request open, the API returns a task ID immediately and lets you check back. Each check is a call to getTaskResult with your key and the ID, and the reply carries a status: processing while the solver works, ready with a solution when done, or failed with an error code.
GateSolver does not push results to a URL, so polling is the way every integration receives answers.
Sensible intervals
The interval should match how long the task family usually takes:
- Token and cookie tasks (reCAPTCHA, Turnstile, GeeTest, MTCaptcha, AWS WAF, Cloudflare challenge, DataDome): wait about three seconds before the first check, then check every three seconds.
- Image tasks (image to text, grid classification, Vision Engine): check every second, since they often finish in one or two.
Polling faster does not make the solve faster; it only spends requests. Each API key allows 600 requests per minute across all calls, so a tight loop over many tasks can hit ERROR_RATE_LIMIT. Polling slower wastes token lifetime, because the clock on a reCAPTCHA or Turnstile token starts when the solver gets it, not when you read it.
Timeouts
A task that is still unsolved after 120 seconds is marked failed and costs nothing. Your loop should therefore stop on its own at a little over two minutes and treat that as a failure. In practice you will rarely reach it; most token tasks are ready well within that window.
A polling loop in Python
import time, requests
API = "https://gatesolver.com"
def wait_for(task_id, every=3.0, give_up_after=125):
deadline = time.monotonic() + give_up_after
time.sleep(every)
while time.monotonic() < deadline:
out = requests.post(f"{API}/getTaskResult", json={
"clientKey": "YOUR_API_KEY", "taskId": task_id}, timeout=20).json()
if out.get("errorId"):
raise RuntimeError(out.get("errorCode"))
if out["status"] == "ready":
return out["solution"]
if out["status"] == "failed":
raise RuntimeError(out.get("errorCode", "failed"))
time.sleep(every)
raise TimeoutError(f"task {task_id} still processing")
Pass every=1.0 for image tasks. The function returns the solution object, which you then hand to the request that submits it.
Handling failures
A failed status with ERROR_CAPTCHA_UNSOLVABLE means that attempt could not be completed. It is free; create a new task, ideally with fresh page values, and poll again. Cap retries at two or three per challenge so a broken page does not loop forever. ERROR_TASKID_INVALID means the ID is unknown or too old, often a bug where IDs are mixed between workers.
Polling many tasks at once
When you run dozens of tasks in parallel, poll them in one loop rather than one thread each, and space the calls so the total stays well inside 600 per minute. Async clients such as httpx or aiohttp in Python, or plain fetch with Promise.all in Node.js, make this simple. There is no limit on concurrent tasks, so the request rate is the only thing to budget.
Legacy res.php polling
If you use the in.php interface, poll res.php?action=get&id=...&json=1 on the same intervals. The reply says CAPCHA_NOT_READY until an answer exists. The error handling article and the API docs list every status and code.
Where polling fits in the larger flow
In a browser script, start the task as soon as you have read the site key, keep filling the other form fields while the loop runs, and inject the answer the moment it arrives. In a queue based scraper, push the task ID into a short-lived job with the page context attached, so that whichever worker picks up the ready result also holds the cookies and form data it belongs to. Both designs keep the time between solve and submit short, which matters more for token success than any other single setting.
Common questions
How often should I call getTaskResult?
About every three seconds for token and cookie tasks and every second for image tasks.
Does faster polling speed up the solve?
No. It only uses more of your 600 requests per minute; the solver works at the same pace.
What happens after 120 seconds?
The task is marked failed and is not charged. Your loop should stop and create a new task if you still need one.
Is there a way to get results without polling?
No. GateSolver returns results only through getTaskResult or res.php, so every integration polls.
What should I do on ERROR_CAPTCHA_UNSOLVABLE?
Create a fresh task with new page values and poll again, with a small cap on retries per challenge.
Keep reading
- Error handling for CAPTCHA APIsSort every CAPTCHA API error into retry, fix or stop, follow those rules in code, and know which outcomes cost nothing.
- CAPTCHA solving APIWhat a solving API does, the createTask and getTaskResult cycle, per-1,000 pricing, and proxyless versus proxy tasks.
- How fast is CAPTCHA solving?Image answers come back in a couple of seconds; token and challenge page tasks take longer, with typical times per type.
- API docscreateTask, getTaskResult, getBalance, error codes and the in.php format.