Temu
Request parameters
type
<string>requiredCustomTask
class
<string>requiredTemu
websiteURL
<string>requiredThe full URL of the page where the CAPTCHA is loaded ( https://www.temu.com/bgn_verification.html?....... )
metadata.cookie
<string>requiredCookies obtained via document.cookie
on the page where the CAPTCHA is loaded
userAgent
<string>optionalThe User-Agent of the browser.
Only pass the current UA. The current one is: userAgentPlaceholder
How to obtain the metadata.cookie parameter
The value for the metadata.cookie
parameter can be obtained on the CAPTCHA page via the document.cookie
property.
Create task method
https://api.capmonster.cloud/createTask
Request
{
"clientKey": "API_KEY",
"task": {
"type": "CustomTask",
"class": "Temu",
"websiteURL": "https://www.temu.com/bgn_verification.html?verifyCode=7PRQIzDznoFE67ecZYtRTw394f6185143a4af80&from=https%3A%2F%2Fwww.temu.com%2F&refer_page_name=home&refer_page_id=10005_1743074140645_cwb6un82rq&refer_page_sn=10005&_x_sessn_id=xmp1zuyv7y",
"userAgent": "userAgentPlaceholder",
"metadata": {
"cookie": "region=141; language=en; currency=EUR; api_uid=CnBpI2fwFW2BogBITHVYAg==; timezone=Europe%2FMoscow; _nano_fp=XpmYXqmJnqX8npXblT_T6~7rkpA2LDnz2BPFuT5m; privacy_setting_detail=%7B%22firstPAds%22%3A0%2C%22adj%22%3A0%2C%22fbsAnlys%22%3A0%2C%22fbEvt%22%3A0%2C%22ggAds%22%3A0%2C%22fbAds%22%3A0%2C%22ttAds%22%3A0%2C%22scAds%22%3A0%2C%22ptAds%22%3A0%2C%22bgAds%22%3A0%2C%22tblAds%22%3A0%2C%22obAds%22%3A0%2C%22vgAds%22%3A0%2C%22idAds%22%3A0%2C%22opAds%22%3A0%2C%22stAds%22%3A0%2C%22pmAds%22%3A0%7D; webp=1; _bee=pgoBlKp038lBhEyoQ4yXnuNrw1X5va2U; verifyAuthToken=QkZmx2TJFbSuuRVD_MKJmA0b84fe3df183da8ab"
}
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Get task result method
Use the getTaskResult method to obtain the Temu solution.
Important! After receiving the solution, you must clear the cookies and set the newly obtained cookies.
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response
{
"errorId": 0,
"status": "ready",
"solution": {
"domains": {
"www.temu.com": {
"cookies": {
"privacy_setting_detail": "%7B%22firstPAds%22%3A1%2C%22adj%22%3A1%2C%22fbsAnlys%22%3A1%2C%22fbEvt%22%3A1%2C%22ggAds%22%3A1%2C%22fbAds%22%3A1%2C%22ttAds%22%3A1%2C%22scAds%22%3A1%2C%22ptAds%22%3A1%2C%22bgAds%22%3A1%2C%22tblAds%22%3A1%2C%22obAds%22%3A1%2C%22vgAds%22%3A1%2C%22idAds%22%3A1%2C%22opAds%22%3A1%2C%22stAds%22%3A1%2C%22pmAds%22%3A1%7D",
"region": "211",
"language": "en",
"currency": "USD",
"api_uid": "Chgx+mflQkR0G1THhRQIAg",
"webp": "1",
"_nano_fp": "XpmYXq98nqUaXpdano_AT7Nbb0dRwziAaAq~s8do",
"verifyAuthToken": "8VhdGgRPTJaJ0t6msEcXlA598e207617867ac4b",
"timezone": "America/Buenos_Aires",
"_bee": "FJBIpQvZnnUGDlamFfP08tIpG1Uyiap2"
}
}
}
},
}
How to Find All Required Parameters for Task Creation
Automatically
A convenient way to automate the search for all necessary parameters. Some parameters are regenerated every time the page loads, so you'll need to extract them through a browser — either regular or headless (e.g., using Playwright). Since the values of dynamic parameters are short-lived, the captcha must be solved immediately after retrieving them.
The code snippets provided are basic examples for familiarization with extracting the required parameters. The exact implementation will depend on your captcha page, its structure, and the HTML elements/selectors it uses.
- JavaScript
- Python
- C#
Show code (Node.js)
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
// Get cookies
const cookies = await page.context().cookies();
console.log('Cookies:', cookies);
await browser.close();
})();
Show code
import asyncio
from playwright.async_api import async_playwright
async def run():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto('https://example.com')
# Get cookies
cookies = await page.context.cookies()
print('Cookies:', cookies)
await browser.close()
asyncio.run(run())
Show code
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Playwright;
class Program
{
public static async Task Main()
{
using var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{
Headless = true
});
var context = await browser.NewContextAsync();
var page = await context.NewPageAsync();
await page.GotoAsync("https://example.com");
var cookies = await context.CookiesAsync();
Console.WriteLine("Cookies:");
foreach (var cookie in cookies)
{
Console.WriteLine($"{cookie.Name}: {cookie.Value}");
}
await browser.CloseAsync();
}
}