# E-Commerce Supplier Spy & Reverse Image Margin Finder (`vedarai/ecommerce-supplier-spy`) Actor

Extract products from any Shopify store over plain HTTP and run reverse image searches (Google Lens) to uncover original wholesale suppliers (Alibaba, AliExpress, Temu, DHgate, CJdropshipping, 1688), competing stores, and unit profit margins.

- **URL**: https://apify.com/vedarai/ecommerce-supplier-spy.md
- **Developed by:** [Artūras](https://apify.com/vedarai) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.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

## E-Commerce Supplier Spy

Extracts product catalogs from Shopify storefronts via HTTP JSON endpoints and runs reverse image lookups on each product's primary image to locate wholesale supplier listings (Alibaba, AliExpress, Temu, DHgate, CJdropshipping, 1688, Made-in-China, GlobalSources) alongside competing independent stores.

### Architecture and workflow

Instead of running a headless browser against rendered store pages, the actor queries Shopify's native `/products.json` (or `/collections/{handle}/products.json`) endpoint using `got-scraping` with browser TLS fingerprints. If a storefront has disabled the JSON feed, the actor falls back to parsing `application/ld+json` (`Product` schema) embedded in the HTML document.

Before sending product images to the reverse image search step, CDN resize suffixes (`_small`, `_compact`, `_480x480`, and width/height query parameters) are stripped from `cdn.shopify.com` URLs so the lookup runs against the full-resolution image asset.

Each returned visual match is normalized by hostname and sorted into one of three buckets. Matches from wholesale marketplaces (`alibaba.com`, `aliexpress.com`, `aliexpress.us`, `temu.com`, `dhgate.com`, `cjdropshipping.com`, `1688.com`, `made-in-china.com`, `globalsources.com`, `banggood.com`, `shein.com`, `lightinthebox.com`, plus any domains passed in `customSupplierDomains`) are placed in `suppliers`. Social networks and image boards (`pinterest.com`, `instagram.com`, `youtube.com`, `reddit.com`, `tiktok.com`) as well as links belonging to the target `storeUrl` itself are discarded. All remaining domains are placed in `competitors`.

### Reverse image search modes

The `lensProvider` input controls how visual matches are fetched:

In `serper` mode (or `auto` when an API key is available), the actor sends a `POST` request to `https://google.serper.dev/lens` using `serperApiKey` (or the `SERPER_API_KEY` environment variable). This is the fastest path (~0.8 to 1.5 seconds per image) and returns structured price tags extracted directly from Google Lens shopping cards.

In `apify_actor` mode, the actor collects all extracted Shopify image URLs first and invokes the actor specified in `apifyLensActorId` (defaults to `borderline/google-lens`) in a single batched `ApifyClient` run. Batching avoids spinning up a separate container per product, though total runtime still depends on the sub-actor's queue and incurs that actor's own compute usage.

In `direct_http` mode (used automatically when `lensProvider` is `auto` and no Serper key is configured), the actor queries public web and wholesale marketplace indices over HTTP using the product's title and domain exclusions. This works without external API keys, though visual-only matches where a dropshipper completely renamed the product require `serper` or `apify_actor` mode.

### Limitations and price parsing caveats

Wholesale platforms frequently display price ranges (for example `US $3.20 - $5.80` depending on minimum order quantity). The parser takes the lower bound as `lowestSupplierPrice` and also calculates `medianSupplierPrice` across all matched supplier listings that expose a price in their search snippet. Not every Google Lens card includes a price string; supplier matches without a parsed price are still returned in the `suppliers` array with `parsedPrice: null`, and margin calculations only use listings where a numeric price was present.

Currency values on supplier snippets are parsed as-is. If a target Shopify store sells in `GBP` or `EUR` while supplier snippets are indexed in `USD`, `estimatedGrossMargin` (`retailPrice - lowestSupplierPrice`) reflects the nominal difference without live FX conversion.

### Input example

```json
{
  "storeUrl": "https://www.gymshark.com/collections/accessories",
  "maxProducts": 15,
  "lensProvider": "auto",
  "serperApiKey": "your-optional-serper-api-key",
  "customSupplierDomains": [
    "spocket.co"
  ],
  "onlyInStock": true,
  "maxConcurrency": 5
}
```

### Output example

Each analyzed product is written to the default dataset:

```json
{
  "storeDomain": "lumahome.example.com",
  "productId": "7812345678901",
  "productTitle": "Sunset Projection LED Lamp",
  "productUrl": "https://lumahome.example.com/products/sunset-projection-led-lamp",
  "vendor": "LumaHome",
  "productType": "Lighting",
  "retailPrice": 39.99,
  "compareAtPrice": 59.99,
  "imageUrl": "https://cdn.shopify.com/s/files/1/0012/3456/products/lamp.jpg?v=1690001234",
  "supplierCount": 3,
  "lowestSupplierPrice": 3.2,
  "medianSupplierPrice": 4.8,
  "estimatedGrossMargin": 36.79,
  "estimatedMarginPercent": 92.0,
  "markupMultiplier": 12.5,
  "topSupplierUrl": "https://www.alibaba.com/product-detail/Sunset-Lamp_16002345.html",
  "topSupplierDomain": "alibaba.com",
  "competitorCount": 1,
  "suppliers": [
    {
      "title": "Wholesale USB Sunset Lamp Projector - Alibaba",
      "url": "https://www.alibaba.com/product-detail/Sunset-Lamp_16002345.html",
      "domain": "alibaba.com",
      "sourceName": "Alibaba",
      "parsedPrice": 3.2,
      "priceRaw": "$3.20",
      "currency": "USD",
      "thumbnailUrl": null,
      "matchSource": "serper_lens"
    },
    {
      "title": "Temu Sunset Lamp",
      "url": "https://www.temu.com/sunset-lamp-g-999.html",
      "domain": "temu.com",
      "sourceName": "Temu",
      "parsedPrice": 4.8,
      "priceRaw": "$4.80",
      "currency": "USD",
      "thumbnailUrl": null,
      "matchSource": "serper_lens"
    }
  ],
  "competitors": [
    {
      "title": "Other Dropship Competitor Store",
      "url": "https://glowvibes-shop.com/products/sunset-lamp",
      "domain": "glowvibes-shop.com",
      "sourceName": "GlowVibes",
      "parsedPrice": 34.99,
      "priceRaw": "$34.99",
      "currency": "USD",
      "thumbnailUrl": null,
      "matchSource": "serper_lens"
    }
  ],
  "lensProviderUsed": "serper_lens",
  "billingStatus": "BILLED_1_PRODUCT",
  "unitCostUsd": 0.01,
  "scrapedAt": "2026-11-11T08:40:00.000Z"
}
```

# Actor input Schema

## `storeUrl` (type: `string`):

Root domain or specific collection URL of a Shopify storefront (e.g. https://www.allbirds.com or https://example.com/collections/best-sellers).

## `storeUrls` (type: `array`):

Optional list of multiple Shopify store or collection URLs to analyze in a single run.

## `maxProducts` (type: `integer`):

Maximum number of products to extract and run through reverse image search across the run.

## `lensProvider` (type: `string`):

Select 'serper' for fast Google Lens REST API lookups (requires serperApiKey or SERPER_API_KEY env var), 'apify_actor' to batch-call an existing Apify Google Lens Actor via ApifyClient, or 'direct_http' for built-in HTTP reverse image & visual query lookup without external keys.

## `serperApiKey` (type: `string`):

API key for https://google.serper.dev/lens. If omitted, the actor checks process.env.SERPER_API_KEY or falls back according to the selected provider.

## `apifyLensActorId` (type: `string`):

Actor ID or username/actor-name called in a single batched run when lensProvider is set to 'apify_actor'.

## `customSupplierDomains` (type: `array`):

Extra wholesale domains to classify under 'suppliers' in addition to built-in marketplaces (alibaba.com, aliexpress.com, temu.com, dhgate.com, cjdropshipping.com, 1688.com, made-in-china.com, globalsources.com, banggood.com).

## `onlyInStock` (type: `boolean`):

Skip Shopify products where all variants are currently out of stock.

## `maxConcurrency` (type: `integer`):

Maximum number of parallel reverse image lookups.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings used for Shopify extraction and direct HTTP lookups.

## Actor input object example

```json
{
  "storeUrl": "https://www.allbirds.com",
  "storeUrls": [],
  "maxProducts": 20,
  "lensProvider": "auto",
  "apifyLensActorId": "borderline/google-lens",
  "customSupplierDomains": [],
  "onlyInStock": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset containing extracted store products, wholesale supplier links, competitor URLs, and margin calculations.

# 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 = {
    "storeUrl": "https://www.allbirds.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("vedarai/ecommerce-supplier-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 = { "storeUrl": "https://www.allbirds.com" }

# Run the Actor and wait for it to finish
run = client.actor("vedarai/ecommerce-supplier-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 '{
  "storeUrl": "https://www.allbirds.com"
}' |
apify call vedarai/ecommerce-supplier-spy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vedarai/ecommerce-supplier-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/zobkcZ2ZXYH0K47hD/builds/vtio0MaUQszsdCObU/openapi.json
