# 商品搜尋介面

> 9 個平台的 9 個介面，用同一個 Product 物件返回商品搜尋結果。按關鍵詞搜平台商城裡的商品，按頁返回：標題、現價和原價、圖片、店鋪，商城展示的話還有銷量和評分。每次 $0.002 到 $0.054，各介面按自己的價格計費。

網頁版：https://okdata.online/zh-hant/roles/products-search/

## 各平台介面

| 平台 | 介面 | 路徑 | 每頁 | 價格 |
|---|---|---|---|---|
| TikTok | [TikTok Shop 商品搜尋](https://okdata.online/zh/apis/tiktok/shop/products/search/) | `GET /v1/tiktok/shop/products/search` | 20 | $0.004/次 · 每頁約 20 個商品 |
| 小紅書 | [小紅書商城商品搜尋](https://okdata.online/zh/apis/xiaohongshu/shop/products/search/) | `GET /v1/xiaohongshu/shop/products/search` | 20 | $0.02/次 · 每頁約 20 個商品 |
| 亞馬遜 | [亞馬遜商品搜尋](https://okdata.online/zh/apis/amazon/products/search/) | `GET /v1/amazon/products/search` | 48 | $0.015/次 · 每頁約 48 個商品 |
| 速賣通 | [速賣通商品搜尋](https://okdata.online/zh/apis/aliexpress/products/search/) | `GET /v1/aliexpress/products/search` | 20 | $0.002/次 · 每頁約 20 個商品 |
| 淘寶天貓 | [淘寶商品搜尋](https://okdata.online/zh/apis/taobao/products/search/) | `GET /v1/taobao/products/search` | 10 | $0.043/次 · 每頁約 10 個商品 |
| 1688 | [1688 商品搜尋](https://okdata.online/zh/apis/alibaba_1688/products/search/) | `GET /v1/alibaba_1688/products/search` | 20 | $0.022/次 · 每頁約 20 個商品 |
| 閒魚 | [閒魚商品搜尋](https://okdata.online/zh/apis/xianyu/products/search/) | `GET /v1/xianyu/products/search` | 10 | $0.022/次 · 每頁約 10 個商品 |
| 抖音電商 | [抖音電商商品搜尋](https://okdata.online/zh/apis/douyin_shop/products/search/) | `GET /v1/douyin_shop/products/search` | 30 | $0.054/次 · 每頁約 30 個商品 |
| 京東 | [京東商品搜尋](https://okdata.online/zh/apis/jd/products/search/) | `GET /v1/jd/products/search` | 48 | $0.033/次 · 每頁約 48 個商品 |

## 返回的物件：[Product](https://okdata.online/zh/docs/objects/product/)

上面每個介面返回的欄位名和型別都一樣。平台不展示的欄位返回 null，並在 meta.unavailable 裡註明。

| 欄位 | 型別 | 含義 |
|---|---|---|
| `id` | `string` | 商品在商城裡的 ID。 |
| `url` | `string` | 商品頁面。 |
| `title` | `string` | 商品標題。 |
| `price` | `number \| null` | 現價（最低規格），單位見 currency。 |
| `original_price` | `number \| null` | 折前原價（有的話）。 |
| `currency` | `string \| null` | ISO 4217 貨幣程式碼。 |
| `sold` | `integer \| null` | 銷量，以商城顯示為準。 |
| `rating` | `number \| null` | 平均星級，0 到 5。 |
| `reviews` | `integer \| null` | 評價數。 |
| `images` | `string[] \| null` | 商品圖片地址。 |
| `shop` | `ShopRef` | 賣家店鋪。 |
| `ext` | `object` | 平台特有欄位，只在 view=full 時返回。 |

## 兩個平台上的同一個呼叫

引數一樣、翻頁方式一樣、返回結構一樣，只換路徑。

```bash
# TikTok
curl -G "https://api.okdata.online/v1/tiktok/shop/products/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=portable coffee maker'

# 小紅書
curl -G "https://api.okdata.online/v1/xiaohongshu/shop/products/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=便攜咖啡機'
```

## 常見用途

- 自己定價之前，先看一個品類的價格區間。
- 找出某個關鍵詞下賣得最好的商品。
- 一週周盯著搜尋結果，發現新冒出來的競品。

## 常見問題

### 帶銷量嗎？

商城展示的就有。TikTok Shop 有；小紅書商城不以數字展示銷量，所以那邊 sold 為 null。

### 價格是什麼幣種？

每個商品都帶 currency 程式碼。小紅書的價格是人民幣；TikTok Shop 的價格是店鋪展示的幣種。

### 搜到之後做什麼？

把商品 id 存下來。傳給商品詳情拿全部圖片和店鋪資訊，傳給商品評價看買家怎麼說。

## 其他資料型別

- [評論介面](https://okdata.online/zh/roles/posts-comments-list/)
- [熱榜介面](https://okdata.online/zh/roles/trends-list/)
- [評論回覆介面](https://okdata.online/zh/roles/comments-replies-list/)
- [話題內容介面](https://okdata.online/zh/roles/topics-posts-list/)
- [帳號資訊介面](https://okdata.online/zh/roles/accounts-get/)
- [帳號作品列表介面](https://okdata.online/zh/roles/accounts-posts-list/)
- [內容詳情介面](https://okdata.online/zh/roles/posts-get/)
- [內容搜尋介面](https://okdata.online/zh/roles/posts-search/)
- [熱門內容介面](https://okdata.online/zh/roles/posts-trending/)
- [帳號搜尋介面](https://okdata.online/zh/roles/accounts-search/)
- [內容資料介面](https://okdata.online/zh/roles/posts-metrics/)
- [社群帖子介面](https://okdata.online/zh/roles/communities-posts-list/)
- [廣告詳情介面](https://okdata.online/zh/roles/ads-get/)
- [廣告主廣告列表介面](https://okdata.online/zh/roles/advertisers-ads-list/)
- [廣告搜尋介面](https://okdata.online/zh/roles/ads-search/)
- [字幕介面](https://okdata.online/zh/roles/transcripts-get/)
- [粉絲列表介面](https://okdata.online/zh/roles/accounts-followers-list/)
- [商品詳情介面](https://okdata.online/zh/roles/products-get/)
- [商品評價介面](https://okdata.online/zh/roles/products-reviews-list/)
- [達人搜尋介面](https://okdata.online/zh/roles/creators-search/)
- [達人詳情介面](https://okdata.online/zh/roles/creators-get/)
- [達人粉絲畫像介面](https://okdata.online/zh/roles/creators-audience-get/)
