Apinoa Docs

Search

按关键词搜索 Walmart,支持价格、评分、品牌和类目过滤。

查看原始 .mdx
GET | POST /v1/walmart/search

参数可以用 GET 的查询字符串发送,也可以用 POST 的 JSON 请求体发送,两者等价。

请求

curl "https://gateway.apinoa.com/v1/walmart/search?query=wool+socks&priceMax=30" \
  -H "x-api-key: $APINOA_API_KEY"

参数

参数类型必填说明
querystring是Keywords to search for. Required: image search is not available on Walmart, so a keyword query is the only way to search.
brandsstring listBrand names as the marketplace spells them, e.g. brands=Nike,Adidas.
categoryIdstringNarrow to one category, by the marketplace's own id. Opaque and per-marketplace; take it from Product.category[].id or from a result's facets.
facetsstring | object listNarrowings taken from a result's facets, e.g. facets=Color:Black. The escape hatch for filters the typed vocabulary has no word for; prefer a typed parameter where one exists.
pageinteger1-based results page. There is no pageSize — the results page is server-fixed at about 50 organic items — and no cursor, since paging here is by number.
priceMaxnumber ≥ 0Highest price to return, in decimal major units.
priceMinnumber ≥ 0Lowest price to return, in decimal major units.
ratingMinnumber 0–5Lowest average star rating to return, on the marketplace's own 0-5 scale.
regionstringBuyer country as ISO 3166-1 alpha-2; sets availability, shipping and price.
sortenumResult ordering: best_match, price_asc, price_desc, newly_listed or best_seller. Defaults to best_match, Walmart's own relevance ordering. best_match price_asc price_desc newly_listed best_seller

这些参数及所有响应类型也写在OpenAPI 文档中。

响应

在 data 中返回 SearchResult。 真实响应的节选:数组只保留前几项,长文本已截断。

{
  "success": true,
  "data": {
    "marketplace": "walmart",
    "query": "wool socks",
    "page": {
      "index": 1,
      "size": 47,
      "total": 4888
    },
    "items": [
      {
        "marketplace": "walmart",
        "id": "344144554",
        "title": "Genuine Dickies Men's Wool Thermal Crew Sock, 3 Pack, Shoe Size 6-12",
        "price": {
          "currency": "USD",
          "amount": 15.98
        },
        "brand": "Dickies",
        "url": "https://www.walmart.com/ip/Genuine-Dickies-Men-s-Wool-Thermal-Crew-Sock-3-Pack-Shoe-Size-6-12/344144554",
        "imageUrl": "https://i5.walmartimages.com/seo/Genuine-Dickies-Men-s-Wool-Thermal-Crew-Sock-3-Pack-Shoe-Size-6-12_7f83249a-fb07-4602-…",
        "seller": {
          "name": "Walmart.com",
          "id": "F55CDC31AB754BB68FE0B39041159D63"
        },
        "rating": {
          "average": 4.7,
          "count": 552
        },
        "status": "In stock",
        "inStock": true,
        "sponsored": true,
        "category": [
          {
            "id": "5438",
            "name": "Clothing"
          },
          {
            "id": "133197",
            "name": "Mens Clothing"
          }
        ],
        "badges": [],
        "promotions": [],
        "attributes": []
      }
    ],
    "facets": [
      {
        "id": "suggested",
        "name": "Suggested",
        "kind": "select",
        "values": [
          {
            "value": "Merino Wool",
            "name": "Merino Wool"
          },
          {
            "value": "Crew",
            "name": "Crew"
          }
        ]
      },
      {
        "id": "brand",
        "name": "Brand",
        "kind": "select",
        "values": [
          {
            "value": "Loritta",
            "name": "Loritta"
          },
          {
            "value": "Wrangler",
            "name": "Wrangler"
          }
        ],
        "maps_to": "brands"
      }
    ]
  }
}

错误

状态代码含义
400INVALID_PARAMS参数缺失、未知或超出范围。消息中会指出是哪一个。
401UNAUTHORIZED缺少 x-api-key 请求头,或密钥已吊销或未知。
402INSUFFICIENT_BALANCE余额不足以支付本次调用。请在控制台充值。
429MARKETPLACE_SATURATED并发调用过多。请等待 Retry-After 秒后重试。
502UPSTREAM_ERROR平台返回了无法使用的内容。请退避后重试。

全部错误代码见 Errors。失败的调用不计费。

价格

价格 每次调用 $0.001。标价;单日调用超过 1,000 次后单价下调。

说明

  • ratingMin 会对齐到评分区间。 Walmart 按评分区间过滤("4 – 5 Stars"、"3 – 3.9 Stars"),因此请求会选择仍能满足条件的最低区间:3.5 选择 4–5,而 4.5 不发送评分过滤,因为没有区间能满足它。
  • 按 page 分页。 每页条数固定为约 50 条,因此没有 pageSize,也没有 cursor。
  • 不支持: condition、freeShipping、inStock。

本页内容