# TikTok 店铺详情接口

## API 信息

- **API 名称**: 获取 TikTok 小店店铺详情
- **请求方法**: POST
- **API 地址**: `/open-api/v1/data`
- **接口路径**: `/v3/api/open/tiktok-shop/shop/detail`
- **接口描述**: 根据店铺 ID 获取 TikTok 小店的店铺详细信息
- **价格说明**: 详情接口计费规则： 基础费用：1 credit/次。 免费访问条件（满足其一即可）： 该ID在3天内已获取过详情；该ID在3天内出现在您的榜单列表查询结果中。

**请求头:**

- Content-Type: application/json
- Accept: application/json

### 请求参数

#### 请求结构

| 参数名 | 类型   | 描述                        | 示例                                   | 必填 | 默认值 |
| ------ | ------ | --------------------------- | -------------------------------------- | ---- | ------ |
| key    | string | 用户申请的外部 api 请求 key | "your_api_key_here"                    | 是   |        |
| uri    | string | 接口路径                    | "/v3/api/open/tiktok-shop/shop/detail" | 是   |        |
| params | object | 接口入参对象                | 见参数列表                             | 是   |        |

#### 参数列表 (params 对象)

| 参数名 | 类型   | 必填 | 描述            | 示例       | 默认值 |
| ------ | ------ | ---- | --------------- | ---------- | ------ |
| id     | String | 是   | 店铺唯一标识 ID | "shop_001" |        |

#### 请求示例

```bash
curl -X POST "https://www.pipispy.com/open-api/v1/data" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "key": "your_api_key_here",
    "uri": "/v3/api/open/tiktok-shop/shop/detail",
    "params": {
      "id": "shop_001"
    }
  }'
```

### 响应

#### 响应体结构

```json
{
  "code": 200,
  "message": "success",
  "data": {
    // 店铺详情信息
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 1,
  "success": true,
  "fail": false
}
```

#### 响应字段说明

##### 主要响应字段

| 字段名        | 类型        | 描述         |
| ------------- | ----------- | ------------ |
| **data**      | Object      | 店铺详情信息 |
| **version**   | String      | API 版本     |
| **timestamp** | Long/null   | 响应时间戳   |
| **sign**      | String/null | 响应签名     |
| **remaining_credits** | Long          | 当前请求后的剩余可用积分 |
| **consumed_credits**  | Long          | 本次请求消耗的积分 |
| **success**   | Boolean     | 请求成功状态 |
| **fail**      | Boolean     | 请求失败状态 |

##### 店铺详情字段 (data)

| 字段名              | 类型    | 描述                                            |
| ------------------- | ------- | ----------------------------------------------- |
| ad_cost             | String  | 广告花费字符串                                  |
| avg_price           | Double  | 平均价格（本地货币）                            |
| avg_price_usd       | Double  | 平均美元价格                                    |
| best_selling_goods  | Array   | 最畅销商品列表                                  |
| categorize          | Array   | 店铺分类树形结构                                |
| categorize_str      | String  | 店铺分类字符串                                  |
| commission_rate     | Double  | 佣金比例                                        |
| currency            | String  | 货币类型                                        |
| delivery            | Array   | 发货方式列表，overseas-跨境发货，local-本地发货 |
| delivery_str        | String  | 发货方式字符串                                  |
| desc                | String  | 店铺描述                                        |
| found_time          | Long    | 首次发现时间（时间戳）                          |
| found_time_str      | String  | 首次发现时间字符串                              |
| gmv                 | Double  | 销售额（GMV）                                   |
| gmv_usd             | Double  | 美元销售额（GMV USD）                           |
| goods_ad_count      | Long    | 广告商品数量                                    |
| goods_ad_rate       | Double  | 广告商品比例                                    |
| goods_count         | Long    | 商品数量                                        |
| id                  | String  | 店铺唯一标识 ID                                 |
| insert_time         | Long    | 数据入库时间（时间戳）                          |
| is_collection       | Boolean | 是否已收藏                                      |
| is_in_marketplace   | Boolean | 是否联盟店铺                                    |
| is_managed          | Boolean | 是否全托管店铺                                  |
| keywords            | String  | 店铺关键词                                      |
| landing_page        | String  | 店铺落地页 URL                                  |
| last_found_time     | Long    | 最后发现时间（时间戳）                          |
| last_found_time_str | String  | 最后发现时间字符串                              |
| max_cpm             | Double  | 最大广告花费（CPM）                             |
| min_cpm             | Double  | 最小广告花费（CPM）                             |
| person_count        | Long    | 达人数量                                        |
| play_count          | Long    | 播放量/广告曝光数                               |
| product_type        | Array   | 产品类型列表，brand-品牌，retail-零售商         |
| product_type_str    | String  | 产品类型字符串                                  |
| region              | Array   | 店铺投放地区列表                                |
| region_str          | String  | 店铺投放地区字符串                              |
| root_path           | String  | 广告主（域名）                              |
| sales_trend         | Integer | 销售趋势，1-增长，0-平稳，-1-下降               |
| sales_trend_data    | Array   | 销售趋势数据列表                                |
| sales_trend_str     | String  | 销售趋势字符串描述                              |
| sales_volume        | Long    | 店铺销量                                        |
| score               | Double  | 店铺评分                                        |
| share_count         | Long    | 分享数                                          |
| shop_image          | String  | 店铺图片 URL                                    |
| shop_name           | String  | 店铺名称                                        |
| update_time         | Long    | 数据更新时间（时间戳）                          |
| video_count         | Long    | 广告视频数量                                    |

