Captcha bypass tutorials

How to bypass vk captcha

Introduction

VKontakte (VK) uses a multi-layered protection system against automated requests, with captcha being a key component. Initially, verification followed the classic "image + text input" pattern, but recent updates have fully transitioned the platform to a token-based model. Now, successful completion depends not only on the recognized answer but also on the correctness of transmitted parameters, browser fingerprints, and session state.

In this guide, we'll cover two solving methods: token-based and image-based. We'll also walk through the current technical integration stack: from extracting required parameters in the browser to forming correct API requests and handling responses. You'll learn which data is essential for passing verification, how to properly configure proxies and User-Agents, and get code examples plus a troubleshooting table for quick debugging.


What's Changed

Before After
session_token was sufficient Full redirectUri is now required
Token valid for ~3 minutes Validity depends on session, but freshness of redirectUri is critical
Any User-Agent could be used Requires an up-to-date User-Agent matching the browser

Preparation: Required Parameters

Property Required Description
type Yes Task type: VKCaptchaTask
redirectUri Yes Full URL returned in response to VK captcha API requests. Contains all necessary session parameters
userAgent Yes Browser User-Agent string that will be used when loading and solving the captcha. Must match the one used when obtaining redirectUri
proxyType Yes Proxy type: http, https, or socks5
proxyAddress Yes Proxy server IP address or hostname
proxyPort Yes Proxy server port (e.g., 8080)
proxyLogin Yes Login for proxy server authentication
proxyPassword Yes Password for proxy server authentication

Step-by-Step Instructions: Solving via redirectUri

Step 1: Obtain redirectUri

  1. Open DevTools (F12) → Network tab
  2. Enable Preserve log (to prevent logs from clearing during navigation)
  3. Perform an action that triggers captcha (login, like, sending a message)
  4. Find a request containing:
    • captcha
    • not_robot
    • id.vk.com
    • success_token
  5. Copy the full URL from the Request URL column

Example redirectUri:

Copy
https://id.vk.com/not_robot_captcha?domain=vk.com&session_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&variant=popup&blank=1&adFp=xyz123

Do not extract individual parameters — send the entire URL as-is.

Step 2: Submit Task for Solving

Task creation endpoint: https://api.2captcha.com/createTask

Example request (JSON):

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "VKCaptchaTask",
    "redirectUri": "https://id.vk.com/not_robot_captcha?domain=vk.com&session_token=eyJ...&variant=popup&blank=1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
    "proxyType": "http",
    "proxyAddress": "192.168.1.1",
    "proxyPort": 8080,
    "proxyLogin": "login",
    "proxyPassword": "password"
  }
}

Step 3: Receive Task ID

You'll receive a response like:

json Copy
{
  "errorId": 0,
  "taskId": "1234567890"
}

Save the taskId for status polling.

Step 4: Request the Result

Result retrieval endpoint: https://api.2captcha.com/getTaskResult

Request:

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "taskId": "1234567890"
}

Successful response:

json Copy
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

Step 5: Use the Token

Add the received token to your original VK request:

