接口参考
分类列表 API
GET
/v1/category免费·api.etshop.ai/open-apiCredits 消耗规则
计费规则:店铺/商品列表与热销榜每返回 1 条扣 1 Credit,店铺详情每次扣 2 Credits;详情、趋势、每日数据、评论免费(需 3 天内在列表或详情中返回过)。关键词搜索每个词扣 1 Keyword Credit,30 天内同一个词免费。店铺监控每个店铺扣 1 Monitor Credit,监控 30 天,停止后不退还。空结果不扣费,服务器错误自动退还。
请求头
AUTHORIZATION
Authorization: {API Key}CONTENT-TYPE
application/jsonACCEPT
application/json请求示例
cURL
curl --location --request GET 'https://api.etshop.ai/open-api/v1/category' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: {API Key}' 请求参数
按参数标注的位置传入请求。
| 参数 | 类型 | 说明 |
|---|---|---|
| shop_id
query · 可选
| integer | 店铺 ID。传入时只返回该店铺有商品的分类;不传返回全部分类 |
返回示例
返回示例 · JSON
{
"code": 200,
"message": "success",
"data": {
"data": [
{
"id": 66,
"name": "Home & Living",
"children": [
{
"id": 891,
"name": "Home Decor",
"children": [
{
"id": 1028,
"name": "Wall Decor",
"children": null
},
{
"id": 1035,
"name": "Candles & Holders",
"children": null
}
]
},
{
"id": 1002,
"name": "Kitchen & Dining",
"children": [
{
"id": 1107,
"name": "Drink & Barware",
"children": null
}
]
}
]
},
{
"id": 68887494,
"name": "Jewelry",
"children": [
{
"id": 68887420,
"name": "Necklaces",
"children": null
}
]
}
]
},
"credits": {
"type": "default",
"remaining_credits": 196540,
"consumed_credits": 0,
"total_credits": 196540
}
}
文档中的示例数据
返回数据结构
| 名称 | 类型 | 必选 | 约束 | 说明 |
|---|---|---|---|---|
| » code | integer | true | none | 业务状态码 |
| » message | string | true | none | 响应消息 |
| » data | object | true | none | 响应数据 |
| »» data | [object] | true | none | 一级分类列表 |
| »»» id | integer | true | none | 分类 ID |
| »»» name | string | true | none | 分类名称 |
| »»» children | [object]¦null | true | none | 二级分类列表,没有子分类时为 null |
| »»»» id | integer | true | none | 分类 ID |
| »»»» name | string | true | none | 分类名称 |
| »»»» children | [object]¦null | true | none | 三级分类列表,没有子分类时为 null |
| »»»»» id | integer | true | none | 分类 ID |
| »»»»» name | string | true | none | 分类名称 |
| »»»»» children | null | true | none | 固定为 null |
| » credits | object | true | none | 本次请求的 Credits 信息,见计费规则 |
| »» type | string | true | none | Credits 类型,本接口为 default |
| »» remaining_credits | integer | true | none | 本次请求后剩余的 Credits |
| »» consumed_credits | integer | true | none | 本次请求消耗的 Credits,本接口为 0 |
| »» total_credits | integer | true | none | 本次请求前的 Credits 余额(remaining_credits + consumed_credits) |
