Errors and troubleshooting
What does ERROR_INVALID_TASK_DATA mean?
Your task object is missing a field that its type requires, or a field has the wrong shape, and the errorDescription in the reply tells you which one.
The meaning
createTask validates the task before starting it. If a required field is absent or unusable, it replies with errorId: 1, errorCode: "ERROR_INVALID_TASK_DATA" and an errorDescription naming the field. No task is created and nothing is charged. In the in.php interface, the equivalent reply is ERROR_BAD_PARAMETERS. Read the description, fix that field, send again.
reply = create_task(task)
if reply.get("errorId"):
code, detail = reply["errorCode"], reply.get("errorDescription", "")
if code == "ERROR_INVALID_TASK_DATA":
raise ValueError(f"task rejected, fix this field: {detail}")
raise RuntimeError(f"{code}: {detail}")
Required fields by type
| Type | Required besides type |
|---|---|
| Any reCAPTCHA token type | websiteURL, websiteKey |
| Cloudflare Turnstile | websiteURL, websiteKey |
| Cloudflare Challenge | websiteURL, proxy |
| AWS WAF | websiteURL |
| GeeTest | websiteURL, plus gt and challenge for v3 or captchaId for v4 |
| MTCaptcha | websiteURL, websiteKey |
| DataDome Slider | websiteURL, captchaUrl, proxy |
| Image to Text | body (base64) |
| reCAPTCHA grid images | image, question |
| AWS WAF grid images | images (array), question |
| Vision Engine | module, image |
Each type's page under supported CAPTCHAs lists optional fields as well.
Common slips
- Field name case.
websiteUrlorsitekeyinstead ofwebsiteURLandwebsiteKey. Type names are case-insensitive, field names are not forgiving. - Fields outside
task.websiteURLplaced next toclientKeyat the top level instead of inside the task object. - Empty values. A selector that found nothing produced an empty string or
nullfor the site key. - Wrong shape.
imagessent as a single string instead of an array for AWS WAF classification, orproxysplit into separate host and port fields. - Base64 prefix. Image fields must contain only the base64 data, without
data:image/...;base64,.
Validate before sending
A tiny local check catches these mistakes before they cost a round trip. Keep a map of required fields per type and assert they are present and non-empty:
NEEDS = {
"AntiCloudflareTask": ("websiteURL", "proxy"),
"DatadomeSliderTask": ("websiteURL", "captchaUrl", "proxy"),
"ImageToTextTask": ("body",),
}
def preflight(task):
missing = [f for f in NEEDS.get(task["type"], ("websiteURL", "websiteKey")) if not task.get(f)]
if missing:
raise ValueError(f"{task['type']} is missing {', '.join(missing)}")
Related errors
ERROR_TASK_NOT_SUPPORTED means the type value itself is not one of the 14 supported types, often a typo or a type from another vendor's naming. ERROR_CAPTCHA_UNSOLVABLE means the task was valid and started but could not be solved, which points to wrong values rather than missing ones; see that page. The API docs list every error code, and the createTask migration guide covers field names when moving from other clients.
Reading the reply in practice
The description is meant for people, so log it in full next to the task you sent. A message naming websiteKey usually means your page parser returned nothing, which in turn often means the page you fetched was not the page you expected: a consent screen, a login redirect or a challenge page. Fixing the parser or the fetch solves the error at its source. If the description names proxy, check that the type you chose really needs one and that your code fills it for that type.
Testing tasks by hand first
Before wiring a new type into a job, send one task by hand with curl or a short script and read the full reply. It takes a minute and shows the exact field names and shapes that work. Copy that working task into your code as a fixture, and compare against it whenever a later change produces this error. Most validation errors in production come from code paths that build the task differently from the one you tested.
Common questions
How do I know which field is wrong?
Read errorDescription in the reply; it names the missing or invalid field.
Is a rejected task charged?
No. The task was never created, and error responses are free.
Are field names case sensitive?
Use the exact names from the docs, such as websiteURL and websiteKey; type names are case-insensitive.
What is the in.php equivalent?
ERROR_BAD_PARAMETERS, returned when required parameters are missing or unsupported.
Why does my GeeTest task fail validation?
Send gt and challenge for v3, or captchaId for v4, along with websiteURL.
Keep reading
- API docscreateTask, getTaskResult, getBalance, error codes and the in.php format.
- What does ERROR_CAPTCHA_UNSOLVABLE mean?The solver could not produce an answer for this task; it is free, and repeated cases usually mean the inputs need fixing.
- Moving a createTask client to GateSolverSwitch a createTask and getTaskResult client to GateSolver: replace the base URL, check task type names and fields, test with getBalance.
- All CAPTCHA typesThe 14 task families GateSolver solves, each with its own guide.