2Captcha compatibility
in.php and res.php for 2Captcha and RuCaptcha clients: parameters, answers, task type mapping and error codes.
Phần này được hiển thị bằng tiếng Anh.
Trên trang này
in.php and res.php take the same keys and create the same tasks as the JSON API. Use GET or POST (query string or form fields). The answer is plain text, or JSON with json=1; the HTTP status is always 200.
in.php — create a task#
Tham sốMô tả
keystringbắt buộc- Your API key.
methodstringbắt buộcuserrecaptcha.googlekeystringbắt buộc- Site key (
websiteKey). pageurlstringbắt buộc- Page address (
websiteURL). versionstringv3for reCAPTCHA v3.enterprisestring1for reCAPTCHA Enterprise.invisiblestring1for invisible reCAPTCHA v2.actionstring- v3 action (
pageAction). min_scorenumber- Minimum v3 score (
minScore). data-sstringrecaptchaDataSValue.userAgentstring- User-Agent of your browser.
cookiesstringKEY:Value;KEY2:Value2(converted toKEY=Value; KEY2=Value2).domainstringgoogle.comorrecaptcha.net.proxystringlogin:password@host:portorhost:port.proxytypestringHTTP,HTTPS,SOCKS4orSOCKS5.soft_idinteger- Developer program id (
softId). pingbackstring- Webhook URL (
callbackUrl), see Webhooks. jsonstring1— answer in JSON.header_acaostring1— addAccess-Control-Allow-Origin: *to the answer.
curl -s "https://neurocaptcha.com/in.php?key=YOUR_API_KEY&method=userrecaptcha&googlekey=6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-&pageurl=https://www.google.com/recaptcha/api2/demo"
# → OK|7781
curl -s "https://neurocaptcha.com/in.php?key=YOUR_API_KEY&method=userrecaptcha&googlekey=6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-&pageurl=https://www.google.com/recaptcha/api2/demo&json=1"
# → {"request":"7781","status":1}Which task type is created#
| version | enterprise | proxy | Task type |
|---|---|---|---|
| — | — | — | RecaptchaV2TaskProxyless |
| — | — | yes | RecaptchaV2Task |
| — | 1 | — | RecaptchaV2EnterpriseTaskProxyless |
| — | 1 | yes | RecaptchaV2EnterpriseTask |
v3 | — | any | RecaptchaV3TaskProxyless (proxy ignored) |
v3 | 1 | — | RecaptchaV3EnterpriseTaskProxyless |
v3 | 1 | yes | RecaptchaV3EnterpriseTask |
res.php — results, balance, reports#
| action | Parameters | Answer |
|---|---|---|
get | id | OK|<token> or CAPCHA_NOT_READY; with json=1: {"request":"<token>","status":1,"useragent":"…"} |
get | ids=1,2,3 (up to 100) | answers in the same order, joined by |: <token>|CAPCHA_NOT_READY|ERROR_… |
get2 | id | OK|<token>|<cost>; with json=1 the cost is in price |
getbalance | — | balance in USD, e.g. 12.3456 |
reportbad, reportgood | id | OK_REPORT_RECORDED — same rules as reports |
curl -s "https://neurocaptcha.com/res.php?key=YOUR_API_KEY&action=get&id=7781"
# → CAPCHA_NOT_READY, then OK|03AFcWeA6Z3vq0VhGm1oS8r0bAxKk4…
curl -s "https://neurocaptcha.com/res.php?key=YOUR_API_KEY&action=getbalance&json=1"
# → {"request":"12.3456","status":1}Poll res.php every 2–3 seconds; the token is kept for the same time as in the JSON API.
Error codes#
Errors come as text (ERROR_…) or as {"request":"ERROR_…","status":0} with json=1. Some JSON-API codes get their 2Captcha names:
| JSON API | in.php / res.php |
|---|---|
ERROR_NO_SUCH_CAPCHA_ID | ERROR_WRONG_CAPTCHA_ID |
ERROR_TASK_ABSENT, ERROR_TASK_NOT_SUPPORTED, ERROR_NO_SUCH_METHOD | ERROR_BAD_PARAMETERS |
ERROR_RECAPTCHA_TIMEOUT | ERROR_CAPTCHA_UNSOLVABLE |
ERROR_PROXY_CONNECT_REFUSED, ERROR_PROXY_CONNECT_TIMEOUT, ERROR_PROXY_READ_TIMEOUT, ERROR_PROXY_BANNED, ERROR_PROXY_NOT_AUTHORISED | ERROR_PROXY_CONNECTION_FAILED |
ERROR_INTERNAL | ERROR_INTERNAL_SERVER_ERROR |
| Code | When |
|---|---|
ERROR_WRONG_USER_KEY | key is empty |
ERROR_BAD_PARAMETERS | method is not userrecaptcha, unknown action, more than 100 ids |
ERROR_GOOGLEKEY | googlekey is missing |
ERROR_PAGEURL | pageurl is missing |
ERROR_BAD_PROXY | proxy or proxytype cannot be parsed |
ERROR_WRONG_CAPTCHA_ID | id is not a positive number, or there is no such task |
Other codes (ERROR_KEY_DOES_NOT_EXIST, ERROR_ZERO_BALANCE, ERROR_NO_SLOT_AVAILABLE, ERROR_TOO_MUCH_REQUESTS, ERROR_CAPTCHA_UNSOLVABLE…) are passed as they are — see Errors.