
Shopify Store Leads Scraper for JavaScript and Node.js: Shopify detection and store contacts in your backend
Call the Shopify Store Leads Scraper from JavaScript with this repository, a single ES module on top of the official apify-client package. Post it a batch of domains and it answers with one object per site: is Shopify serving it, which signal proved that, and what the homepage offers for getting in touch with the brand, from an email address and social profiles to the page title and store currency. Apify does the probing in the cloud, so a Node service, a serverless function or a CLI tool only has to start the run and read the objects. Files land in results.json and results.csv; import the call into your own code and the objects never need to touch disk.
Actor: Shopify Store Leads Scraper · Publisher: Devil Scrapes · Also in Python: shopify-store-leads-scraper-python
🔥 What you get
- Three checks, applied in order: the store's
/products.json catalogue feed first, then the homepage response headers, then Shopify asset and theme markers in the homepage HTML. detection_method says which check settled the question.
- A verdict even when the catalogue feed is closed: a store that refuses
/products.json can still be confirmed from its headers or its page source; it simply arrives without product data.
- Contact signals from the front page: the first
mailto: address (or, failing that, the first address-shaped string in the page source), links to Facebook, Instagram, X/Twitter, TikTok, YouTube, LinkedIn and Pinterest, and the <title> text.
- A small product sample: up to
maxProductsSample product names from the catalogue feed, plus the shop currency whenever the feed or the page source declares one.
- Audit mode: set
onlyShopify to false and every domain you sent comes back, misses marked is_shopify: false, which is how you measure Shopify's share of a list.
- Failures stay visible: a run that reached its domains but found no Shopify store succeeds with zero rows, while a run in which no domain answered at all fails, so a network problem never looks like an empty market.
🎯 Use cases
Platform lookup during onboarding
Put the core call behind an Express or Fastify route that accepts a website. Your sign-up flow can then ask whether a new customer's shop runs on Shopify before offering the Shopify integration, and is_shopify is the only field the route has to return.
CRM enrichment from a webhook
When a company is created in HubSpot, Pipedrive or an in-house CRM, a webhook can pass its website to a serverless function that starts the Actor and writes email, currency and the social URLs back onto the record. The lead reaches a rep with the platform question already settled.
Nightly prospect refresh
Schedule node index.js from GitHub Actions or a cron container against your full target list, then upsert each object keyed by domain. Comparing the new is_shopify value with the stored one shows which brands migrated overnight.
Route leads by market
The currency field is a cheap signal for where a shop trades. Split the objects by currency and push EUR stores to the Europe team's queue and USD stores to North America, no geo-IP service required.
⚡ Quick start
You need an Apify account and an API token from Console → Settings → Integrations. Apify's free plan includes monthly usage credit; this Actor's event prices are listed under Pricing below.
git clone https://github.com/devilscrapes/shopify-store-leads-scraper-javascript.git
cd shopify-store-leads-scraper-javascript
npm install
export APIFY_TOKEN=your_token_here
node index.js # uses input.json
node index.js my-input.json --out data --max-charge 2
The script starts the Shopify Store Leads Scraper, waits for it to finish, prints a link to the run in Apify Console and saves every result to results.json and results.csv. It exits with code 1 and the run's status message if the run fails.
🧩 The core call
Strip away the argument handling and file writes and index.js comes down to the snippet below. call() resolves once the run has finished, and listItems() hands back the dataset's objects as one array.
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('DevilScrapes/shopify-store-leads-scraper').call({"domains": ["allbirds.com", "gymshark.com"], "includeProducts": true, "maxProductsSample": 5, "onlyShopify": true, "maxResults": 2, "proxyConfiguration": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
📥 Input
index.js sends input.json exactly as written. It checks two apparel brands, samples five product names per store and caps the run at two objects, so trying it spends a start event plus two row events. In production, load the domains from your database and decide whether maxResults is a budget guard or 0 for no cap.
{
"domains": [
"allbirds.com",
"gymshark.com"
],
"includeProducts": true,
"maxProductsSample": 5,
"onlyShopify": true,
"maxResults": 2,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
}
}
| Field |
Type |
Required |
Default |
Allowed values |
domains |
array |
yes |
["allbirds.com", "gymshark.com"] |
— |
includeProducts |
boolean |
no |
true |
— |
maxProductsSample |
integer |
no |
10 |
— |
onlyShopify |
boolean |
no |
true |
— |
maxResults |
integer |
no |
50 |
— |
proxyConfiguration |
object |
no |
{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]} |
— |
📤 Output
You receive one object per domain. product_count is the length of the sample the Actor requested, at most maxProductsSample, not the store's full inventory, so do not show it to users as catalogue size. Values the storefront did not reveal arrive as null or [], which keeps the defensive checks in your handlers short.
| Field |
Type |
Always present |
domain |
string |
yes |
is_shopify |
boolean |
yes |
detection_method |
string or null |
no |
myshopify_domain |
string or null |
no |
product_count |
integer or null |
no |
sample_product_titles |
array |
no |
currency |
string or null |
no |
email |
string or null |
no |
social_links |
array |
no |
homepage_title |
string or null |
no |
scraped_at |
string |
yes |
💰 Pricing
| Event |
Price (USD) |
| Actor start |
$0.2 |
| Result row |
$0.0025 |
Prices as configured on 2026-10-16. The Actor page always shows the current price. Runs are billed to the Apify account that owns the token. Use --max-charge to cap what a single run can cost.
🛠️ Working with the data in JavaScript
This snippet relies on Node built-ins only. It keeps confirmed stores with at least one contact route, shapes each into a CRM-friendly payload and, when CRM_WEBHOOK_URL is set, POSTs the batch there; otherwise it prints the payloads to stdout.
import { readFile } from 'node:fs/promises';
const rows = JSON.parse(await readFile('results.json', 'utf8'));
const networkOf = (url) => {
const host = new URL(url).hostname.replace(/^www\./, '');
return { 'x.com': 'x', 'twitter.com': 'x' }[host] ?? host.split('.')[0];
};
const leads = rows
.filter((row) => row.is_shopify && (row.email || row.social_links?.length))
.map((row) => ({
company: row.homepage_title ?? row.domain,
website: `https://${row.domain}`,
email: row.email,
currency: row.currency,
socials: Object.fromEntries((row.social_links ?? []).map((url) => [networkOf(url), url])),
source: `shopify-check:${row.detection_method}`,
checkedAt: row.scraped_at,
}));
const hook = process.env.CRM_WEBHOOK_URL;
if (hook && leads.length > 0) {
const response = await fetch(hook, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ leads }),
});
console.log(`Delivered ${leads.length} leads, HTTP ${response.status}`);
} else {
console.log(JSON.stringify(leads, null, 2));
}
❓ FAQ
Is there a Shopify API that tells me whether a site is a Shopify store?
Shopify's own APIs operate per store, after the merchant installs your app or grants access, so they cannot classify a domain you do not control. This Actor answers from the outside, using what every storefront serves publicly, and needs nothing but your Apify token.
How do I tell a non-Shopify site from one that never answered?
With onlyShopify set to false, both come back as is_shopify: false with detection_method set to none. If no domain in the whole run answered, the run itself fails with a status message, which index.js turns into exit code 1. For per-domain detail, open the run log through the Console link the script prints.
Does it work with TypeScript?
Yes. apify-client bundles its own type definitions, so the core call compiles in a .ts file unchanged. Declare an interface for the fields listed under Output and pass it as the type parameter of client.dataset() to get typed objects back.
What does a run cost?
A $0.20 start event plus $0.0025 for each row written. Only emitted rows are billed, so with onlyShopify switched on, domains that turn out not to be Shopify cost nothing beyond the start. Pass --max-charge to put a hard ceiling on any single run.
🧯 Troubleshooting
Set APIFY_TOKEN first: export the token in the same shell, or put it in a local .env file your shell loads. Never commit it.
- Run finished with
FAILED or ABORTED: open the printed Console link; the run log says why. Input validation errors name the field.
- Fewer rows than expected: a
--max-charge cap also limits how many results can be charged. Raise the cap or lower the limits in your input.
- Something looks wrong in the data: open an issue on the Actor page so the maintainers see it.
🔗 More from Devil Scrapes
Related Actors:
MIT licensed example code. The Actor itself runs on Apify and is maintained by Devil Scrapes. Not affiliated with Shopify Inc..