Use the proxy that actually solved the task

By solvethree2 min read

When you send proxyCandidates, use solution.egressAttempts to find the proxy that solved the task. It's a one-based index into the original candidate list. Use that proxy when you submit the solution to the target—not another proxy from the list.

On this page

Keep the original candidate list

Supply exactly one of proxy or proxyCandidates. A candidate list accepts at most six distinct HTTP or HTTPS proxy URLs, without a path, query, or fragment. Keep the original request and candidate order until you've selected the winning proxy; sorting or filtering the list afterward changes what the index points to.

Candidates let solvethree try alternative egress; they don't guarantee that a proxy or target will work. Session tasks require a single proxy, not a candidate list.

Validate the index before selecting a proxy

For reCAPTCHA, Kasada and TMPT, solution.egressAttempts identifies the successful candidate. Accept it only if it's an integer from 1 through the original array length. Subtract one when indexing a JavaScript array or Python list.

Illustrative result: a ready task returns egressAttempts equal to 2.
Illustrative result: a ready task returns egressAttempts equal to 2.
Original positionCandidateSelected
1PROXY_ANo
2PROXY_BYes
3PROXY_CNo

Here, the winner is the second proxy, PROXY_B, at array offset 1. If the index is missing, fractional, zero, or outside the list, stop. Don't substitute the first proxy or infer a winner from the list order.

Use the SDK helper, then reuse the selected proxy

Pass the original task and ready result to JavaScript's successfulProxy or Python's successful_proxy. The examples call solve to create the task and poll until it's ready or an error is raised, then stop if the helper doesn't return a proxy.

Set SOLVETHREE_API_KEY and the three proxy environment variables on your server. Each proxy variable must contain a distinct valid proxy URL. Replace the example site and action with your intended target and action. The examples require Node.js 22+ or Python 3.10+.

Node.js · select the winning proxy
import { Solvethree, successfulProxy } from '@solvethree/sdk';

const client = new Solvethree({ apiKey: process.env.SOLVETHREE_API_KEY });
const request = {
  site: 'accounts.example.com', action: 'login',
  proxyCandidates: [process.env.PROXY_A, process.env.PROXY_B, process.env.PROXY_C],
};
const result = await client.solve(request);
const proxy = successfulProxy(request, result);
if (!proxy) throw new Error('No valid winning proxy index; do not guess');
// For egressAttempts: 2, proxy is request.proxyCandidates[1].
// Submit result.solution through this proxy with its returned browser identity.

Keep the selected proxy together with the returned userAgent, secChUa and intended target, and use that identity for the target request. The SDK selects the proxy; it doesn't configure your browser or submit the solution for you. A ready solution isn't proof that the target accepted it.

Run your first task.

Start with $5 in workspace credit.

Create a workspace