AxioAPI

Monitor Shopify competitor prices with Python

2026-10-05

Public Shopify stores publish their product catalog. The Shopify catalog API returns it as JSON, so you can track prices without maintaining your own scraper. This guide builds a small script that detects price changes.

What the API returns

GET /api/v1/ecommerce/shopify/catalog takes a domain, an optional limit up to 250 and a page number. Each product includes its variants with price, compare-at price, availability and SKU.

The script

The script pages through the catalog, stores a snapshot of variant prices in a JSON file and prints any variant whose price differs from the previous run.

import json
import os
import pathlib

import requests

API = "https://axioapi.com/api/v1/ecommerce/shopify/catalog"
HEADERS = {"Authorization": f"Bearer {os.environ['AXIOAPI_KEY']}"}


def fetch_prices(domain):
    prices, page = {}, 1
    while True:
        response = requests.get(API, headers=HEADERS, timeout=60,
                                params={"domain": domain, "limit": 250, "page": page})
        response.raise_for_status()
        products = response.json()["data"]["products"]
        for product in products:
            for variant in product["variants"]:
                prices[str(variant["id"])] = {
                    "name": f"{product['title']} / {variant['title']}",
                    "price": variant["price"],
                    "available": variant["available"],
                }
        if len(products) < 250:
            return prices
        page += 1


def main(domain):
    snapshot = pathlib.Path(f"{domain}.json")
    current = fetch_prices(domain)
    previous = json.loads(snapshot.read_text()) if snapshot.exists() else {}

    for variant_id, item in current.items():
        old = previous.get(variant_id)
        if old and old["price"] != item["price"]:
            print(f"{item['name']}: {old['price']} -> {item['price']}")

    snapshot.write_text(json.dumps(current))


if __name__ == "__main__":
    main("example.com")

How often to run it

Responses can be cached for up to two hours for the same request, so running it more often than every couple of hours will not show newer data. A daily or hourly schedule is usually enough for price tracking.

Limits and good practice

  • Only public Shopify stores work. A store that hides its catalog returns an error.
  • Large catalogs need several pages; each page is a billed request.
  • Respect the store's terms and the laws that apply to you when you use competitor data.