Was this helpful?
How to solve GeeTest v4 on Avito.ru
Technical engineer
Introduction
This guide is for developers who are automating work with Avito.ru and encountering GeeTest v4 captcha. We will show you how to get the required parameters from the page, send a task to 2Captcha, and correctly pass the solution to the Avito server.
What you will need:
- API key from your 2Captcha account dashboard
- Understanding of HTTP and JSON
- A proxy matching the target region
- Debugging tools: browser with DevTools, curl, or Postman
General Information
Avito.ru uses GeeTest v4 protection in slider format. The captcha appears during suspicious activity: frequent requests, missing cookies, or non-standard headers.
To pass it successfully, you need to:
- Get the
captcha_idfrom the Avito page (a fixed value) - Send a task to 2Captcha with
version: 4specified - Receive a solution with four fields:
lot_number,pass_token,gen_time,captcha_output - Pass these data to the Avito verification endpoint with correct headers and cookies
Environment Setup
Before you start:
- Get your API key in the 2Captcha account dashboard
- Make sure the target page on Avito is accessible and shows the captcha when needed
- Store the key in an environment variable, not in your code
Analyzing the Avito Page
Finding the captcha_id
- Open DevTools (F12) on the Avito page where the captcha appears
- Go to the Elements tab
- Find the element with the
data-geetestattribute:
html
<div class="geetest_widget" data-geetest="2d9c743cf7d63dbc9db578a608196bcd"></div>
The value 2d9c743cf7d63dbc9db578a608196bcd is the captcha_id for Avito. It is constant for the entire domain.
Key Network Requests
In the Network tab, filter requests by firewallCaptcha. You will need:
- Verification endpoint:
https://www.avito.ru/web/1/firewallCaptcha/verify - Method:
POST - Content-Type:
application/json
Also pay attention to the request headers, especially:
User-AgentRefererOriginCookie
You must reproduce these when sending the solution.
Implementation
Step 1. Creating a Task in 2Captcha
Send a POST request to https://api.2captcha.com/createTask:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "GeeTestTaskProxyless",
"websiteURL": "https://www.avito.ru/moskva/kvartiry/prodam",
"version": 4,
"initParameters": {
"captcha_id": "2d9c743cf7d63dbc9db578a608196bcd"
}
}
}
Step 2. Using a Proxy (Optional)
If you manage proxies yourself, change the task type to GeeTestTask and add parameters:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "GeeTestTask",
"websiteURL": "https://www.avito.ru/moskva/kvartiry/prodam",
"version": 4,
"initParameters": {
"captcha_id": "2d9c743cf7d63dbc9db578a608196bcd"
},
"proxyType": "http",
"proxyAddress": "1.2.3.4",
"proxyPort": 8080,
"proxyLogin": "user",
"proxyPassword": "pass"
}
}
Step 3. Getting the Solution
Poll https://api.2captcha.com/getTaskResult with the taskId parameter until the status becomes ready.
Example response:
json
{
"errorId": 0,
"status": "ready",
"solution": {
"captcha_id": "2d9c743cf7d63dbc9db578a608196bcd",
"lot_number": "e6c3bed2854f41f880662c48afff5dcb",
"pass_token": "fad5eb52fc83bf7617402fcccfb211a21e0aa1d1044",
"gen_time": "1693924478",
"captcha_output": "fN36ufW6cQN4SQ-JRDQC70nSq9UcQBg=="
}
}
Step 4. Sending the Solution to Avito
Form a POST request to https://www.avito.ru/web/1/firewallCaptcha/verify:
json
{
"captcha_id": "2d9c743cf7d63dbc9db578a608196bcd",
"lot_number": "e6c3bed2854f41f880662c48afff5dcb",
"pass_token": "fad5eb52fc83bf7617402fcccfb211a21e0aa1d1044",
"gen_time": "1693924478",
"captcha_output": "fN36ufW6cQN4SQ-JRDQC70nSq9UcQBg=="
}
Required conditions:
- Headers
User-Agent,Referer,Originmust match the browser session - Cookies must be current and obtained from the same session
- Request method must be
POST,Content-Type: application/json
Example headers:
http
POST /web/1/firewallCaptcha/verify HTTP/1.1
Host: www.avito.ru
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
Referer: https://www.avito.ru/moskva/kvartiry/prodam
Origin: https://www.avito.ru
Cookie: srv_id=...; u=...; v=...
Integration Notes
Why These Specific Parameters
Avito uses a fixed captcha_id for the entire domain. This simplifies integration: you do not need to extract the value dynamically on every run.
The four solution fields (lot_number, pass_token, gen_time, captcha_output) are generated by the GeeTest server after successfully completing the interactive task. Without any of them, verification on the Avito side will fail.
Error Handling
If the response from /firewallCaptcha/verify contains "verified": false, check:
- Whether all solution fields were passed
- Whether headers and cookies match the browser session
- Whether the tokens have expired (they are single-use)
If errors persist, increase the pause between receiving the solution and sending it, sometimes session synchronization takes time.
Common Errors
| Error | Cause | Solution |
|---|---|---|
verified: false from Avito |
One of the four solution fields is missing | Check that lot_number, pass_token, gen_time, captcha_output are present |
| Captcha does not appear | No triggers for protection to show | Emulate user behavior: delays, real headers, cookies |
| Timeout when polling result | Slow solving or queue | Increase polling interval to 10 seconds, set client timeout |
| IP blocking | Frequent requests from one address | Use residential proxies with Russian IP, add pauses |
| Header mismatch | Request headers differ from browser ones | Copy User-Agent, Referer, Origin from DevTools |
Additional Resources
- 2Captcha Sandbox - test API without code
- GeeTest API Documentation - method specification
- Request Examples on GitHub - ready JSON templates
- 2Captcha Support - help with integration
Checklist
- API key obtained and verified from 2Captcha account dashboard
- Confirmed
captcha_idfor Avito:2d9c743cf7d63dbc9db578a608196bcd - Task specifies
version: 4andinitParameterswithcaptcha_id -
websiteURLmatches the actual page with captcha on Avito - Proxy with Russian IP configured if needed
- Polling
getTaskResultimplemented until statusready - Solution contains all fields:
lot_number,pass_token,gen_time,captcha_output - Verification request to Avito includes current cookies and headers from browser session
- Tested in sandbox before production launch
Conclusion
To pass GeeTest v4 on Avito.ru, it is enough to send a task to 2Captcha with the fixed captcha_id and version: 4, then pass the received solution to the verification endpoint with correct headers and cookies.
The key to stable operation is accurately reproducing the browser session and using a proxy matching the target region. Before launching in production, be sure to test the integration in the sandbox and check against the checklist.
Follow Avito's terms of use and do not overload the service with requests, this will help avoid blocks and ensure long-term stability of your integration.