json Copy
{
  "login": "your_login",
  "password": "your_password",
  "captcha_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Token is valid for ~3-5 minutes — use it immediately!


Python Example

python Copy
# To trigger captcha: run script multiple times or attempt login manually several times
import os
import time
from pprint import pprint
import requests
from selenium.webdriver.common.by import By
from seleniumbase import SB
from actual_proxy import *

url = "https://vk.com/"
proxy = proxy_russia  # proxy format: "LOGIN:PASSWORD@ADDRESS:PORT"
login = '1053893238'
my_key = os.environ["APIKEY"]

agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"

with SB(uc=False,
        proxy=proxy,
        locale_code='en',
        # devtools=True,
        # incognito=True
        ) as sb:
    sb.set_window_position(0, 0)
    sb.set_window_size(1000, 800)
    sb.open(url)
    sb.click('#START_QR_PAGE > div > div.vkuiPanel__centered > div > button:nth-child(8) > span')
    
    try:
        sb.click("#ENTER_LOGIN_PAGE > div > form > div.PhoneMaskBuilder-module_phoneMaskBuilder__Xhp8T > div.vkuiSegmentedControl__host.vkuiSegmentedControl__sizeL.vkuiRootComponent__host > div > label:nth-child(3)")
    except:
        time.sleep(10)

    sb.type('input[name="login"]', login)
    sb.click('#ENTER_LOGIN_PAGE > div > form > button.vkuiInternalTappable.vkuiButton__host.vkuiButton__sizeL.vkuiButton__modePrimary.vkuiButton__appearanceAccent.vkuiButton__stretched.vkuiTappable__host.vkuiTappable__hasPointerNone.vkuiClickable__host.vkuiClickable__realClickable.vkuistyles__-focus-visible.vkuiRootComponent__host > span')
    time.sleep(10)
    
    frame = sb.find_element(By.TAG_NAME, 'iframe', timeout=30)
    print("Captcha detected")
    sb.switch_to_frame(frame)
    
    # ⚠️ Note: This example uses sessionToken (legacy). 
    # For production, use redirectUri instead:
    # redirect_uri = sb.execute_script('return window.location.href')
    
    token_sess = sb.execute_script('return window.init.data.session_token')
    print('token_session:', token_sess)
    print("Waiting for solution...")
    
    data = {
        "clientKey": my_key,
        "task": {
            "type": "VKCaptchaTask",
            "userAgent": agent,
            "sessionToken": token_sess,  # ← Legacy parameter
            "proxyType": "HTTP",
            "proxyAddress": proxy.split('@')[1].split(':')[0],
            "proxyPort": proxy.split('@')[1].split(':')[1],
            "proxyLogin": proxy.split('@')[0].split(':')[0],
            "proxyPassword": proxy.split('@')[0].split(':')[1]
        }
    }
    
    response = requests.post("https://api.2captcha.com/createTask", json=data).json()
    print(response)
    
    if response['errorId'] == 0:
        time.sleep(20)
        data = {
            "clientKey": my_key,
            "taskId": response['taskId']
        }
        result = requests.post(f"https://api.2captcha.com/getTaskResult", json=data).json()
        pprint(result)

Alternative Method: Image-Based Solving (Kaleidoscope Captcha Only)

If the token-based redirectUri method doesn't fit your use case, you can use the classic approach: solving captcha via image with user action emulation.

How It Works

  1. Click the checkbox — after interacting with the captcha widget, an image loads: a set of pictures in kaleidoscope format.
  2. Extract data — two parameters are required for solving:
    • image — original captcha image in base64 format
    • steps — permutation scheme that comes with the captcha
  3. Processing on our side — our workers assemble the image in the correct order and return a scheme with the correct steps.
  4. Apply the response — you send the received scheme back in your request to VK.

Where to Get Parameters

Both values (image and steps) are found in the response to the captcha widget loading request:

Copy
https://api.vk.com/method/captchaNotRobot.getContent?v={API_VER}

In the API response, look for:

  • captcha_image or similar — contains the image in base64
  • steps — array of numbers describing the element permutation order

Example Solve Request

json Copy
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "VKCaptchaImageTask",
    "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "steps": [5,19,14,14,6,4,8,9,23,23,14,23,3,13,16,8,2,4,6,16,1,1,3,12,23,18,12,24,17,7,6,22,2,4,0,22,3,18,11,5,4,5,6,14,22,21,6,10,0,3,14,18,19,2,24,0,3,23,9,21,5,24,21,0,4,15,14,21,8,5,17,19,12,19,15,17,21,11,8,4,15,0,18,16,19,4,19,20,21,22,16,10,20,12,19,5,23,24,8]
  }
}

Response and Applying the Result

After processing, you'll receive an action scheme to include in your original VK request as the captcha_key parameter, or in the format expected by the captchaNotRobot.check method.


Error Handling and Request Rate Recommendations

Controlling Attempt Count

If you receive 2-3 consecutive errors (e.g., ERROR_CAPTCHA_UNSOLVABLE) when calling the API:

  1. Switch VK accounts — the platform may temporarily restrict an account suspected of automation. Even with correct technical implementation, frequent requests can trigger protection mechanisms.

  2. Take a break — let the current account "rest" for 15-30 minutes before retrying. This reduces the risk of prolonged blocking.

  3. Verify request parameters — ensure redirectUri is fresh, userAgent matches the browser, and the proxy is stable.

Intervals Between Requests

Due to increased complexity of VK's verification algorithms, captcha solving now takes longer. To avoid errors and timeouts:

  • Poll task status every 10 seconds — this is sufficient to receive results without creating excessive load.
  • Don't submit new tasks too frequently — if working in a loop, add delays between iterations (minimum 5-10 seconds).
  • Use exponential backoff for retries — if a request fails, increase the interval before the next attempt.

💡 Practical tip: If processing captchas in bulk or in a stream, implement a task queue with rate limiting.


Key Takeaways:

  • Captcha solving success depends on multiple factors: fresh redirectUri, correct User-Agent, quality proxy, and proper request sequence.
  • Even with perfect technical implementation, always include error handling and retry mechanisms — VK's protection system can change without notice.

Captcha bypass integration is not a one-time setup but an ongoing process requiring monitoring and adaptation. If you're building a stable solution, include logging, alerts for error spikes, and the ability to quickly update request parameters.


Conclusion

VKontakte continuously improves its protection mechanisms, and today's captcha is a complex, multi-factor tool that analyzes not only the user's response but also request context: browser fingerprints, behavioral patterns, network parameters, and session state.

We hope this guide helps you implement a reliable integration and save time on debugging.