# Shopify Sales & Revenue Spy - Inventory Delta & Bestsellers (`emancip/shopify-store-sales-revenue-delta-spy`) Actor

Track competitor Shopify daily revenue, unit sales velocity, and bestselling products using automated inventory delta math and cart quantity leaks. Calculates daily sales volume, stock depletion rates, and total catalog valuation with zero store admin access needed.

- **URL**: https://apify.com/emancip/shopify-store-sales-revenue-delta-spy.md
- **Developed by:** [EmanCip](https://apify.com/emancip) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🛍️ Shopify Sales & Revenue Delta Spy

> Competitor E-Commerce Intelligence: Track any competitor Shopify store's **daily revenue ($)**, **exact units sold**, **bestselling product rankings**, and **variant stockout velocity** using automated inventory delta math and cart quantity validation leaks — with **zero store admin access needed**.

***

### ⚡ Key Features

- **Mathematical 24-Hour Inventory Delta:** Automatically calculates daily sales by tracking inventory decrements over time:
  $$\text{Units Sold}*i = \max(0, \text{Stock}*{t-1} - \text{Stock}\_t)$$
  $$\text{Daily Store Revenue} = \sum (\text{Units Sold}\_i \times \text{Price}\_i)$$
- **Shopify Cart Availability Leak:** Exploits Shopify's native `/cart/add.js` inventory validation error responses to reveal exact remaining stock quantities even on stores that hide inventory counts from their theme.
- **Bestselling Product Rankings:** Identifies the top 20% of catalog SKUs generating 80% of competitor daily cashflow.
- **Total Catalog Retail Valuation:** Computes total on-hand inventory asset value based on active product variants and catalog pricing.
- **Fast-Depleting SKU Alerts:** Detects viral products with high sales velocity before they sell out.
- **Zero Proxies & Zero API Keys:** Operates in pure Python directly against public Shopify JSON endpoints with 100% reliability.

***

### 📥 Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `stores` | `array` | *tentree.com, allbirds.com* | List of target Shopify store domains or URLs. |
| `maxProductsPerStore` | `integer` | `100` | Maximum catalog products to index per store (10 to 1,000). |
| `checkCartStockLeaks` | `boolean` | `true` | Probe cart availability validation to extract real-time remaining stock quantities. |
| `maxVariantsToProbe` | `integer` | `15` | Number of top variants to verify exact stock counts on via cart quantity checks. |

***

### 📤 Output Data Format (JSON)

```json
{
  "store_domain": "tentree.com",
  "store_url": "https://tentree.com",
  "analysis_mode": "LIVE_24H_INVENTORY_DELTA",
  "estimated_daily_revenue_usd": "$14,850.00",
  "estimated_units_sold": 264,
  "total_catalog_valuation_usd": "$248,320.00",
  "total_products_count": 100,
  "total_variants_count": 420,
  "in_stock_ratio_percent": 88.5,
  "average_product_price_usd": 48.50,
  "bestselling_products_summary": [
    {
      "product_title": "Classic Juniper Hoodie",
      "variant_title": "Black / M",
      "price_usd": 68.00,
      "units_sold": 42,
      "revenue_generated_usd": 2856.00,
      "current_stock": 18
    }
  ],
  "exact_cart_stock_leaks_found": [
    {
      "product": "Cortes Socks (2-Pack)",
      "variant": "LXL",
      "price": "$14.00",
      "exact_stock_remaining": 1,
      "status": "EXACT_STOCK_LEAK"
    }
  ]
}
```

***

### 🎯 High-Value Use Cases

1. **Competitor Revenue Intelligence:** Track the exact daily cashflow and sales volume of rival e-commerce brands.
2. **Winning Product Sourcing:** Discover runaway bestseller products in any niche to source and sell on your own stores.
3. **Inventory Depletion & Restock Monitoring:** Track when competitors run low on inventory to capture demand during stockouts.
4. **Market & Niche Validation:** Validate consumer demand before launching new private-label product lines.

***

### 💰 Pay-Per-Event (PPE) Pricing

- **Actor Start:** `$0.01`
- **Per Analyzed Shopify Store:** `$0.005` (`$5.00` per 1,000 competitor stores analyzed)
- **Proxy Cost:** `$0.00` (100% pure profit)

# Actor input Schema

## `stores` (type: `array`):

Enter target Shopify store domains (e.g. 'tentree.com', 'gymshark.com') or store URLs ('https://www.allbirds.com').

## `maxProductsPerStore` (type: `integer`):

Maximum number of catalog products to scrape and index per store.

## `checkCartStockLeaks` (type: `boolean`):

Probes Shopify's cart availability validation to extract exact real-time remaining stock quantities for top variants.

## `maxVariantsToProbe` (type: `integer`):

Number of top product variants to verify exact stock counts on via cart quantity validation.

## Actor input object example

```json
{
  "stores": [
    "tentree.com",
    "https://www.allbirds.com"
  ],
  "maxProductsPerStore": 100,
  "checkCartStockLeaks": true,
  "maxVariantsToProbe": 15
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing competitor Shopify daily revenues, bestselling product rankings, units sold, variant stock depletion rates, and catalog valuations.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "stores": [
        "tentree.com",
        "https://www.allbirds.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("emancip/shopify-store-sales-revenue-delta-spy").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "stores": [
        "tentree.com",
        "https://www.allbirds.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("emancip/shopify-store-sales-revenue-delta-spy").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "stores": [
    "tentree.com",
    "https://www.allbirds.com"
  ]
}' |
apify call emancip/shopify-store-sales-revenue-delta-spy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,emancip/shopify-store-sales-revenue-delta-spy"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jLFN0Is6gSTUNtMnW/builds/gp9wbbg4Ag9JYtyS1/openapi.json