##### 分类树形结构字段 (categorize)

| 字段名     | 类型   | 描述             |
| ---------- | ------ | ---------------- |
| \_id       | String | 分类 ID          |
| name_zh    | String | 中文分类名称     |
| name_vi    | String | 越南语分类名称   |
| name_th    | String | 泰语分类名称     |
| name_pt    | String | 葡萄牙语分类名称 |
| name_ja    | String | 日语分类名称     |
| name_id    | String | 印尼语分类名称   |
| name_en    | String | 英文分类名称     |
| child_node | Object | 子分类节点       |

##### 最畅销商品对象字段 (best_selling_goods)

| 字段名       | 类型   | 描述         |
| ------------ | ------ | ------------ |
| product_id   | String | 商品 ID      |
| image        | String | 商品图片 URL |
| sales_volume | Long   | 商品销量     |

##### 销售趋势数据对象字段 (sales_trend_data)

| 字段名       | 类型 | 描述       |
| ------------ | ---- | ---------- |
| day          | Long | 日期时间戳 |
| sales_volume | Long | 当日销量   |

#### 响应示例

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": "shop_001",
    "shop_name": "时尚配件店",
    "shop_image": "https://example.com/shop.jpg",
    "is_managed": false,
    "is_in_marketplace": true,
    "landing_page": "https://example.com/shop",
    "desc": "专注于时尚手机配件的精品店铺，提供高品质的产品和服务",
    "region": ["US", "GB"],
    "region_str": "US, GB",
    "categorize": [
      {
        "_id": "cat_001",
        "name_zh": "手机配件",
        "name_en": "Phone Accessories",
        "child_node": null
      }
    ],
    "categorize_str": "Phone Accessories",
    "goods_count": 100,
    "goods_ad_count": 80,
    "goods_ad_rate": 0.8,
    "best_selling_goods": [
      {
        "product_id": "1730339920817197651",
        "image": "https://im.pipispy.com/products/images/5d1c88771fbae4a0.png",
        "sales_volume": 694
      },
      {
        "product_id": "1730348130623001171",
        "image": "https://im.pipispy.com/products/images/45c8040730ccac77.png",
        "sales_volume": 471
      }
    ],
    "sales_volume": 5000,
    "min_cpm": 2.0,
    "max_cpm": 8.0,
    "ad_cost": "USD 2.0-8.0",
    "avg_price": 35.0,
    "avg_price_usd": 35.0,
    "gmv": 150000.0,
    "gmv_usd": 150000.0,
    "sales_trend": 1,
    "sales_trend_str": "Growing",
    "sales_trend_data": [
      {
        "day": 1744300800,
        "sales_volume": 56
      },
      {
        "day": 1744387200,
        "sales_volume": 54
      }
    ],
    "score": 4.8,
    "video_count": 150,
    "play_count": 200000,
    "person_count": 120,
    "share_count": 5000,
    "found_time": 1640995200,
    "found_time_str": "01-01-2022",
    "last_found_time": 1643673600,
    "last_found_time_str": "01-02-2022",
    "insert_time": 1640995200,
    "update_time": 1643673600,
    "currency": "USD",
    "is_collection": false,
    "root_path": "example.com",
    "keywords": "时尚,配件,手机,精品",
    "commission_rate": 0.15,
    "product_type": ["brand"],
    "product_type_str": "brand",
    "delivery": ["local", "overseas"],
    "delivery_str": "local, overseas"
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 1,
  "success": true,
  "fail": false
}
```

### 错误码

| 错误码 | 描述                        |
| ------ | --------------------------- |
| 200    | 成功                        |
| 400    | 请求参数错误，如缺少店铺 ID |
| 404    | 店铺不存在                  |
| 500    | 服务器内部错误              |
