Create a Shopify page of best sellers automatically

Using the Shopify API, create a collection of your best selling items that is directly updated by an aggregation of your orders data

Create a Shopify page of best sellers automatically
Interactive Example

Why use Shopify

There are a lot of businesses run on Shopify, as it allows for anyone to create a a website to sell their goods on. More than that, they can be customize as much or as little as needed to create the perfect ecommerce page. If you want to learn more about Shopify, follow me.

Automating your Shopify pages with dynamic data

So, now that you have your Shopify site working, how about you introduce some automation? This flow illustrates one way that Parabola can be used to create dynamic content on your Shopify site, but there are almost limitless other options.

In this flow, Parabola is used to maintain a Collect that represents the best selling items of all time. Your Shopify site can be set up to display this Collect on a page - so as Parabola updates the Collect, the website will update what products are shown. You can extend this logic to create Collects based on any attributes you define in Parabola. Maybe if its raining, you switch your landing page Collect to show rain products, automatically.

Working with Shopify collects

A Collect is essentially a list of product IDs in Shopify, so the overview is that this flow finds the best selling products (by number of units sold, but could be another metric), clears out the existing products from the Collect, and then updates the Collect with the list of product ID's found.

Connecting to the Shopify is easy with basic HTTP auth. You can use the Username and Passwords fields in Parabola, or you can just append the account ID and password to your URL like this: Notice how that URL is accessing the Orders endpoint.

With that data, it's easy to use the Group By step to aggregate the number of units sold of each product, and then with a few extra steps, we can filter for the top 10 items. This could be anything, though.

The bottom section pulls in the existing Collects, and filters for the one that this flow interacts with, then it uses the API Export to remove the existing products from the Collect. After that, the remaining steps are there to filter the list down to just the Collect ID. The goal here is to join it to every row of the product data.

Sending data to the Shopify API

Once we have every row containing a product id and Collect id, we are ready to create the payload for the Shopify API. The Text Merge step takes care of this by creating a column called collect that contains this structure: {"productid": {lineitems.productid},"collectionid": {collectionid}} Notice that {lineitems.productid} and {collectionid} are being used to merge in values from the data set. The structure is what Shopify requires in their API. It will be sent as something like this: {"collect":{"productid": 1234,"collectionid": 5555}} with one request per line of data.

Start automating with Parabola
Parabola is free to use for teams of any size. We also offer paid plans with additional features and support.