Apinoa Docs

Browse

列出某个 Walmart 类目下的商品,无需关键词。

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

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

请求

curl "https://gateway.apinoa.com/v1/walmart/browse?categoryId=3944_133251_1095191_1230614_1230478&ratingMin=4" \
  -H "x-api-key: $APINOA_API_KEY"

参数

参数类型必填说明
categoryIdstring是REQUIRED. The underscore-joined chain from a Walmart category URL, e.g. 3944_133251_1095191_1230614_1230478. A bare department or leaf id is refused with CATEGORY_NOT_BROWSABLE — use categories to walk down to a chain.
brandsstring listBrand names as the marketplace spells them, e.g. brands=Nike,Adidas.
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",
    "page": {
      "index": 1,
      "size": 39,
      "total": 2269
    },
    "items": [
      {
        "marketplace": "walmart",
        "id": "11381374703",
        "title": "Apple AirPods 4",
        "price": {
          "currency": "USD",
          "amount": 99
        },
        "listPrice": {
          "currency": "USD",
          "amount": 129.99
        },
        "url": "https://www.walmart.com/ip/Apple-AirPods-4/11381374703",
        "imageUrl": "https://i5.walmartimages.com/seo/Apple-AirPods-4_43ffea38-e233-4fee-8a6f-7ff92ad713ae.97d6d24546e5cbdfcdc0e2fa52c969b1.…",
        "seller": {
          "name": "Walmart.com",
          "id": "F55CDC31AB754BB68FE0B39041159D63"
        },
        "rating": {
          "average": 4.3,
          "count": 88450
        },
        "status": "In stock",
        "inStock": true,
        "delivery": {
          "carrier": "Shipping",
          "code": "SHIPPING",
          "estimate": "Free shipping, arrives today",
          "free": true
        },
        "shippingOptions": [
          {
            "carrier": "Delivery",
            "code": "DELIVERY",
            "estimate": "Delivery as soon as 13 mins"
          },
          {
            "carrier": "Shipping",
            "code": "SHIPPING",
            "estimate": "Free shipping, arrives today",
            "free": true
          }
        ],
        "deliveryTo": {
          "label": "Sacramento, CA 95829",
          "country": "US",
          "postalCode": "95829"
        },
        "offersSummary": {
          "count": 10
        },
        "category": [
          {
            "id": "3944",
            "name": "Electronics"
          },
          {
            "id": "133251",
            "name": "Audio"
          }
        ],
        "badges": [
          "Rollback"
        ],
        "promotions": [
          "Save with Walmart+"
        ],
        "attributes": [],
        "ext": {
          "optionsFromPrice": {
            "currency": "USD",
            "amount": 68
          }
        }
      }
    ],
    "facets": [
      {
        "id": "price",
        "name": "Price",
        "kind": "range",
        "values": [],
        "min": 0,
        "max": 160,
        "maps_to": "priceMin"
      },
      {
        "id": "brand",
        "name": "Brand",
        "kind": "select",
        "values": [
          {
            "value": "JLab",
            "name": "JLab"
          },
          {
            "value": "JBL",
            "name": "JBL"
          }
        ],
        "maps_to": "brands"
      }
    ]
  }
}

错误

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

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

价格

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

说明

  • categoryId 是以下划线连接的链,取自 Walmart 类目 URL:walmart.com/browse/<dept>/<slug>/3944_133251_1095191_1230614_1230478 对应 3944_133251_1095191_1230614_1230478。单独的叶子 id 无法解析;Categories 返回的是链。
  • 过滤器与 search 相同,只是没有关键词。 传入 query 会返回 400。
  • 响应中没有 query 键,其余与搜索响应完全相同。

本页内容