CAPTCHA basics
How to move an in.php client to GateSolver
Programs built on the in.php and res.php interface can switch to GateSolver by changing one address. This guide covers that change, the methods available, the json=1 option and a careful way to test before moving real traffic.
What stays the same
The in.php interface is a simple, form-style protocol that many older tools and libraries speak: you send the challenge to in.php, get an id back, and ask res.php for the answer until it is ready. GateSolver accepts that protocol at https://gatesolver.com/in.php and https://gatesolver.com/res.php. Your request parameters, your polling loop and your answer handling stay as they are; only the host changes, plus your API key.
Behind the compatible endpoints, the same AI models solve the task, the same prepaid balance pays for it, and the same rules apply: charged only when solved, free when failed, 600 requests per minute per key.
Check that your methods are supported
The compatible interface accepts these method values:
| method | Challenge | Equivalent task type |
|---|---|---|
| userrecaptcha | reCAPTCHA v2 checkbox | a ReCaptchaV2TaskProxyLess task |
| turnstile | Cloudflare Turnstile | a AntiTurnstileTaskProxyLess task |
| geetest, geetest_v4 | GeeTest v3 and v4 | a GeeTestTaskProxyLess task |
| base64 | Text image sent as base64 | an ImageToTextTask with body |
| post | Text image sent as a file upload | the same image task |
Search your code for every method= value it sends. If you find anything outside this list, such as reCAPTCHA v3, an Enterprise variant, AWS WAF or a full-page Cloudflare check, that part of your client needs the JSON API instead. The createTask migration guide covers that route, and both interfaces can run side by side on the same key.
Change the base URL
Most clients keep the host in one constant, an environment variable or a library option often called something like server, host or domain. Replace it, keep the paths, and put your GateSolver API key where the old key was. Create the key in your account first; it is shown once, so store it right away.
export CAPTCHA_HOST="https://gatesolver.com"
export CAPTCHA_KEY="YOUR_API_KEY"
If the host is hard-coded in several places, this is a good moment to move it into configuration so the next change is a one-line edit. Watch for full URLs that include the old host inside string templates, and for tests that mock the old domain.
Turn on json=1
By default, replies are plain text: OK| followed by the id or the answer, CAPCHA_NOT_READY while the task is running, or an error text. Adding json=1 to each request returns the same information as JSON, shaped like {"status":1,"request":"..."}. A status of 1 means the request field holds the id or the answer; otherwise request holds the reason.
import time, os, requests
HOST = os.environ["CAPTCHA_HOST"]
KEY = os.environ["CAPTCHA_KEY"]
sent = requests.get(f"{HOST}/in.php", timeout=30, params={
"key": KEY, "method": "userrecaptcha", "json": 1,
"googlekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"pageurl": "https://www.google.com/recaptcha/api2/demo"}).json()
if sent["status"] != 1:
raise SystemExit(f"rejected: {sent['request']}")
for _ in range(40):
time.sleep(3)
got = requests.get(f"{HOST}/res.php", timeout=30, params={
"key": KEY, "action": "get", "id": sent["request"], "json": 1}).json()
if got["request"] != "CAPCHA_NOT_READY":
break
print("status", got["status"], "answer starts", str(got["request"])[:16])
Parsing JSON is sturdier than splitting on the pipe character, and it removes a class of bugs where an answer itself contains unexpected characters. If your client already parses text replies correctly, json=1 is optional.
Check the balance first
Before sending real tasks, confirm that the host, key and network path work with the cheapest possible call:
curl -s "https://gatesolver.com/res.php?key=YOUR_API_KEY&action=getbalance"
A number in reply means the key is valid and you are talking to the right server. An error here is almost always the key: check for stray spaces, an old key, or a key created before the last replacement. Top up from $40 if the balance is zero.
Test one task of each method
Run a single task for each method your client uses, against a page you control or a public demo page, and confirm three things: the id comes back, the answer arrives within a normal time, and the target page accepts it. For images, use a few samples of the real style you see, since the text style affects recognition. Polling every three seconds for token methods and about once a second for images keeps you well under the rate limit.
Move traffic gradually
If the client serves a production job, switch a share of traffic first. Run, say, one worker on the new host while the others continue, compare answer times and acceptance on the target site for a day, then move the rest. Because the protocol is identical, rollback is the same one-line change in reverse.
Things to adjust after the move
- Features outside the documented set. The documented
res.phpactions aregetandgetbalance. If your library calls other actions, such as reporting answers or reading statistics, turn those features off. - Callbacks. Results are delivered by polling only. If your client registers a URL to receive answers, disable that option and rely on the res.php loop.
- Timeouts. Tasks still unsolved after 120 seconds are failed and free; set your loop's deadline a little above that.
- Error text. The in.php endpoints answer with the classic reply words:
ERROR_WRONG_USER_KEYfor a bad key,ERROR_ZERO_BALANCE,ERROR_BAD_PARAMETERSfor missing or unsupported fields,ERROR_NO_SLOT_AVAILABLEwhen you should retry shortly,ERROR_CAPTCHA_UNSOLVABLE, andERROR_WRONG_CAPTCHA_IDfor an unknown id. Match on those in in.php code; the JSON methods use the codes in the error handling guide.
Keep the old configuration nearby
Leave the previous host and key in your configuration history, not in active code, until the move has run cleanly for a while. If something unexpected appears, such as an image style that recognizes poorly, you can compare quickly. Once you are satisfied, delete the old values so nobody routes traffic to them by mistake.
When to move on to createTask
The compatible interface is ideal for keeping old code running. New features and the full set of fourteen types live on the JSON API, so plan to move once you need any type outside the list above, or once you touch the client for other reasons anyway.
Common questions
Which in.php methods does GateSolver accept?
userrecaptcha, turnstile, geetest, geetest_v4, base64 and post. Other types are available only through the JSON createTask API.
Do I have to use json=1?
No. Plain text replies work as before. json=1 returns the same data as JSON, which is easier to parse safely.
How do I check my key works with the compatible interface?
Call res.php with action=getbalance and your key. A number in reply confirms the key and host are correct.
Can I report incorrect answers through res.php?
Only the get and getbalance actions are documented. Disable answer reporting features in your library after the move.
Can old in.php code and new createTask code share one key?
Yes. Both interfaces use the same API key and the same balance, so you can migrate one part at a time.
Keep reading
- API docscreateTask, getTaskResult, getBalance, error codes and the in.php format.
- 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.
- API keyA secret string that authorizes your calls to a service, and the habits that keep it out of code and logs.
- What does ERROR_KEY_DENIED_ACCESS mean?The clientKey you sent is missing or invalid: often a replaced key, a typo or a stray space.