List top products
Changed onRetrieve your store's top products ranked by views or sales over a 30, 60, or 90 day window, or all-time where the platform supports it.
Entries are the connected store platform's product ids (e.g. the numeric Shopify product id) ranked best-first. Each entry carries the product title, resolved live from the connected store; it is null when the store cannot supply it (no connected store, the product was deleted, or the store API was unreachable). Full product details are at GET /v1/products/{id}. Every response repeats this in an in-band note.
Rankings are served from a daily-refreshed cache. refreshed_at is the cache timestamp; null means this metric/window combination has never been computed (as opposed to computed and empty) — the request itself enqueues the background refresh that fills it, so retry after a short wait.
Platform support differs by metric, and for views by window. Windowed view rankings (window_days 30, 60, or 90) require a connected Shopify store: dated product views are only tracked through Shopify's Web Pixel, so those windows return an empty ranking on every other platform. All-time view rankings (window_days=0) come from the store platform's own view counter and are available for BigCommerce only — BigCommerce exposes a per-product view count with no date dimension, so it can be ranked all-time but never windowed. Shopify has no such counter, so window_days=0 returns an empty ranking for a Shopify-only store; a store connected to both platforms is ranked from its BigCommerce counter.
The all-time ranking is built by scanning the BigCommerce catalog, and that scan is capped at 25,000 products. On a larger catalog it covers the products scanned rather than the whole catalog, so treat it as approximate there.
sales is derived from synced order data and works for any store that syncs orders to Privy (Shopify, BigCommerce, Wix, and orders submitted through the API). There is no all-time sales bucket, so metric=sales with window_days=0 is rejected.
Required scope: reports_read
Request
- Base URLhttps://api.privy.com/v1
- AuthHTTP bearer
Query parameters
Ranking metric. views availability depends on the store's platform and the requested window (see the operation description); sales works for any store that syncs orders to Privy.
Ranking window in days. 0 means all-time, which is supported for metric=views on BigCommerce stores only and is rejected for metric=sales.
Page number (starts at 1).
Number of results per page. Values outside 10–100 are clamped to the nearest bound.
Headers
Target a subaccount instead of the main connected account. Pass a subaccount id from get_account's subaccounts list. Only direct subaccounts of the connected account are reachable — omit this for the main account itself.
Response
The ranked product ids for the requested metric and window.
Example response
{
"pagination": {
"page": 1,
"per_page": 25,
"total_count": 142,
"total_pages": 6
}
}Changes
- warning
added the new
forbiddenenum value to the/response property for the response status - warning
added the new
forbiddenenum value to the/response property for the response status - warning
added the new
forbiddenenum value to the/response property for the response status - warning
added the new
forbiddenenum value to the/response property for the response status - warning
added the new
segment_builder_requiredenum value to the/response property for the response status - warning
added the new
segment_builder_requiredenum value to the/response property for the response status - warning
added the new
segment_builder_requiredenum value to the/response property for the response status - warning
added the new
segment_builder_requiredenum value to the/response property for the response status
- warning
- info
endpoint added
- info