Skip to main content

Getting Started with Lemin CAPTCHA and the CaptchaAI API

Learn how to solve Lemin CAPTCHA instantly using CaptchaAI’s high-accuracy, unlimited, and automated solution.

Written by Irina Dobreva

Lemin is a registration-style CAPTCHA you'll often run into on sign-up and lead-generation flows. It looks like a small puzzle and returns a single token once solved. In this short guide, we'll wire up the CaptchaAI API to handle it from end to end.

What is Lemin?

Lemin captcha is a network-backed verification flow that:

  • Exposes a captcha_id in page scripts or network requests

  • May use a div_id when the captcha lives in a known container

  • Returns a single token string that you submit back to the site

It's commonly seen on registration forms, gated content downloads, and lead-capture pages.

Prerequisites

  1. A CaptchaAI accountsign up at captchaai.com.

  2. Your API key from the dashboard.

  3. A positive balance (or contact support for a free trial).

  4. Python 3 + requests.

Step 1 — Extract the Captcha ID

Lemin doesn't use a "sitekey" in the traditional sense. Instead, look for one of these in the page source, inline scripts, or network requests:

  • captcha_id

  • div_id

  • challenge_id

If the page has a captcha container, also grab the div_id. A typical ID looks like:

12345678-1234-1234-1234-123456789abc

Don't forget to grab the full page URL as well.

Step 2 — Submit the Task to CaptchaAI

Send a GET request to https://ocr.captchaai.com/in.php using the lemin method:

import requests

params = {
'key': 'YOUR_API_KEY',
'method': 'lemin',
'pageurl': 'https://example.com/register',
'captcha_id': '12345678-1234-1234-1234-123456789abc',
'div_id': 'lemin-cropped-captcha', # optional
'json': '1'
}

response = requests.get('https://ocr.captchaai.com/in.php', params=params)
result = response.json()
task_id = result['request']
print('Task ID:', task_id)

You'll get back something like:

{ "status": 1, "request": "74965409378" }

Save the request value — that's your task ID.

Step 3 — Poll for the Solution

Give the solver a few seconds, then poll res.php:

import time, requests

time.sleep(15)

params = {
'key': 'YOUR_API_KEY',
'action': 'get',
'id': task_id,
'json': '1'
}

result = requests.get('https://ocr.captchaai.com/res.php', params=params).json()

if result['status'] == 1:
token = result['request']
print('Token:', token)

The response is a single token string:

{ "status": 1, "request": "lemin-solution-token" }

Step 4 — Submit the Token

Lemin tokens are typically submitted alongside the form's other fields. A typical registration POST might look like:

data = {
'answer': token, # or whatever field name the site uses
'challenge': token,
'username': 'your_user',
'password': 'your_pass',
}

response = requests.post('https://example.com/register', data=data)
print(response.text)

The exact field name (`answer`, `lemin_response`, `captcha_solution`, etc.) depends on the target site — peek at the form's existing fields if you're unsure.

Common Pitfalls

  • Reusing an old captcha_id → Captcha IDs are single-use. Always grab a fresh one from the current session.

  • Mismatched pageurl → Lemin binds the solution to the page URL. Make sure they match exactly.

  • CAPCHA_NOT_READY → Solver is still working. Wait 5–10 seconds and poll again.

A Few Pro Tips

Tip: If the target page uses a stable captcha container (a known div_id), include it — it helps the solver locate the right challenge.

Tip: Lemin captcha IDs are short-lived. Don't cache them between page loads.

Tip: For high-volume integrations, run captcha solve requests in parallel but throttle to mimic realistic user behavior.

Wrapping Up

Lemin is a small but common CAPTCHA, especially on registration-heavy sites. The whole loop is just four steps:

Extract captcha_id → submit task → poll for token → submit token with the form

Master that, and Lemin becomes a non-event in your automation pipeline.

For the complete API specification, head over to the CaptchaAI API Docs and select Lemin from the sidebar.

Did this answer your question?