Get variants API
Overview
The Get variants API lists customer favorite preferences such as size, color, or material.
Endpoint
GET https://marketplace.walmartapis.com/v3/growth/assortment/recommendations/variants Functionality
This API can help you:
- Find product variants and demand trends.
- Compare pricing variations and offers that competitors are making.
- Decide which product variations are primary or non-primary.
- Drive inventory and pricing decisions at the product variations level.
Request sample
curl --request GET \ --url https://marketplace.walmartapis.com/v3/growth/assortment/recommendations/variants \ --header 'accept: application/json'
import requests url = "https://marketplace.walmartapis.com/v3/growth/assortment/recommendations" headers = { "accept": "application/json", "content-type": "application/json", # Include your auth + required Walmart headers as applicable in your integration.
} payload = { "recommendationType": "ITEM", "meta": {"limit": 2}
} resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
print(resp.json())
Modify your code
Add authentication and tracing headers.
Include required Marketplace credentials and optional tracing headers:
\--header 'Authorization: Bearer \<ACCESS_TOKEN>' \\ \--header 'WM_CONSUMER.ID: \<CONSUMER_ID>' \\ \--header 'WM_QOS.CORRELATION_ID: <unique-id>'
Response sample 200 All item recommendations
{ "payload": { "meta": { "totalRecords": 12, "recordsFetched": 2, "limit": 200, "nextCursor": "FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFkxxYXVqbDdDU215YlJmTzVoY1V3cGcAAAAAAAAbXhZzRk1VYTR0RlRLbTBHYm4zZWxXaFRB" }, "primaryVariantItemId": "B0BQPH9CNF", "records": [ { "itemRecommendationUniqueId": "2023736962", "itemDetails": { "title": "Nintendo Super Mario Bomber Jacket, Mario and Luigi Bomber Jacket", "brand": "Nintendo", "category": "Clothing", "productType": "Outerwear Jackets", "gtin": "00197347024339", "upc": "0019734702433", "ean": "0197347024339", "itemAvailabilityStatus": "EXISTING_IN_WALMART", "potentialSales": "$0-$10K", "shoppingTrends": [ "Best sellers" ], "demandSalesTrends": [ "OCT", "FEB", "DEC", "NOV", "JAN", "MAR" ], "offerCount": 1, "walmart": { "itemId": "2023736962", "url": "www.walmart.com/ip/2023736962", "itemPrice": { "amount": 42.99, "currency": "USD" }, "shippingPrice": { "amount": 0, "currency": "USD" } }, "competitors": [ { "itemId": "B0BQPH9CNF", "url": "www.amazon.com/dp/B0BQPH9CNF", "itemPrice": { "amount": 51.99, "currency": "USD" }, "shippingPrice": { "amount": 0, "currency": "USD" } } ], "freeShipping": "NO", "ratingCount": 1832, "rating": 4.7, "variantInfo": [ { "name": "Color", "value": "Bowser Black" }, { "name": "Size", "value": "4" } ], "isPrimaryVariant": true } }, { "itemRecommendationUniqueId": "3744707969", "itemDetails": { "title": "Nintendo Super Mario Bomber Jacket, Mario and Luigi Bomber Jacket", "brand": "Nintendo", "category": "Clothing", "productType": "Outerwear Jackets", "itemAvailabilityStatus": "EXISTING_IN_WALMART", "potentialSales": "$0-$10K", "shoppingTrends": [ "Best sellers" ], "demandSalesTrends": [ "OCT", "FEB", "DEC", "NOV", "JAN", "MAR" ], "offerCount": 1, "walmart": { "itemId": "3744707969", "url": "www.walmart.com/ip/3744707969", "itemPrice": { "amount": 42.99, "currency": "USD" }, "shippingPrice": { "amount": 0, "currency": "USD" } }, "competitors": [ { "itemId": "B0BQP6JSFF", "url": "www.amazon.com/dp/B0BQP6JSFF", "itemPrice": { "amount": 48.99, "currency": "USD" }, "shippingPrice": { "amount": 0, "currency": "USD" } } ], "freeShipping": "NO", "ratingCount": 1786, "rating": 4.8, "variantInfo": [ { "name": "Color", "value": "Bowser Black" }, { "name": "Size", "value": "5-6" } ], "isPrimaryVariant": false } } ] }
}
Result
- You receive variant-level recommendation entries grouped under a
primaryVariantItemId. - Each record includes variant metadata, pricing (Walmart + competitor), shipping, rating, demand signals, and
variantInfo(for example, color, size). isPrimaryVariantidentifies whether the record is the primary variant for that group.- Use
nextCursorto fetch additional variant records (ifrecordsFetched<totalRecords).
Next steps
- Get recommendations API: Makes suggestions about what to sell on Walmart Marketplace based on market trends, customer-favorite items, high demand items over the past 30 days, and gaps in your product availability.
- Get categorization API: Provides a primary sort of the brands by recommendation count, then a secondary sort in alphabetical order.
- Reject recommendations API: Lets you reject items Walmart recommends. If you reject a recommended item, you won’t see it again.
- Get recommendation trends API: Provides trend data about your assortment on Walmart, including price and demand trends, so you can respond quickly to maintain a competitive edge.
Updated about 17 hours ago
