Chat with us, powered by LiveChat
← Return to MyDisct Solver

VK Captcha Token Solving

Solve VKontakte CAPTCHA challenges and obtain valid tokens for VK API integrations and VK-protected web forms. Our solver handles VK's image-based and slider CAPTCHA challenges and returns a verified token ready for submission.

What is VK Captcha?

VKontakte (VK) is Russia's largest social network, and it uses its own proprietary CAPTCHA system to protect API endpoints, login flows, and registration forms. VK CAPTCHA presents image-based challenges or slider puzzles that users must solve to proceed. When integrated with the VK API, the CAPTCHA response is submitted along with the original request to verify human interaction. Our solver completes these challenges and returns a sid value (CAPTCHA session identifier) and a key value (the solved answer) that are passed back to the VK API in the retry request.

Captcha Type

Use the following captcha type identifier in your API requests:

"type": "VK_CAPTCHA_TOKEN"

Request Format

POST /createTask

Request Parameters

Parameter Type Required Description
auth.token string required Your API key
captcha.type string required Must be "VK_CAPTCHA_TOKEN"
captcha.metadata.siteUrl string required The URL of the page or API endpoint where the VK CAPTCHA was triggered
captcha.metadata.siteKey string required The CAPTCHA SID (session identifier) returned by the VK API in the error response. This is the value from the captcha_sid field in the VK API error.
captcha.payload.userAgent string optional Your browser user agent string
captcha.payload.proxy object optional Proxy configuration object
captcha.payload.proxy.protocol string required* Proxy protocol: "http", "https", "socks4", or "socks5"
captcha.payload.proxy.host string required* Proxy IP address or hostname
captcha.payload.proxy.port number required* Proxy port number
captcha.payload.proxy.username string optional Proxy authentication username
captcha.payload.proxy.password string optional Proxy authentication password

* Required only if the parent object (proxy) is provided

VK API CAPTCHA Flow

When a VK API call triggers a CAPTCHA requirement, the API returns an error response with "error_code": 14. This error response includes two fields you need: captcha_sid (the session identifier, which becomes the siteKey in your solver request) and captcha_img (the URL of the CAPTCHA image). After solving, you retry the original API call with two additional parameters: captcha_sid (same SID) and captcha_key (the solved answer from our result).

Example Request

JSON
{
  "auth": {
    "token": "YOUR_API_KEY"
  },
  "context": {
    "source": "api",
    "version": "1.0.0"
  },
  "captcha": {
    "type": "VK_CAPTCHA_TOKEN",
    "metadata": {
      "siteUrl": "https://api.vk.com/method/users.get",
      "siteKey": "3087254496547"
    },
    "payload": {
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
    }
  }
}
JavaScript
const response = await fetch('https://solver-api.mydisct.com/createTask', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'apikey': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    auth: {
      token: 'YOUR_API_KEY'
    },
    context: {
      source: 'api',
      version: '1.0.0'
    },
    captcha: {
      type: 'VK_CAPTCHA_TOKEN',
      metadata: {
        siteUrl: 'https://api.vk.com/method/users.get',
        siteKey: '3087254496547'
      },
      payload: {
        userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
      }
    }
  })
});

const data = await response.json();
console.log('Task ID:', data.task.id);
Python
import requests

response = requests.post(
    'https://solver-api.mydisct.com/createTask',
    headers={
        'Content-Type': 'application/json',
        'apikey': 'YOUR_API_KEY'
    },
    json={
        'auth': {'token': 'YOUR_API_KEY'},
        'context': {'source': 'api', 'version': '1.0.0'},
        'captcha': {
            'type': 'VK_CAPTCHA_TOKEN',
            'metadata': {
                'siteUrl': 'https://api.vk.com/method/users.get',
                'siteKey': '3087254496547'
            },
            'payload': {
                'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
            }
        }
    }
)

data = response.json()
print('Task ID:', data['task']['id'])
cURL
curl -X POST https://solver-api.mydisct.com/createTask \
  -H "Content-Type: application/json" \
  -H "apikey: YOUR_API_KEY" \
  -d '{
    "auth": {"token": "YOUR_API_KEY"},
    "context": {"source": "api", "version": "1.0.0"},
    "captcha": {
      "type": "VK_CAPTCHA_TOKEN",
      "metadata": {
        "siteUrl": "https://api.vk.com/method/users.get",
        "siteKey": "3087254496547"
      },
      "payload": {
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
      }
    }
  }'

Response Format

Create Task Response (Processing)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha task created successfully",
  "task": {
    "id": "MyDisctSolver_abc123",
    "status": "processing"
  }
}

Fetch Result Response (Completed)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "VK captcha solved successfully",
  "task": {
    "id": "MyDisctSolver_abc123",
    "status": "completed",
    "result": {
      "token": "ryBHaBaMlxJjq0TMLodNqw",
      "timestamp": "2025-10-10T12:00:00.000Z"
    }
  }
}
How to Use the VK CAPTCHA Token

The token value in the result is the solved CAPTCHA answer (the captcha_key). When retrying the original VK API call, append both captcha_sid (the same SID you submitted as siteKey) and captcha_key (the token from our result) as additional parameters to the API request URL or request body.

Implementation Guide

Complete VK API Integration

