[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [TikTok Shop category tree](https://spiral.ai/integrations/opencode/tiktok-shop-category-tree)

# How to Use TikTok Shop category tree in opencode

Returns the product category tree for a TikTok Shop market. Use it to find category IDs before browsing products; the number of categories and their depth vary by region.

|  |  |
| --- | --- |
| Model | TikTok Shop category tree |
| Available through | TikHub |
| Category | E-commerce |
| Price | $0.0013 per request. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with TikTok Shop category tree in opencode

- Use TikTok Shop category tree for Singapore and build a browsable category hierarchy in this project using the returned category IDs and names.
- Use TikTok Shop category tree to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from TikTok Shop category tree and tell me what changed since last week.
- Check TikTok Shop category tree and summarize what you find in three bullet points.
- Pull the newest data from TikTok Shop category tree and give me the result as a table.

## How to set up TikTok Shop category tree in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run TikTok Shop category tree**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "tikhub",
    "model": "tikhub/tiktok-shop-web-fetch-products-category-list",
    "input": {
      "region": "US"
    }
  }'
```

Then paste one of the prompts above: opencode finds TikTok Shop category tree on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## TikTok Shop category tree tools and prices

- [TikTok Shop · Get product category list](https://spiral.ai/tools/tikhub/tikhub/tiktok-shop-web-fetch-products-category-list) (TikHub): $0.0013 per request.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| region |  | US | GB and BR are unavailable. |

## What can you do with TikTok Shop category tree in opencode?

Build an internal TikTok Shop research table that connects discovered listings to product details and buyer feedback. A coding agent can adapt the project's parsers to changing page structures and preserve the different pagination behavior of search and category browsing.

### Plan a regional assortment

Combine keyword results, category browsing, and hot-selling discovery to assemble products for a buying review. Keep each market's category tree attached to its own product results.

### Maintain an existing product research pipeline

Check that discovery results, category mappings, shared links, product lookups, and review records still join to the intended listings. Migrate deprecated compact lookups and verify that response changes do not silently remove useful data.

### Map category coverage

Build a market-specific category map and compare category browsing with keyword discovery. Use the differences to identify product areas that deserve a closer manual assortment review.

### Build a weekly buying shortlist

Combine shared product suggestions with keyword, category, and hot-selling discovery. Add review evidence to each candidate and produce an internal shortlist for the buying team.

### Reconcile product research sources

Join products discovered through links, keywords, categories, and the hot-selling feed by product ID. Attach product details and reviews to create one internal research record per listing.

## Overview

- [TikHub](https://spiral.ai/providers/tikhub)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## TikTok Shop category tree in other agents

- [Amp](https://spiral.ai/integrations/amp/tiktok-shop-category-tree)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/tiktok-shop-category-tree)
- [Claude](https://spiral.ai/integrations/claude-desktop/tiktok-shop-category-tree)
- [Claude Code](https://spiral.ai/integrations/claude-code/tiktok-shop-category-tree)
- [Cline](https://spiral.ai/integrations/cline/tiktok-shop-category-tree)
- [Codex](https://spiral.ai/integrations/codex/tiktok-shop-category-tree)
- [Cursor](https://spiral.ai/integrations/cursor/tiktok-shop-category-tree)
- [Devin](https://spiral.ai/integrations/devin/tiktok-shop-category-tree)
- [dots](https://spiral.ai/integrations/dots/tiktok-shop-category-tree)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/tiktok-shop-category-tree)
- [Gemini](https://spiral.ai/integrations/gemini/tiktok-shop-category-tree)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/tiktok-shop-category-tree)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/tiktok-shop-category-tree)
- [goose](https://spiral.ai/integrations/goose/tiktok-shop-category-tree)
- [Grok](https://spiral.ai/integrations/grok/tiktok-shop-category-tree)
- [Grok Build](https://spiral.ai/integrations/grok-build/tiktok-shop-category-tree)
- [Hermes](https://spiral.ai/integrations/hermes/tiktok-shop-category-tree)
- [Instinct](https://spiral.ai/integrations/instinct/tiktok-shop-category-tree)
- [Manus](https://spiral.ai/integrations/manus/tiktok-shop-category-tree)
- [Muse](https://spiral.ai/integrations/muse/tiktok-shop-category-tree)
- [Muse Code](https://spiral.ai/integrations/muse-code/tiktok-shop-category-tree)
- [n8n](https://spiral.ai/integrations/n8n/tiktok-shop-category-tree)
- [Notion](https://spiral.ai/integrations/notion/tiktok-shop-category-tree)
- [OpenClaw](https://spiral.ai/integrations/openclaw/tiktok-shop-category-tree)
- [Perplexity](https://spiral.ai/integrations/perplexity/tiktok-shop-category-tree)
- [Raycast](https://spiral.ai/integrations/raycast/tiktok-shop-category-tree)
- [VS Code](https://spiral.ai/integrations/vscode/tiktok-shop-category-tree)
- [Windsurf](https://spiral.ai/integrations/windsurf/tiktok-shop-category-tree)
- [Zapier](https://spiral.ai/integrations/zapier/tiktok-shop-category-tree)

## More opencode guides

- [TikTok Shop US mobile seller products](https://spiral.ai/integrations/opencode/tiktok-shop-us-mobile-seller-products)
- [TikTok Shop compact product details](https://spiral.ai/integrations/opencode/tiktok-shop-compact-product-details)
- [TikTok Shop US mobile product search](https://spiral.ai/integrations/opencode/tiktok-shop-us-mobile-product-search)
- [TikTok Shop hot-selling products](https://spiral.ai/integrations/opencode/tiktok-shop-hot-selling-products)
- [TikTok Shop Shop Search](https://spiral.ai/integrations/opencode/tiktok-shop-shop-search)
- [TikTok Shop keyword suggestions](https://spiral.ai/integrations/opencode/tiktok-shop-keyword-suggestions)

## Questions about TikTok Shop category tree in opencode

**Can opencode use TikTok Shop category tree?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run TikTok Shop category tree like any built-in tool.

**How much does TikTok Shop category tree cost in opencode?**

$0.0013 per request. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need a TikHub account to use TikTok Shop category tree in opencode?**

No. Spiral runs TikTok Shop category tree on its own TikHub account. You sign in to Spiral once and never paste a key.

**How long does it take to set up TikTok Shop category tree in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while TikTok Shop category tree runs?**

TikTok Shop category tree runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

**Is this public TikTok Shop data?**

TikHub states that it accesses only publicly available data. The source boundary is public content rather than restricted platform information.

**How fresh and complete is the data?**

TikHub disclaims guarantees of accuracy, completeness, reliability, and timeliness. Its terms do not promise that a returned TikTok Shop result is a complete or current record.

**Does TikTok Shop provide a fixed bestseller ranking here?**

The hot-selling feed does not provide sales-ranking fields, and its order can change. A product's position in that response is not a documented sales rank.

**Will one product search return the whole assortment?**

TikHub documents variable page sizes for product search and batches of fewer than 20 products for category browsing. Category browsing should stop when there are no more results or no new products.

**Are the same product details available for every listing?**

Product page fields vary by product and region. Even the current product-detail endpoint can return different page structures, so a single fixed structure is not guaranteed.

