Skip to content

nexscope-ai/nexscope-ecommerce-skills / ecommerce-temu-category-search

ecommerce.temu-category-search

Verified

Search synced Temu category data in the local database by keyword to find category Chinese names, English names, and category IDs for use in product/store filtering. Triggered when users mention Temu categories, Temu category ID, Temu category tree, Temu backend categories, temu categories, syncTemuCategory (Temu category sync) followed by category queries, or Temu category search. Even if the user does not mention the tool name, this skill should be triggered whenever searching for category IDs by keyword in the locally synced Temu category database.

FileKindSize
SKILL.mdskill md2.3 KB
manifest.jsonconfig210 B
references/api.mdmarkdown5.1 KB
scripts/temu_category_search.pyscript6.6 KB

references/api.md

View on GitHub
# Temu Category Search API Reference

## Usage Notes

- **Gateway route**: `POST ${NEXSCOPE_PROXY_BASE}/api/v1/tools/research/ehunt/temu/temuCategorySearch`.
- **MCP display name**: Temu Category Query (the exact tool name is subject to the tool metadata deployed in the current environment).
- **Authentication**: Request header `Authorization: <api_key>`, api_key read from environment variable `NEXSCOPE_API_KEY` or `NEXSCOPE_API_KEY` (if not configured, follow the **## Resolving Authentication and Credits Issues** section in SKILL.md)
- **Data scope**: Queries Temu categories that have been written to the local database; data must first be synced via **`ehunt/temu/syncTemuCategory`** (MCP display name: Temu Category Sync). Local search does not incur charges.

## Request Parameters (JSON)

| Parameter | Type | Required | Description |
|------|------|------|------|
| keyword | string, maxLen=200 | **Yes** | Keyword: matches against category Chinese name, English name, category ID (substring) |
| page | integer, >=1, default 1 | No | Page number (starting from 1) |
| pageSize | integer, 1~200, default 50 | No | Results per page, max 200 |

## Nexscope response envelope

These research endpoints return a platform object with numeric `code`, nullable `msg`, and business `data`. Only outer `code: 0` means success; `200`, string codes, missing codes, and HTTP 200 alone do not. A nonzero code is a platform error: show `msg` and do not interpret the payload as a successful result.

`msg` preserves the upstream message when available; Chinese messages are translated to English by Nexscope. A successful response without a message has `msg: null`. Do not infer success or retry behavior from the message text. On both success and failure, the direct fields `code`, `errcode`, `errorCode`, `msg`, `errmsg`, `message`, and `errorMsg` are removed from public `data`. Read the message only from outer `msg`; deeper business fields are preserved, including nested `code` and `status`.

Business field tables and abbreviated business examples below describe `data`, unless explicitly labeled as a complete platform response. For example, a business `products` field is at HTTP `data.products`, and a business `data` array is at HTTP `data.data`. The research endpoints already had this outer envelope; no additional wrapper is added.

```json
{"code":0,"msg":null,"data":{}}
```

Metadata includes string `ts` (epoch milliseconds), string `cost` (elapsed milliseconds, not credits), `time`, and nullable `traceId`. Handle network/HTTP failures before the platform code; gateway failures may not be platform JSON. Keep the existing billing-header guidance separate from elapsed time.

## Main Response Fields

| Field | Type | Description |
|------|------|------|
| total | integer | Number of results returned on this page |
| categories | array | List of matching categories |
| title | string | Provider title for the Temu category search; the documented upstream value is in Chinese |

### `categories[]` Elements

| Field | Type | Description |
|------|------|------|
| id | string | Category ID |
| categoryId | string | Category ID (upstream category id) |
| parentId | string | Parent category ID (empty string for top-level) |
| level | integer | Category hierarchy level |
| categoryName | string | Category name (Chinese) |
| categoryNameEn | string | Category name (English) |
| isDeleted | integer | Whether deleted: 0=Normal, 1=Deleted |
| hasChildren | boolean | Whether has child categories |

## Category Sync (Prerequisite)

Category data must first be pulled by **`ehunt/temu/syncTemuCategory`** (MCP display name: Temu Category Sync, no input parameters) to fetch the category tree and write it to the local database; otherwise search results may be empty. It returns `result` (success value is `success`) and `totalRows` (number of category rows written by the sync).

## Script Debugging (Optional)

The repository provides **`scripts/temu_category_search.py`** (Python 3, standard library only).

- **Gateway**: `${NEXSCOPE_PROXY_BASE}/api/v1/tools/research/ehunt/temu/temuCategorySearch`
- **Authentication**: `NEXSCOPE_API_KEY` (if not configured, follow the **## Resolving Authentication and Credits Issues** section in SKILL.md)

```bash
export NEXSCOPE_API_KEY="<your-key>"
python scripts/temu_category_search.py '{"keyword": "kitchen", "page": 1, "pageSize": 50}'
```

Category data must first be synced via **`ehunt/temu/syncTemuCategory`** to the local database; otherwise results may be empty.

## API Key request rate and retries

All API Keys of one Nexscope user share the public API execution request-rate allowance, measured in any rolling 1-second window. The allowed RPS depends on that user's entitlements; it is not a universal 1 RPS. One Skill operation may issue multiple public API requests, each of which uses the allowance.

HTTP 429 with Nexscope outer code `13012` means request-rate exhaustion: honor the response's `Retry-After`. Outer code `13013` means concurrent-request exhaustion, not rate exhaustion; honor `Retry-After` when supplied. Check the HTTP status and outer JSON code separately. Do not automatically replay writes or requests with uncertain outcomes; first reconcile the operation's state.
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall