Was this helpful?
How to Solve Temu Captcha via API: A Guide to Working with Coordinates
Technical engineer
Introduction
This guide is for developers who are automating interactions with Temu.com and encountering Temu Line or Temu Icon captchas. In this material, we will explain how the coordinate-based solving method works, what images need to be prepared, and how to interpret the API response.
Important note: Currently, the 2Captcha service supports solving two types of Temu captchas, Temu Line and Temu Icon, exclusively by returning coordinates. The token-based method, which will return a ready-made parameter for submission to the Temu server, is under active development. Information about its launch will appear in the 2Captcha documentation and blog.
General Information
Supported Captcha Types
Temu uses several types of interactive checks. Two types are available for solving via the 2Captcha API:
| Captcha Type | Task Description | What Is Returned in the Response |
|---|---|---|
| Temu Line | Need to match lines in the image by moving fragments to the correct positions | Array of coordinates for placing each fragment |
| Temu Icon | Need to click on objects in the correct order | Array of coordinates of the top-left corners of found icons |
How the TemuImageTask Method Works
The method follows this workflow:
- You prepare the images, the main captcha background image and the fragments that need to be moved or found
- Convert all images to base64 format
- Send a
TemuImageTasktype task to the API, passing the images in the request body - The service processes the task and returns an array of coordinates
- You use the received coordinates to emulate actions in the browser, clicks or dragging
Image Requirements
For correct task processing, it is important to follow the recommendations for image sizes and formats:
For Temu Icon:
- Main image, original size, recommended around 745×749 pixels
- Fragments (icons), approximately 167×167 pixels each
- Number of fragments, usually three
- Transfer format, base64
For Temu Line:
- Main image, full screenshot of the captcha area
- Fragments, images of elements to be moved
- Transfer format, base64
All images must be clear, without compression artifacts that could interfere with recognition.
Environment Setup
Before you start, make sure you have:
- API key from your account dashboard at 2Captcha
- Tool for sending HTTP requests, curl, Postman, or a library for your programming language
- Ability to convert images to base64, built-in language tools or online converters
- Access to the target Temu page to capture current captcha images
It is recommended to use environment variables to store the API key, this increases integration security.
Page Analysis
To form the task, you need to obtain images directly from the captcha page. This can be done in the following ways:
- Through browser developer tools, find the required elements on the Elements tab, take a screenshot of the area or save the image from the link
- Using automation tools, use browser capabilities to capture elements and convert them to base64
Important points when analyzing:
- Make sure the captcha is fully loaded before capturing images
- Preserve the original image quality, avoid re-compression
- Record the order of fragments in the
partsarray, it affects the order of coordinates in the response - Check if the captcha structure has changed after a site update
Implementation
Task Creation Request Structure
The task is sent via POST request to the endpoint https://api.2captcha.com/createTask
Example TemuImageTask Request:
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "TemuImageTask",
"image": "/9j/4AAQSkZJRg......",
"parts": [
"part1_b64",
"part2_b64",
"part3_b64"
]
}
}
Task Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
clientKey |
String | Yes | Your API key from the 2Captcha account dashboard |
task.type |
String | Yes | Fixed value TemuImageTask |
task.image |
String | Yes | Main captcha image in base64 |
task.parts |
Array | Yes | Array of fragment images in base64 |
Task Result Request
After creating the task, use the taskId to get the result. The request is sent to https://api.2captcha.com/getTaskResult
json
{
"clientKey": "YOUR_API_KEY",
"taskId": 80306543329
}
Example Successful Response
json
{
"cost": "0.0012",
"createTime": 1754563182,
"endTime": 1754563190,
"errorId": 0,
"ip": "46.53.232.76",
"solution": {
"coordinates": [
{"x": 155, "y": 358},
{"x": 152, "y": 153},
{"x": 251, "y": 333}
]
},
"solveCount": 1,
"status": "ready"
}
Parameter Explanations
Interpreting Coordinates
The coordinates in the response indicate the top-left corner of the recognized fragment relative to the main image.
For Temu Icon:
- If you need to emulate a click in the center of the icon, add half the width and height of the fragment to the received coordinates
- Example, for a 167×167 px fragment, the center will be at coordinates
x + 83,y + 83
For Temu Line:
- Coordinates indicate the target position for placing each movable element
- When emulating drag-and-drop, use these coordinates as the end point of the movement
Coordinate Order
The coordinates array is returned in the same order that the fragments were passed in the parts array. This is important to consider for sequential actions, for example, when clicking icons in a specified order.
Common Errors
| Error | Cause | Solution |
|---|---|---|
| Incorrect base64 format | Added prefix data:image/png;base64, |
Send only the clean base64 string without prefixes |
| Authorization error | Invalid clientKey |
Check the API key in your 2Captcha dashboard |
| Image too large | Exceeded file size limit | Compress the image to recommended parameters |
| Incorrect fragment order | Fragments passed in wrong order | Maintain the order corresponding to the captcha logic |
| Coordinates don't work | Offset to element center not considered | Add half the fragment size to coordinates for clicks |
| Long wait | High service load | Increase timeout, check account status |
Feedback on Solving Results
After receiving a response from 2Captcha and verifying it on the target site, it is recommended to send feedback. This helps improve recognition quality and in some cases get refunds for incorrect solutions.
If the Site Rejected the Solution (Incorrect Answer)
Send a POST request to the reportIncorrect endpoint:
Endpoint: https://api.2captcha.com/reportIncorrect
Method: POST
Content-Type: application/json
Example Request:
json
{
"clientKey": "YOUR_API_KEY",
"taskId": 80306543329
}
Example Response:
json
{
"errorId": 0,
"status": "success"
}
Important: Do not use this method if your success rate is close to 0 percent. This may indicate an error in your code, not in the captcha solutions.
If the Site Accepted the Solution (Correct Answer)
Send a POST request to the reportCorrect endpoint:
Endpoint: https://api.2captcha.com/reportCorrect
Method: POST
Content-Type: application/json
Example Request:
json
{
"clientKey": "YOUR_API_KEY",
"taskId": 80306543329
}
Example Response:
json
{
"errorId": 0,
"status": "success"
}
Refund Policy
- Each case is reviewed individually
- For standard captchas, the correctness of the response is checked
- For token based captchas, worker statistics are analyzed
- Refunds are not guaranteed for every complaint
- The final refund amount may differ from the number of claims
Send reports honestly and only after real verification on the target site.
Additional Resources
- Temu CAPTCHA Documentation
- reportIncorrect Method - Report an incorrect solution
- reportCorrect Method - Report a correct solution
- Official Article: How to Solve and Bypass Temu CAPTCHA
- Contact Support
Checklist
- API key obtained and verified from 2Captcha account dashboard
- Confirmed captcha type is supported (Temu Line or Temu Icon)
- Prepared main image in recommended size
- Extracted and prepared fragments (usually 3) in required format
- Converted all images to base64 without extra prefixes
- Specified task type as
TemuImageTask - Passed images in correct order in the
partsarray - Considered that coordinates point to the top-left corner of the fragment
- Added adjustment to element center when emulating clicks
- Implemented sending
reportIncorrectandreportCorrectreports
Conclusion
Solving Temu captchas via the 2Captcha API currently works by returning coordinates that need to be applied on the page by emulating actions. The TemuImageTask method requires preparing images in base64 format and following size recommendations.
If you have questions or difficulties with integration, we recommend contacting 2Captcha support. Specialists will help you understand the technical details and choose the optimal approach for your task.