createTask
Creates a task and returns taskId at once. The price is held and charged only if the task is solved.
本節內容以英文顯示。
POST https://neurocaptcha.com/createTaskCreates a task and answers at once with taskId. Get the solution with getTaskResult or receive it at callbackUrl.
Request#
參數說明
clientKeystring必填- Your API key.
taskobject必填- The task: its
typeand parameters (below). callbackUrlstring- Public http(s) URL for a signed webhook when the task is finished. Private addresses are rejected.
softIdinteger- Your application id in the developer program: you get a share of the spending of clients who use your application.
languagePoolstring- Accepted for compatibility with Anti-Captcha; ignored.
The task object#
Which fields matter depends on the task type; unknown fields are ignored.
參數說明
typestring必填- Task type, see task types.
websiteURLstring必填- Full address of the page where the reCAPTCHA is shown: http(s), up to 2048 characters. The page, not the address of the reCAPTCHA iframe.
websiteKeystring必填- Site key: the
data-sitekeyattribute of the widget or thekparameter of theanchorrequest in DevTools → Network. Up to 256 characters, no spaces. isInvisiblebooleantruefor invisible reCAPTCHA v2 (the widget hasdata-size="invisible"and shows only a badge). Defaultfalse.recaptchaDataSValuestring- The
data-svalue if the page passes one (some Google services do). Up to 4096 characters. pageActionstring- The action the page passes to
grecaptcha.execute(sitekey, {action: …}), e.g.login. Up to 128 characters. minScorenumber- Minimum score of the token from 0 to 1, usually
0.3,0.7or0.9. enterprisePayloadobject- Extra parameters of
grecaptcha.enterprise.render/execute, e.g.{"s": "…"}, up to 8 KiB of JSON. IfrecaptchaDataSValueorpageActionis empty, thesandactionkeys are used instead. isEnterpriseboolean- Compatibility flag of Anti-Captcha clients:
trueturns a regular reCAPTCHA type into its Enterprise twin (solved and billed as Enterprise). Prefer the Enterprise task types. apiDomainstring- Domain the widget is loaded from:
www.google.com(default) orwww.recaptcha.net. userAgentstring- User-Agent of the browser that will submit the token, up to 512 characters. It is returned in
solution.userAgent. cookiesstring- Cookies of the target site for the solving browser:
name=value; name2=value2, up to 8192 characters. Stored encrypted. proxyTypestringhttp(default),https,socks4orsocks5.proxyAddressstring僅限代理類型- IP address or host name of the proxy. Private and local addresses are rejected.
proxyPortinteger僅限代理類型- Proxy port, 1–65535.
proxyLoginstring- Proxy login, up to 256 characters. Stored encrypted.
proxyPasswordstring- Proxy password, up to 256 characters. Stored encrypted.
Example#
import requests
response = requests.post("https://neurocaptcha.com/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
},
}, timeout=30)
print(response.json())Response#
{
"errorId": 0,
"taskId": 7781
}{
"errorId": 22,
"errorCode": "ERROR_TASK_ABSENT",
"errorDescription": "websiteURL must be an absolute http(s) URL."
}Billing#
- The task price (after your volume discount) is held on
createTask. getBalance shows the balance without held amounts. - The money is charged only when the task becomes
ready. A failed or expired task releases the hold — it costs nothing. - Test keys are free.
- Got a token the site rejected? reportIncorrectRecaptcha within 24 h returns the money.
Limits#
- 30
createTaskper second per key (bursts up to 60) — above itERROR_TOO_MUCH_REQUESTS. - 200 tasks in progress per key (can be changed per key) — above it
ERROR_NO_SLOT_AVAILABLE. - Request body up to 1 MiB.
Errors#
| errorId | errorCode | When |
|---|---|---|
| 1 | ERROR_KEY_DOES_NOT_EXIST | wrong or revoked key |
| 2 | ERROR_NO_SLOT_AVAILABLE | too many tasks of the key in progress |
| 10 | ERROR_ZERO_BALANCE | the available balance is below the task price |
| 11 | ERROR_IP_NOT_ALLOWED | the IP is not in the key's allowlist |
| 14 | ERROR_NO_SUCH_METHOD | the body is not valid JSON |
| 22 | ERROR_TASK_ABSENT | task is missing or a field is invalid — see errorDescription |
| 23 | ERROR_TASK_NOT_SUPPORTED | unknown or disabled task type |
| 55 | ERROR_ACCOUNT_SUSPENDED | the account is suspended |
| 90 | ERROR_INTERNAL | temporary failure, retry |
| 91 | ERROR_TOO_MUCH_REQUESTS | rate limit of the key or IP |
| 92 | ERROR_SPENDING_LIMIT | daily or monthly cap of the key reached |
Try it#
線上測試
從你的瀏覽器送出真實的 createTask 請求,接著每 2 秒呼叫一次 getTaskResult,並原樣顯示 JSON 回應。
請求
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}
}回應
// …