JavaScript
async function solveVKCaptcha(captchaSid, apiKey) {
  const createResponse = await fetch('https://solver-api.mydisct.com/createTask', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'apikey': apiKey
    },
    body: JSON.stringify({
      auth: { token: apiKey },
      context: { source: 'api', version: '1.0.0' },
      captcha: {
        type: 'VK_CAPTCHA_TOKEN',
        metadata: {
          siteUrl: 'https://api.vk.com',
          siteKey: captchaSid
        },
        payload: {
          userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
        }
      }
    })
  });

  const createData = await createResponse.json();
  if (!createData.success) throw new Error(createData.error.message);

  const taskId = createData.task.id;

  while (true) {
    await new Promise(resolve => setTimeout(resolve, 5000));

    const resultResponse = await fetch('https://solver-api.mydisct.com/fetchResult', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'apikey': apiKey
      },
      body: JSON.stringify({ taskId })
    });

    const resultData = await resultResponse.json();
    if (resultData.task.status === 'completed') {
      return resultData.task.result.token;
    } else if (resultData.task.status === 'failed') {
      throw new Error('VK captcha solving failed');
    }
  }
}

async function callVKApiWithCaptchaHandling(method, params, accessToken, apiKey) {
  const baseUrl = `https://api.vk.com/method/${method}`;
  const requestParams = {
    ...params,
    access_token: accessToken,
    v: '5.199'
  };

  const url = new URL(baseUrl);
  Object.entries(requestParams).forEach(([key, value]) => {
    url.searchParams.append(key, value);
  });

  let response = await fetch(url.toString());
  let data = await response.json();

  if (data.error && data.error.error_code === 14) {
    console.log('VK CAPTCHA required, solving...');
    const captchaSid = data.error.captcha_sid;
    const captchaKey = await solveVKCaptcha(captchaSid, apiKey);

    url.searchParams.set('captcha_sid', captchaSid);
    url.searchParams.set('captcha_key', captchaKey);

    response = await fetch(url.toString());
    data = await response.json();
  }

  return data;
}

const result = await callVKApiWithCaptchaHandling(
  'users.get',
  { user_ids: '1', fields: 'photo_200' },
  'YOUR_VK_ACCESS_TOKEN',
  'YOUR_MYDISCT_API_KEY'
);

console.log('VK API result:', result);

Python Implementation

Python
import requests
import time

def solve_vk_captcha(captcha_sid, api_key):
    create_response = requests.post(
        'https://solver-api.mydisct.com/createTask',
        headers={
            'Content-Type': 'application/json',
            'apikey': api_key
        },
        json={
            'auth': {'token': api_key},
            'context': {'source': 'api', 'version': '1.0.0'},
            'captcha': {
                'type': 'VK_CAPTCHA_TOKEN',
                'metadata': {
                    'siteUrl': 'https://api.vk.com',
                    'siteKey': captcha_sid
                },
                'payload': {
                    'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
                }
            }
        }
    )

    create_data = create_response.json()
    if not create_data['success']:
        raise Exception(create_data['error']['message'])

    task_id = create_data['task']['id']

    while True:
        time.sleep(5)

        result_response = requests.post(
            'https://solver-api.mydisct.com/fetchResult',
            headers={
                'Content-Type': 'application/json',
                'apikey': api_key
            },
            json={'taskId': task_id}
        )

        result_data = result_response.json()
        if result_data['task']['status'] == 'completed':
            return result_data['task']['result']['token']
        elif result_data['task']['status'] == 'failed':
            raise Exception('VK captcha solving failed')

        print('Waiting for solution...')

def call_vk_api(method, params, access_token, solver_api_key):
    base_params = {
        **params,
        'access_token': access_token,
        'v': '5.199'
    }

    response = requests.get(
        f'https://api.vk.com/method/{method}',
        params=base_params
    )
    data = response.json()

    if 'error' in data and data['error']['error_code'] == 14:
        print('VK CAPTCHA required, solving...')
        captcha_sid = data['error']['captcha_sid']
        captcha_key = solve_vk_captcha(captcha_sid, solver_api_key)

        base_params['captcha_sid'] = captcha_sid
        base_params['captcha_key'] = captcha_key

        response = requests.get(
            f'https://api.vk.com/method/{method}',
            params=base_params
        )
        data = response.json()

    return data

result = call_vk_api(
    method='users.get',
    params={'user_ids': '1', 'fields': 'photo_200'},
    access_token='YOUR_VK_ACCESS_TOKEN',
    solver_api_key='YOUR_MYDISCT_API_KEY'
)

print(f'VK API result: {result}')

Best Practices

Recommendations
  • Detect Error Code 14: Always check VK API responses for error_code: 14 before assuming a request succeeded
  • Retry with CAPTCHA: When error code 14 is returned, extract captcha_sid, solve with our API, and retry the original request with both captcha_sid and captcha_key appended
  • Use the Same SID: The captcha_sid from the VK error and the captcha_key from our solver must be used together — they are paired
  • Single Retry: After solving, retry the original request only once with the CAPTCHA solution — if it fails again with a new error code 14, solve fresh
  • Polling Interval: Use 5-second polling intervals — VK CAPTCHA solving typically completes in 10 to 20 seconds

Common Issues

Issue: VK API still returns error code 14 after solving

Solution: Verify that both captcha_sid and captcha_key are included in the retry request. The SID must match the original error response exactly, and the key must be the exact token value from our solver result.

Issue: SID appears to expire before the retry

Solution: VK CAPTCHA sessions have a limited validity period. Solve the CAPTCHA and retry the request as quickly as possible after receiving the token. Avoid delays between receiving the solver result and submitting it.