Automated script for solving Yandex coordinate captchas using Puppeteer and 2captcha service.
- โ Automatic captcha image interception (main image + instructions)
- โ Submission for recognition to 2captcha service
- โ Automatic clicks on received coordinates
- โ Works with captcha iframe
- โ Captcha solution confirmation
- Node.js 16+
- npm or yarn
- 2captcha.com API key
- Clone the repository
git clone <repository-url>
cd yandex-captcha-solver- Install dependencies
npm install puppeteer 2captcha-ts dotenv- Create
.envfile
API_KEY=your_2captcha_api_key_here
- Get API key
- Register at 2captcha.com
- Get your API key from user dashboard
- Add it to
.envfile
npm startor
node index.jsScript automatically intercepts requests to smartcaptcha.yandexcloud.net and saves:
img.png- main captcha imagetask.png- instruction image
Images are sent to 2captcha with coordinates type:
const anser = await solver.coordinates({
body: imageBase64,
imginstructions: taskBase64,
})2captcha returns an array of coordinates for clicks:
[
{ x: '254', y: '99' },
{ x: '173', y: '126' },
{ x: '273', y: '35' },
{ x: '74', y: '131' }
]Script clicks on each coordinate inside captcha iframe:
- Finds iframe with captcha
- Calculates absolute coordinates on page
- Executes clicks with pauses between them
- Confirms the solution
const browser = await puppeteer.launch({
headless: false,
defaultViewport: { width: 1280, height: 920 },
args: ['--window-size=1280,920']
});await delay(500); // 500ms between clicks- Captcha iframe:
'iframe[data-testid="advanced-iframe"]' - Image:
'.AdvancedCaptcha-ImageWrapper img' - Confirm button:
'.CaptchaButton-ProgressWrapper'
yandex-captcha-solver/
โโโ index.js # Main script
โโโ temp/ # Folder with saved images
โ โโโ img.png # Main captcha image
โ โโโ task.png # Captcha instructions
โโโ .env # Environment variables
โโโ package.json # Project dependencies
โโโ README.md # Documentation
Executes clicks on all received coordinates with pauses between them.
Executes one click at relative coordinates inside iframe.
Reads image from temp folder and converts to base64.
// 1. Image interception happens automatically
// 2. Getting coordinates from 2captcha
const coordinates = await solver.coordinates({
body: imageBase64,
imginstructions: taskBase64,
});
// 3. Clicks on all coordinates
await clickAllCoordinates(
page,
'iframe[data-testid="advanced-iframe"]',
'.AdvancedCaptcha-ImageWrapper img',
coordinates.data
);
// 4. Solution confirmation
await clickInIframeRelativeToElement(
page,
'iframe[data-testid="advanced-iframe"]',
'.CaptchaButton-ProgressWrapper',
5, 5
);- Coordinates from 2captcha come relative to captcha image
- Script automatically calculates absolute coordinates on page
- Make sure to wait for complete iframe loading before clicking
- Use real API key from 2captcha for it to work
- Images are saved to
temp/folder - Coordinates are displayed in console
- Browser runs in visible mode (
headless: false) - All clicks are logged with coordinates
- Solving one coordinate captcha: ~$0.003
- 1000 captchas: ~$3
This project was created for educational purposes only. Use responsibly and in accordance with website terms of service.