Walmart 商品搜索
按商品名、卖家或品牌搜索 Walmart 商品,返回近 30 天销量和销售额,每页 20 条。
API 数据样例
直接查看该接口实际使用的请求体和完整响应结构。
{
"keyword": "air fryer",
"searchBy": "name"
}{
"request_id": "86572046-a990-5941-aaa8-bd604d94bdac",
"data": [
{
"product_id": "11350566851",
"parent_product_id": "7L6C0DXUVMZR",
"photo": [
"https://i5.walmartimages.com/seo/Ninja-Crispi-Glass-Air-Fryer-4-Qt-1500-Watts-3-in-1-White_2f49f5b6-dc7a-43ef-b903-60148b541a85.f4743a19d7838f3f42b7289ac6903e25.jpeg",
"https://i5.walmartimages.com/asr/942aa939-d135-484c-ab41-e645ee099dda.8ce5481d678bd12aae4cc9b2a369aca5.jpeg",
"https://i5.walmartimages.com/asr/ed1bc8a0-d47d-42c0-a167-9cefe3e6170c.9da822d5eb858ac4ce9d4c03cab3f315.jpeg",
"https://i5.walmartimages.com/asr/62b426e2-2511-4843-99a4-0d90281c119b.b251f1ef1c668146db23b3db2a021f42.jpeg",
"https://i5.walmartimages.com/asr/9c42930c-23ea-43d2-9bb8-9c369455ae86.3b0dacec606d08749f3745952fcfb1f1.jpeg",
"https://i5.walmartimages.com/asr/7bbac8f4-e273-4cc5-9945-cc090fac6c48.db24ccb54ee687215411d34aa5206c61.jpeg",
"https://i5.walmartimages.com/asr/b5e22489-1812-4ff5-906c-8a4ef6caa60e.8185f831f875b753a13ea6647fa77308.jpeg",
"https://i5.walmartimages.com/asr/432a3619-7fba-4d5d-935e-36c5d56657c1.3aadbd7347240fcc087a25e2c356b001.jpeg"
],
"title": "Ninja Crispi Glass Air Fryer 4-Qt, 3-in-1, Non-Toxic, Air Fry Recrisp, Portable, Dishwasher Safe, FN090 White",
"price": "$89",
"listing_sales_volume_of_month": 232578,
"listing_sales_of_month": "$20699442",
"brand": "Ninja",
"seller": "Walmart",
"shipedby": "WFS",
"wfs_fee": 0,
"reviews_count": 2597,
"ratings": 4.6,
"number_of_star": [
1,
115,
2,
33,
3,
58,
4,
107
],
"node_tree": [],
"attribute": null,
"label": [],
"popular_pick": false,
"clearance": false,
"reduced_price": false,
"rollback": false,
"flash_deal": false,
"weight": 0,
"variants": null,
"first_reviews_date": null
},
{
"product_id": "19950367748",
"parent_product_id": "19950367748",
"photo": [
"https://i5.walmartimages.com/seo/Chefman-Turbofry-8-Qt-Air-Fryer-w-Digital-Controls-Windowed-Basket-Stainless-Steel_0603781f-e265-4829-b1f7-33223c9168ac.9ab16d901a3987f4bc41062674b8678c.jpeg",
"https://i5.walmartimages.com/asr/77b411ed-fa20-4c43-a941-d06d8861cd6e.5281e5221b8ecfb7739bfd2c26a3a7ba.jpeg",
"https://i5.walmartimages.com/asr/3937729a-5666-444e-8148-5c43c2e2a8f3.c2ad0c92424387fb091bd289eb0b9538.jpeg",
"https://i5.walmartimages.com/asr/baec1b09-6f3a-4b20-bf0e-e9e5b25a391b.95f4e8e4a2e9531395ed03b80039eacd.jpeg",
"https://i5.walmartimages.com/asr/51a25adc-cf16-4e7f-97a8-922bac5faf63.2b67de210537c0ec4e1d0f717ec4d9da.jpeg",
"https://i5.walmartimages.com/asr/5025eda4-7b9b-40c3-80d1-6a2b57164ab1.de64bdc4a7c969e57dce967d1e73bb9f.jpeg",
"https://i5.walmartimages.com/asr/917f4091-d33b-459f-9f72-046cd8c0488a.2d21eaea698c0e8efcda22a704ed58b1.jpeg",
"https://i5.walmartimages.com/asr/560dffc7-453f-4a10-9690-c6f05df08c5a.3494b06a1a62c519d48ce0a0937756b8.jpeg"
],
"title": "Chefman Turbofry 8 Qt Air Fryer w/ Digital Controls & Windowed Basket - Stainless Steel",
"price": "$67.99",
"listing_sales_volume_of_month": 14994,
"listing_sales_of_month": "$1019442.06",
"brand": "Chefman",
"seller": "Chefman Direct",
"shipedby": "Fulfillment by Merchant",
"wfs_fee": 0,
"reviews_count": 496,
"ratings": 4.5,
"number_of_star": [
1,
18,
2,
3,
3,
22,
4,
44
],
"node_tree": [],
"attribute": null,
"label": [],
"popular_pick": true,
"clearance": false,
"reduced_price": false,
"rollback": false,
"flash_deal": false,
"weight": 0,
"variants": null,
"first_reviews_date": null
}
]
}可用状态:已开放
该接口已进入 v1 网关、OpenAPI 和订阅权限目录,每次调用消耗 1 个计费单位,查不到数据(
RESULT_NOT_FOUND)也照常计费。
POST /v1/walmart/products/search
下方请求和响应字段已与当前公开契约核对。
MCP 调用
| 项目 | 内容 |
|---|---|
| MCP Code | walmart_products_search |
快速调用
先创建 API 密钥,再将密钥写入服务端环境变量:
export ECOMMERCE_DATA_API_KEY="your_api_key"curl --request POST \
--url https://ecommercedataapi.com/v1/walmart/products/search \
--header "Content-Type: application/json" \
--header "X-API-Key: ${ECOMMERCE_DATA_API_KEY}" \
--data '{
"keyword": "air fryer",
"searchBy": "name"
}'使用 AI CLI 接入
复制给 AI CLI
粘贴到 Codex、Claude Code、Gemini CLI 或其他编程智能体中直接完成接入。
请直接在当前代码库中接入 Ecommerce Data API 的「Walmart 商品搜索」接口,不要只给示例代码。
接口文档:https://ecommercedataapi.com/zh/docs/walmart/products-search
请求接口:POST https://ecommercedataapi.com/v1/walmart/products/search
API 密钥环境变量:ECOMMERCE_DATA_API_KEY
请求示例:
{
"keyword": "air fryer",
"searchBy": "name"
}
请按以下要求执行:
1. 先阅读接口文档,并检查当前项目使用的语言、框架、HTTP 客户端、目录结构和环境变量约定。
2. 优先复用项目现有的 API 客户端和错误处理方式;如果没有,再创建最小可复用的 Ecommerce Data API 客户端与该接口调用封装。
3. 从服务端环境变量 ECOMMERCE_DATA_API_KEY 读取密钥,发送 Content-Type: application/json 和 X-API-Key 请求头。绝不能把真实密钥写入源码、前端代码、日志、测试快照或 Git。
4. 如果环境变量不存在,提示我自行设置 ECOMMERCE_DATA_API_KEY;不要索取、输出或猜测真实密钥,并继续完成不依赖真实请求的代码与测试。
5. 根据接口文档实现请求与响应类型,处理非 2xx 响应、request_id、error.code、error.message 和 429 限流。
6. 添加一个符合当前项目习惯的最小调用示例或测试。如果密钥已配置且当前环境允许外部请求,再执行一次最小真实调用;否则使用 mock 或静态验证。
7. 运行相关格式化、类型检查和测试,最后汇报修改文件、调用方法、验证结果以及仍需我配置的环境变量。还没有 API 密钥?创建 API 密钥
在 Postman 中打开当前请求
下载当前接口的预配置 Collection,再通过 Postman Import 导入。
导入后在 Collection Variables 中填写 apiKey。创建 API 密钥
Node.js 示例
const response = await fetch(
'https://ecommercedataapi.com/v1/walmart/products/search',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.ECOMMERCE_DATA_API_KEY,
},
body: JSON.stringify({
keyword: 'air fryer',
searchBy: 'name',
}),
}
);
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.error?.code}: ${result.error?.message}`);
}
console.log(result.data);Python 示例
import os
import requests
response = requests.post(
"https://ecommercedataapi.com/v1/walmart/products/search",
headers={
"Content-Type": "application/json",
"X-API-Key": os.environ["ECOMMERCE_DATA_API_KEY"],
},
json={
"keyword": "air fryer",
"searchBy": "name",
},
timeout=30,
)
response.raise_for_status()
print(response.json()["data"])请求参数
请求体直接发送下表字段,不要再包裹额外对象;未定义字段会被拒绝。
| 字段 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
keyword | 字符串 | 是 | 搜索词(英文)。 | air fryer |
searchBy | 字符串 | 否 | keyword 的含义:name 商品名、seller 卖家、brand 品牌。 | name |
page | 整数 | 否 | 页码,每页 20 条。 | 1 |
返回结构
| 字段 | 类型 | 说明 |
|---|---|---|
request_id | 字符串 | 本次请求的唯一标识。 |
data | 数组 | 接口业务数据。 |
下表字段位于 data 内。数组接口描述的是单个数组元素,分页接口描述的是 items[] 中的单条记录。
返回字段
| 字段 | 类型 | 说明 | 示例 |
|---|---|---|---|
product_id | 字符串 | Walmart 商品 ID,可作为 productId 传入详情、素材和趋势接口 | 11350566851 |
parent_product_id | 字符串 | 父商品 ID(该变体所属的主商品 ID) | 7L6C0DXUVMZR |
photo | 数组 | 商品图片 URL 数组(主图在前) | - |
title | 字符串 | 商品标题 | Ninja Crispi Glass Air Fryer 4-Qt, 3-in-1, Non-Toxic, Air Fry Recrisp, Portable, Dishwasher Safe, FN090 White |
price | 字符串 | 商品售价(以 "$" 开头的字符串) | $89 |
listing_sales_volume_of_month | 整数 | 近 30 天月销量(件) | 232578 |
listing_sales_of_month | 字符串 | 近 30 天月销售额(以 "$" 开头的字符串) | $20699442 |
brand | 字符串 | 品牌 | Ninja |
seller | 字符串 | 卖家名称(含 Walmart 自营) | Walmart |
shipedby | 字符串 | 配送方式(如 WFS = Walmart Fulfillment Services) | WFS |
wfs_fee | 整数 | WFS 配送费 | 0 |
reviews_count | 整数 | 评论总数 | 2597 |
ratings | 数字 | 平均评分(满分 5) | 4.6 |
number_of_star | 数组 | 星级分布数组(按 1-5 星顺序,每项为该星级的评论数) | - |
node_tree | 数组 | 类目路径与日期数组,每组 4 项:[类目名称, nodeId, 日期, 排名](可能包含多组历史记录) | - |
attribute | 字符串 | 商品属性键值对(每两个元素组成一对键和值) | - |
label | 数组 | 商品标签数组(如 bestsell、savewith) | - |
popular_pick | 布尔值 | 是否标记为 "Popular Pick" | False |
clearance | 布尔值 | 是否为清仓商品 | False |
reduced_price | 布尔值 | 是否已降价 | False |
rollback | 布尔值 | 是否参与 Rollback 折扣 | False |
flash_deal | 布尔值 | 是否参与 Flash Deal | False |
weight | 数字 | 商品重量(单位未标明,0 表示未填写) | 0.0 |
variants | 字符串 | 变体数组 | - |
variants.variant_id | 字符串 | 变体 ID | - |
variants.url | 字符串 | 变体详情页 URL | - |
variants.property | 字符串 | 变体属性键值对(每两个元素组成一对键和值,如 ["Actual Color","Black"]) | - |
variants.price_update | 字符串 | 变体最近一次价格更新日期(yyyy-MM-dd) | - |
variants.detail_update | 字符串 | 变体最近一次详情更新日期(yyyy-MM-dd) | - |
first_reviews_date | 字符串 | 首条评论日期(yyyy-MM-dd) | - |
返回示例
{
"request_id": "86572046-a990-5941-aaa8-bd604d94bdac",
"data": [
{
"product_id": "11350566851",
"parent_product_id": "7L6C0DXUVMZR",
"photo": [
"https://i5.walmartimages.com/seo/Ninja-Crispi-Glass-Air-Fryer-4-Qt-1500-Watts-3-in-1-White_2f49f5b6-dc7a-43ef-b903-60148b541a85.f4743a19d7838f3f42b7289ac6903e25.jpeg",
"https://i5.walmartimages.com/asr/942aa939-d135-484c-ab41-e645ee099dda.8ce5481d678bd12aae4cc9b2a369aca5.jpeg",
"https://i5.walmartimages.com/asr/ed1bc8a0-d47d-42c0-a167-9cefe3e6170c.9da822d5eb858ac4ce9d4c03cab3f315.jpeg",
"https://i5.walmartimages.com/asr/62b426e2-2511-4843-99a4-0d90281c119b.b251f1ef1c668146db23b3db2a021f42.jpeg",
"https://i5.walmartimages.com/asr/9c42930c-23ea-43d2-9bb8-9c369455ae86.3b0dacec606d08749f3745952fcfb1f1.jpeg",
"https://i5.walmartimages.com/asr/7bbac8f4-e273-4cc5-9945-cc090fac6c48.db24ccb54ee687215411d34aa5206c61.jpeg",
"https://i5.walmartimages.com/asr/b5e22489-1812-4ff5-906c-8a4ef6caa60e.8185f831f875b753a13ea6647fa77308.jpeg",
"https://i5.walmartimages.com/asr/432a3619-7fba-4d5d-935e-36c5d56657c1.3aadbd7347240fcc087a25e2c356b001.jpeg"
],
"title": "Ninja Crispi Glass Air Fryer 4-Qt, 3-in-1, Non-Toxic, Air Fry Recrisp, Portable, Dishwasher Safe, FN090 White",
"price": "$89",
"listing_sales_volume_of_month": 232578,
"listing_sales_of_month": "$20699442",
"brand": "Ninja",
"seller": "Walmart",
"shipedby": "WFS",
"wfs_fee": 0,
"reviews_count": 2597,
"ratings": 4.6,
"number_of_star": [1, 115, 2, 33, 3, 58, 4, 107],
"node_tree": [],
"attribute": null,
"label": [],
"popular_pick": false,
"clearance": false,
"reduced_price": false,
"rollback": false,
"flash_deal": false,
"weight": 0,
"variants": null,
"first_reviews_date": null
},
{
"product_id": "19950367748",
"parent_product_id": "19950367748",
"photo": [
"https://i5.walmartimages.com/seo/Chefman-Turbofry-8-Qt-Air-Fryer-w-Digital-Controls-Windowed-Basket-Stainless-Steel_0603781f-e265-4829-b1f7-33223c9168ac.9ab16d901a3987f4bc41062674b8678c.jpeg",
"https://i5.walmartimages.com/asr/77b411ed-fa20-4c43-a941-d06d8861cd6e.5281e5221b8ecfb7739bfd2c26a3a7ba.jpeg",
"https://i5.walmartimages.com/asr/3937729a-5666-444e-8148-5c43c2e2a8f3.c2ad0c92424387fb091bd289eb0b9538.jpeg",
"https://i5.walmartimages.com/asr/baec1b09-6f3a-4b20-bf0e-e9e5b25a391b.95f4e8e4a2e9531395ed03b80039eacd.jpeg",
"https://i5.walmartimages.com/asr/51a25adc-cf16-4e7f-97a8-922bac5faf63.2b67de210537c0ec4e1d0f717ec4d9da.jpeg",
"https://i5.walmartimages.com/asr/5025eda4-7b9b-40c3-80d1-6a2b57164ab1.de64bdc4a7c969e57dce967d1e73bb9f.jpeg",
"https://i5.walmartimages.com/asr/917f4091-d33b-459f-9f72-046cd8c0488a.2d21eaea698c0e8efcda22a704ed58b1.jpeg",
"https://i5.walmartimages.com/asr/560dffc7-453f-4a10-9690-c6f05df08c5a.3494b06a1a62c519d48ce0a0937756b8.jpeg"
],
"title": "Chefman Turbofry 8 Qt Air Fryer w/ Digital Controls & Windowed Basket - Stainless Steel",
"price": "$67.99",
"listing_sales_volume_of_month": 14994,
"listing_sales_of_month": "$1019442.06",
"brand": "Chefman",
"seller": "Chefman Direct",
"shipedby": "Fulfillment by Merchant",
"wfs_fee": 0,
"reviews_count": 496,
"ratings": 4.5,
"number_of_star": [1, 18, 2, 3, 3, 22, 4, 44],
"node_tree": [],
"attribute": null,
"label": [],
"popular_pick": true,
"clearance": false,
"reduced_price": false,
"rollback": false,
"flash_deal": false,
"weight": 0,
"variants": null,
"first_reviews_date": null
}
]
}错误响应、请求追踪和限流头说明见错误与限流。