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

Temu Captcha Image Solving

Solve Temu puzzle captcha challenges where you need to position puzzle pieces correctly on a main image. Temu uses custom puzzle-based captcha systems for account security and checkout verification.

What is Temu Captcha?

Temu, a popular e-commerce platform, uses puzzle-based captcha challenges to protect user accounts and prevent automated checkout abuse. The challenge presents a main image (body) and three puzzle pieces that need to be positioned correctly. Our service automatically determines the correct coordinates for each puzzle piece, ensuring seamless automated shopping and account management.

Captcha Type

"type": "TEMU_CAPTCHA_IMAGE"

Pricing

Service Price per Solve Average Time
Temu Captcha Image $0.0012 ~5 seconds

Request Format

POST /createTask

Request Parameters

Parameter Type Required Description
captcha.type string required Must be "TEMU_CAPTCHA_IMAGE"
captcha.metadata.siteUrl string required Temu page URL (e.g., "https://www.temu.com")
captcha.payload.images array required Array of 4 base64-encoded images: [body, part1, part2, part3]
Important

You must provide exactly 4 images in the following order:
1. Body - The main/background image
2. Part 1 - First puzzle piece
3. Part 2 - Second puzzle piece
4. Part 3 - Third puzzle piece

All images must be in base64 format with data URI prefix (e.g., "data:image/png;base64,...")

Request Example

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',
      appId: 0 
    },
    context: { 
      source: 'api', 
      version: '1.0.0' 
    },
    captcha: {
      type: 'TEMU_CAPTCHA_IMAGE',
      metadata: {
        siteUrl: 'https://www.temu.com'
      },
      payload: {
        images: [
          'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...',  // Body image
          'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...',  // Part 1
          'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...',  // Part 2
          'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...'   // Part 3
        ]
      }
    }
  })
});

const data = await response.json();
console.log(data);

Response Format

Create Task Response

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha is being processed",
  "task": {
    "id": "MyDisctSolver_1234567890",
    "status": "processing"
  }
}

Fetch Result Response (Processing)

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha is being processed",
  "task": {
    "id": "MyDisctSolver_1234567890",
    "status": "processing"
  }
}

Fetch Result Response (Completed)

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha solved successfully",
  "task": {
    "id": "MyDisctSolver_1234567890",
    "status": "completed",
    "result": {
      "answers": [
        [155, 358],
        [152, 153],
        [251, 333]
      ],
      "timestamp": "2025-01-01T12:00:00.000Z"
    }
  }
}
Understanding the Response

The answers array contains 3 coordinate pairs [[x1, y1], [x2, y2], [x3, y3]] representing where each puzzle piece should be positioned on the main image:
[155, 358] - Part 1 position (x=155px, y=358px)
[152, 153] - Part 2 position (x=152px, y=153px)
[251, 333] - Part 3 position (x=251px, y=333px)

Python Example

Python
import requests
import time
import base64

def solve_temu_captcha(body_image, part1_image, part2_image, part3_image, api_key):
    """
    Solve Temu captcha puzzle
    
    Args:
        body_image: Path to body image file or base64 string
        part1_image: Path to part 1 image file or base64 string
        part2_image: Path to part 2 image file or base64 string
        part3_image: Path to part 3 image file or base64 string
        api_key: Your API key
    
    Returns:
        List of coordinates [[x1, y1], [x2, y2], [x3, y3]]
    """
    
    # Convert images to base64 if they are file paths
    def to_base64(image):
        if image.startswith('data:image'):
            return image
        with open(image, 'rb') as f:
            encoded = base64.b64encode(f.read()).decode()
            return f'data:image/png;base64,{encoded}'
    
    images = [
        to_base64(body_image),
        to_base64(part1_image),
        to_base64(part2_image),
        to_base64(part3_image)
    ]
    
    # Step 1: Create task
    create_response = requests.post(
        'https://solver-api.mydisct.com/createTask',
        headers={
            'Content-Type': 'application/json',
            'apikey': api_key
        },
        json={
            'auth': {'token': api_key, 'appId': 0},
            'context': {'source': 'api', 'version': '1.0.0'},
            'captcha': {
                'type': 'TEMU_CAPTCHA_IMAGE',
                'metadata': {'siteUrl': 'https://www.temu.com'},
                'payload': {'images': images}
            }
        }
    )
    
    create_data = create_response.json()
    if not create_data['success']:
        raise Exception(f"Task creation failed: {create_data.get('error', {}).get('message')}")
    
    task_id = create_data['task']['id']
    print(f"Task created: {task_id}")
    
    # Step 2: Poll for result
    while True:
        time.sleep(3)  # Wait 3 seconds
        
        result_response = requests.get(
            f'https://solver-api.mydisct.com/getTaskResult?taskId={task_id}',
            headers={'apikey': api_key}
        )
        
        result_data = result_response.json()
        
        if result_data['task']['status'] == 'completed':
            coordinates = result_data['task']['result']['answers']
            print(f"Captcha solved! Coordinates: {coordinates}")
            return coordinates
        elif result_data['task']['status'] == 'failed':
            error_msg = result_data.get('error', {}).get('message', 'Unknown error')
            raise Exception(f'Captcha solving failed: {error_msg}')
        
        print("Still processing...")

# Usage example
try:
    solution = solve_temu_captcha(
        body_image='body.png',
        part1_image='part1.png',
        part2_image='part2.png',
        part3_image='part3.png',
        api_key='YOUR_API_KEY'
    )
    
    print(f"Part 1 position: x={solution[0][0]}, y={solution[0][1]}")
    print(f"Part 2 position: x={solution[1][0]}, y={solution[1][1]}")
    print(f"Part 3 position: x={solution[2][0]}, y={solution[2][1]}")
    
