A brand asks a familiar question: what is the competition discounting this week? Opening every product page can take longer than writing the brief.
Here is a small Python workflow that exports public product data from two Shopify stores and turns discounted variants into a spreadsheet. A freelancer can use the sheet to prepare an assortment review for a client, with a link back to each product.
I maintain the Shopify Product Scraper used to collect the data. It is a paid Actor. This example uses a snapshot, so the report describes the data observed at collection time.
1. Export the product data
In the Actor input, add the public home URLs of two Shopify stores that you want to compare. This example uses Kith and Allbirds as two public retail stores. Select Extract mode, set the product limit to 20 per store, and set Maximum cost per run to $0.03 before starting.
{
"mode": "extract",
"stores": [
"https://kith.com",
"https://www.allbirds.com"
],
"maxProducts": 20
}
Download the dataset as JSON and save it as products.json. Product rows include a variants array. Each variant may have a price and a compare-at price, which merchants can use to indicate an earlier or reference price.
On 11 November 2026, the listed Free-tier pricing is $0.001 per Actor start plus $0.0004 per returned product. At one gigabyte or less, 40 returned products have an estimated Actor charge of $0.017. Check the Pricing tab and the run details for your plan and actual charge.
2. Create a discount shortlist
Save this script as shopify_brief.py. Run it with Python 3 from the folder containing products.json.
import csv
import json
import sys
with open(sys.argv[1], encoding="utf-8") as source:
products = json.load(source)
def safe(value):
value = str(value if value is not None else "")
if value.lstrip().startswith(("=", "+", "-", "@")) or value.startswith(("\t", "\r", "\n")):
return "'" + value
return value
rows = []
for product in products:
for variant in product.get("variants") or []:
price = variant.get("price")
previous = variant.get("compareAtPrice")
if not isinstance(price, (float, int)) or isinstance(price, bool):
continue
if not isinstance(previous, (float, int)) or isinstance(previous, bool) or previous <= price or previous <= 0:
continue
rows.append({
"store": product.get("store") or "",
"product": product.get("title") or "",
"variant": variant.get("title") or "",
"price": price,
"compare_at_price": previous,
"currency": product.get("currency") or "",
"discount_percent": round((previous - price) * 100 / previous, 1),
"product_url": product.get("url") or "",
})
rows.sort(key=lambda row: row["discount_percent"], reverse=True)
fields = ["store", "product", "variant", "price", "compare_at_price", "currency", "discount_percent", "product_url"]
with open("discounts.csv", "w", encoding="utf-8", newline="") as output:
writer = csv.DictWriter(output, fieldnames=fields)
writer.writeheader()
for row in rows:
writer.writerow({key: safe(value) for key, value in row.items()})
print(f"Saved {len(rows)} discounted variants to discounts.csv")
Run:
python shopify_brief.py products.json
Open discounts.csv in a spreadsheet. The script keeps variants whose compare-at price is greater than their current price, calculates the percentage difference, and lists the largest observed discounts first. It preserves the currency and links to the product. Review the product page and verify the variant before using a row in a client report.
In my test on 11 November 2026, the Actor returned 20 products per store. None of the returned variants had a compare-at price, so the CSV contained no discounted variants. This outcome applies to that limited sample.
For a concrete example, a fictional variant priced at $60 with a compare-at price of $100 would appear with a 40% discount. That calculation describes the two displayed prices. It does not independently verify when or whether the higher price was charged.
3. Use the shortlist in a client brief
Pick a category shared by both stores and inspect a handful of relevant products. Note the product, variant, current price, displayed reference price, discount and source URL. Add a short observation about how each store presents its offer, such as a bundle or a seasonal collection. Check currency and observation date before comparing.
A one-off export produces a useful starting point. For a weekly report, save dated exports and compare matching products and variants across snapshots. Each run's limit and catalog coverage affect what you can conclude.
This article was generated by AI, based on a tested workflow. The price example is fictional.
Top comments (0)