PiratProxies

Captcha solvers

2Captcha with your own proxy

2Captcha is a long-running captcha solving service with a simple HTTP API. Its newer API takes a task as JSON, and a task can carry your own proxy.

What a proxy does for 2Captcha

Many sites tie a captcha token to the IP address that asked for it. If the service solves from its own address and you submit from yours, the token can be refused. Passing your proxy to the service makes both come from one address.

The right proxy type for 2Captcha

Use a residential proxy with a sticky session, and use the very same username in your own client. Mobile proxies work the same way where a site expects phone traffic.

The values to enter in 2Captcha

Every PiratProxies plan comes down to four values: host, port, username and password. Here they are for Residential; your own username and password are on your plan page.

Hostresi.piratproxies.com
HTTP port8080
SOCKS5 port1080
UsernameUSERNAME
Passwordshown on your plan page

There is no separate country or session field: both are part of the username. Your plan page has a generator that writes it, and Targeting and sessions describes each piece.

Setting it up in 2Captcha

  1. Choose the version of the task that takes a proxy. The ones ending in Proxyless use 2Captcha's own IP addresses instead.
  2. Fill in proxyType, proxyAddress, proxyPort, proxyLogin and proxyPassword in the task.
  3. Send your own request, the one that submits the token, through the same proxy with the same sticky username.

Code: 2Captcha through a proxy

The proxy part of a task

curl -s https://api.2captcha.com/createTask -H "Content-Type: application/json" -d '{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "RecaptchaV2Task",
    "websiteURL": "https://example.com/login",
    "websiteKey": "SITE_KEY",
    "proxyType": "http",
    "proxyAddress": "resi.piratproxies.com",
    "proxyPort": 8080,
    "proxyLogin": "USERNAME-country-us-time-600-session-a1b2c3d4",
    "proxyPassword": "PASSWORD"
  }
}'

Put your own login from the plan page in place of USERNAME and PASSWORD. The example calls an IP-check service, so what it prints is the address your request came from.

Should 2Captcha rotate IPs or keep one?

Use a sticky session and hand 2Captcha the very same username your own requests use: the session ID in it is what puts both on one IP address. If the username rotates, the token gets solved from one address and submitted from another, and sites that compare the two will refuse it.

Here is what a sticky username looks like:

USERNAME-country-us-time-600-session-a1b2c3d4

When 2Captcha will not connect

  • The older in.php endpoint takes the proxy as proxy=USERNAME:PASSWORD@resi.piratproxies.com:8080 together with proxytype=HTTP.
  • If a task fails with a proxy error, test the same line with curl first. A proxy that works in curl and fails in the task usually has a typing mistake in one field.
  • Error 407 means the login was refused. Copy the username and password from your plan page once more, and make sure no space crept in and the username was not cut short.
  • An IP in the wrong country nearly always comes from the username, since the country code lives there. Other fixes.

2Captcha and proxies: questions

Do I always need my own proxy with 2Captcha?

No. Proxyless tasks are solved from 2Captcha's own addresses and are enough for many sites. Pass your proxy when a site rejects tokens that were solved from a different IP address.

Which PiratProxies plan suits 2Captcha best?

Use a residential proxy with a sticky session, and use the very same username in your own client. Mobile proxies work the same way where a site expects phone traffic.

Words used in this guide: captcha, captcha solver, sticky session, ip reputation.

2Captcha belongs to its own developers, and PiratProxies has no connection with them; we name it only to say what this guide covers. Follow the rules of the sites you visit and our acceptable use policy.