# Temu — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access data from temu.com.

**Category:** E-commerce | **Website:** [temu.com/](https://temu.com/) | **Docs:** [parse.bot/marketplace/b1a169a2-7b99-4800-b385-3b022b442b63/temu-com-api](https://parse.bot/marketplace/b1a169a2-7b99-4800-b385-3b022b442b63/temu-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### batch_get_products

Batch fetch product data for multiple product IDs in one call (up to 40). For each product ID, returns both raw API data and a flat normalized DTO. Each product result carries its own status field so single failures don't break the batch. Products are looked up via Temu's catalog search by goods_id.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `include_dto` | boolean | No | If true, include the flat normalized DTO per product. |
| `include_raw` | boolean | No | If true, include the raw API response data per product. |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). |
| `product_ids` | string | Yes | JSON array of numeric product ID strings (up to 40). Example: '["605731197670167","605714873454696"]'. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/batch_get_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"include_dto":"<boolean>","include_raw":"<boolean>","locale":"<string>","product_ids":"<string>"}'
```

### batch_get_stores

Batch fetch store products for multiple mall IDs in one call (up to 20). For each store, returns raw API data and normalized DTOs of its products, plus pagination info. Supports limit up to 999 (transparently splits into multiple upstream requests of 40 each). Each store result carries its own status and a next_session_token for continuation via continue_batch_store_session.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `include_dto` | boolean | No | If true, include the flat normalized DTO per store. |
| `include_raw` | boolean | No | If true, include the raw API response data per store. |
| `limit` | integer | No | Number of products to return per store (max 999). Internally splits into multiple 40-item upstream requests. |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). |
| `mall_ids` | string | Yes | JSON array of mall ID strings (up to 20). Example: '["2610127","634418223099265"]'. |
| `offset` | integer | No | Offset for pagination within each store's product list. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/batch_get_stores \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"include_dto":"<boolean>","include_raw":"<boolean>","limit":"<integer>","locale":"<string>","mall_ids":"<string>","offset":"<integer>"}'
```

### continue_batch_store_session

Continue paginated store sessions started by batch_get_stores. Accepts an array of opaque session tokens (from previous next_session_token fields), fetches the next page for each store, and returns updated tokens. Handles list_id expiration with automatic recovery.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `include_dto` | boolean | No | If true, include the flat normalized DTO per store. |
| `include_raw` | boolean | No | If true, include the raw API response data per store. |
| `limit` | integer | No | Override the page size stored in the token (max 999). |
| `session_tokens` | string | Yes | JSON array of opaque session token strings from batch_get_stores or a previous continue_batch_store_session response (up to 20). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/continue_batch_store_session \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"include_dto":"<boolean>","include_raw":"<boolean>","limit":"<integer>","session_tokens":"<string>"}'
```

### continue_search_session

Continue a paginated search session started by start_search_session. Decodes the pagination_token to extract the Temu list_id and offset, fetches the next page directly without re-running prior pages, and returns an updated token for the subsequent page. If the upstream list_id has expired, attempts automatic recovery by re-establishing a fresh session and fast-forwarding to the correct offset. Returns recovery_status indicating whether the page was fetched normally or recovered. Returns a structured error when the token is invalid or recovery fails.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return per page (max 40). |
| `pagination_token` | string | Yes | Opaque signed token from start_search_session or a previous continue_search_session response (the session_id field). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/continue_search_session \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","pagination_token":"<string>"}'
```

### get_homepage_featured

Retrieve featured/trending products from the Temu homepage. Returns a paginated list of recommended products with pricing, ratings, sales data, shipping info, and category rankings. Pagination is offset-based: advance `offset` by `limit` to fetch subsequent pages. When `locale` targets a non-English market, titles and prices reflect that locale's language and currency.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return per page. |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls language of titles and currency of prices. |
| `offset` | integer | No | Offset for pagination. Advance by `limit` for the next page. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/get_homepage_featured \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","locale":"<string>","offset":"<integer>"}'
```

### get_product_details

Retrieve product details for a specific product by its numeric ID. The product_id is obtained from search_products or get_homepage_featured results. Returns pricing, rating, review count, sales volume, shipping info, category, ranking, and product URL. When `locale` targets a non-English market, titles and prices reflect that locale's language and currency.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls language of titles and currency of prices. |
| `product_id` | string | Yes | Numeric product ID from search_products.products[*].product_id or get_homepage_featured.products[*].product_id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"locale":"<string>","product_id":"<string>"}'
```

### get_product_images

Retrieve product image URLs for one or more products by their numeric IDs (up to 40 per request). For each product ID, returns all available image URLs as a comma-separated string. Product IDs are obtained from search_products or get_homepage_featured results. When `locale` targets a non-English market, image URLs may differ based on regional CDN.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls regional CDN and product availability. |
| `product_ids` | string | Yes | Comma-separated list of numeric product IDs (up to 40). Example: '606334506389973,606009615600410'. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/get_product_images \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"locale":"<string>","product_ids":"<string>"}'
```

### get_store_products

Retrieve products listed by a specific store/seller on Temu, identified by mall_id. Returns a paginated list of products with pricing, ratings, and sales data, along with store metadata. Pagination is offset-based: advance `offset` by `limit` to fetch subsequent pages. The mall_id is obtained from search_products or get_homepage_featured product results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return per page (max 40). |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls language of titles and currency of prices. |
| `mall_id` | string | Yes | Numeric store/seller identifier from search_products.products[*].mall_id or get_product_details.mall_id. |
| `offset` | integer | No | Offset for pagination. Advance by `limit` for the next page. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/get_store_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","locale":"<string>","mall_id":"<string>","offset":"<integer>"}'
```

### search_products

Full-text search over Temu's product catalog by keyword. Returns a paginated list of products with pricing, ratings, sales data, shipping info, and category rankings. Pagination is offset-based: advance `offset` by `limit` to fetch subsequent pages. Each product carries a `product_id` usable with get_product_details. When `locale` targets a non-English market, titles and prices reflect that locale's language and currency. Results can be filtered by price range using `price_min` and `price_max`.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return per page. |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls language of titles and currency of prices. |
| `offset` | integer | No | Offset for pagination. Advance by `limit` for the next page. |
| `price_max` | number | No | Maximum price in USD. Only products with a price <= this value are returned. |
| `price_min` | number | No | Minimum price in USD. Only products with a price >= this value are returned. |
| `query` | string | Yes | Search keyword (e.g. 'wireless earbuds', 'kitchen gadgets'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","locale":"<string>","offset":"<integer>","price_max":"<number>","price_min":"<number>","query":"<string>"}'
```

### start_search_session

Start a paginated search session over Temu's product catalog. Executes the first page and returns an opaque pagination_token encoding the list_id and offset state. Subsequent pages are fetched via continue_search_session using that token, without re-running prior pages. Each product carries a product_id usable with get_product_details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results to return per page (max 40). |
| `locale` | string | No | Locale/language code for localized results (e.g. 'en', 'it', 'de', 'fr', 'es'). Controls language of titles and currency of prices. |
| `query` | string | Yes | Search keyword (e.g. 'wireless earbuds', 'kitchen gadgets'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-temu-com-api-b1a169a2/start_search_session \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","locale":"<string>","query":"<string>"}'
```