except Exception as e:
    print(f"Error: {e}")

Implementation Guide

Step 1: Extract Temu Captcha Images

First, you need to extract the captcha images from Temu's page. The captcha typically appears during login, checkout, or when performing sensitive actions.

JavaScript
// Extract Temu captcha images
function extractTemuCaptcha() {
  const captchaContainer = document.querySelector('[class*="captcha"]') ||
                          document.querySelector('[data-testid*="captcha"]') ||
                          document.querySelector('.temu-captcha');

  if (!captchaContainer) {
    console.error('Captcha container not found');
    return null;
  }

  const bodyImage = captchaContainer.querySelector('.captcha-body img') ||
                   captchaContainer.querySelector('[class*="background"] img');
  
  const puzzlePieces = captchaContainer.querySelectorAll('.captcha-piece img') ||
                      captchaContainer.querySelectorAll('[class*="piece"] img');

  if (!bodyImage || puzzlePieces.length !== 3) {
    console.error('Invalid captcha structure');
    return null;
  }

  function imageToBase64(img) {
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    canvas.width = img.naturalWidth;
    canvas.height = img.naturalHeight;
    ctx.drawImage(img, 0, 0);
    return canvas.toDataURL('image/png');
  }

  const images = [
    imageToBase64(bodyImage),
    imageToBase64(puzzlePieces[0]),
    imageToBase64(puzzlePieces[1]),
    imageToBase64(puzzlePieces[2])
  ];

  return { images };
}

const captchaData = extractTemuCaptcha();
console.log('Extracted captcha data:', captchaData);

Step 2: Send to API and Poll for Result

JavaScript
async function solveTemuCaptcha(images, 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, appId: 0 },
      context: { source: 'api', version: '1.0.0' },
      captcha: {
        type: 'TEMU_CAPTCHA_IMAGE',
        metadata: { siteUrl: 'https://www.temu.com' },
        payload: { images }
      }
    })
  });

  const createData = await createResponse.json();

  if (!createData.success) {
    throw new Error(createData.error.message);
  }

  const taskId = createData.task.id;
  console.log('Task created:', taskId);

  while (true) {
    await new Promise(resolve => setTimeout(resolve, 3000)); // Wait 3 seconds

    const resultResponse = await fetch(
      `https://solver-api.mydisct.com/getTaskResult?taskId=${taskId}`,
      { headers: { 'apikey': apiKey } }
    );

    const resultData = await resultResponse.json();

    if (resultData.task.status === 'completed') {
      console.log('Captcha solved!');
      return resultData.task.result.answers;
    } else if (resultData.task.status === 'failed') {
      throw new Error('Temu captcha solving failed');
    }

    console.log('Still processing...');
  }
}

const { images } = extractTemuCaptcha();
const coordinates = await solveTemuCaptcha(images, 'YOUR_API_KEY');

console.log('Solution coordinates:', coordinates);
            

Step 3: Apply Solution to Temu

JavaScript
function applyTemuSolution(coordinates) {
  const captchaContainer = document.querySelector('[class*="captcha"]') ||
                          document.querySelector('.temu-captcha');

  const puzzlePieces = captchaContainer.querySelectorAll('.captcha-piece') ||
                      captchaContainer.querySelectorAll('[class*="piece"]');

  if (puzzlePieces.length !== 3) {
    console.error('Invalid number of puzzle pieces');
    return;
  }

  coordinates.forEach((coord, index) => {
    const [x, y] = coord;
    const piece = puzzlePieces[index];
    
    piece.style.transform = `translate(${x}px, ${y}px)`;
    piece.style.left = `${x}px`;
    piece.style.top = `${y}px`;
    
    const moveEvent = new MouseEvent('mousemove', {
      view: window,
      bubbles: true,
      cancelable: true,
      clientX: x,
      clientY: y
    });
    piece.dispatchEvent(moveEvent);
  });

  setTimeout(() => {
    const submitButton = captchaContainer.querySelector('button[type="submit"]') ||
                        captchaContainer.querySelector('.captcha-submit') ||
                        captchaContainer.querySelector('[class*="verify"]');
    
    if (submitButton) {
      submitButton.click();
      console.log('Captcha submitted!');
    }
  }, 500);
}

applyTemuSolution(coordinates);

Best Practices

Recommendations
  • Image Quality: Use high-resolution images (minimum 300x300px) for better accuracy
  • Image Order: Always send images in the correct order: body, part1, part2, part3
  • Base64 Format: Include the data URI prefix (data:image/png;base64,...)
  • Polling Interval: Poll every 3 seconds for optimal response time
  • Error Handling: Implement proper error handling for failed tasks
  • Timeout: Set a maximum timeout of 3 minutes for polling
  • Retry Logic: Retry failed requests 2-3 times before giving up

Common Issues

Issue: "Temu captcha requires 4 images"

Solution: Ensure you're sending exactly 4 images in the correct order. Check that all puzzle pieces are extracted properly from the page.

Issue: Captcha container not found

Solution: Temu may update their captcha implementation. Check for new class names and selectors. The captcha may appear in iframes or shadow DOM.

Issue: Images too large (payload size error)

Solution: Compress images before encoding to base64. Use JPEG format with 80-90% quality instead of PNG for smaller file sizes.

Issue: Solution not working on Temu

Solution: Temu's captcha implementation may vary. Ensure you're applying the coordinates correctly based on Temu's current DOM structure. The coordinates are relative to the body image's top-left corner.