Captcha bypass tutorials

Was this helpful?

How to solve GeeTest v4 on Avito.ru

Kate Push

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:

  1. Get the captcha_id from the Avito page (a fixed value)
  2. Send a task to 2Captcha with version: 4 specified
  3. Receive a solution with four fields: lot_number, pass_token, gen_time, captcha_output
  4. 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

  1. Open DevTools (F12) on the Avito page where the captcha appears
  2. Go to the Elements tab
  3. Find the element with the data-geetest attribute:
html Copy
<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-Agent
  • Referer
  • Origin
  • Cookie

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 Copy
{
  "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 Copy
{
  "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 Copy
{
  "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 Copy
{
  "captcha_id": "2d9c743cf7d63dbc9db578a608196bcd",
  "lot_number": "e6c3bed2854f41f880662c48afff5dcb",
  "pass_token": "fad5eb52fc83bf7617402fcccfb211a21e0aa1d1044",
  "gen_time": "1693924478",
  "captcha_output": "fN36ufW6cQN4SQ-JRDQC70nSq9UcQBg=="
}

Required conditions:

  • Headers User-Agent, Referer, Origin must 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 Copy
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


Checklist

  • API key obtained and verified from 2Captcha account dashboard
  • Confirmed captcha_id for Avito: 2d9c743cf7d63dbc9db578a608196bcd
  • Task specifies version: 4 and initParameters with captcha_id
  • websiteURL matches the actual page with captcha on Avito
  • Proxy with Russian IP configured if needed
  • Polling getTaskResult implemented until status ready
  • 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.