跳到正文
DEV Community· PennyData·· 4 小時前AI 評分48

將商店網域清單轉成 Shopify 潛在客戶名單:公開電郵、社交連結及產品數量(Python)

Turn a list of store domains into a Shopify lead sheet: public email, socials and product count (Python)

AI 導讀

這個 Python 流程透過 Apify 的 pennydata/shopify-store-leads-contacts Actor,將網域清單整理成潛在客戶表,收集公開聯絡資料及產品數量。

正文

PennyData

If you sell to online stores (agencies, app developers, 3PLs), you often start with a plain list of domains and need to know which are Shopify stores and how to reach them. The public details are usually on the site already: a support email, social links, a product feed. Collecting them by hand takes minutes per store. Here is a way to do it for a whole list with one API call and pandas.

1. Input

The actor is pennydata/shopify-store-leads-contacts (Apify Store). It takes the domains you already have; it does not search for stores by keyword. It uses plain HTTP (no browser) and detects Shopify and WooCommerce.

{
  "domains": [
    { "url": "allbirds.com" },
    { "url": "kith.com" },
    { "url": "example.com" }
  ],
  "maxConcurrency": 1
}

Domains that are not Shopify or WooCommerce, are blocked, or do not resolve come back as rows with a status explaining why, so one bad domain never fails the run.

2. Run it and build the sheet

Get an Apify API token (Console, Settings, Integrations), then pip install requests pandas.

import os, requests, pandas as pd

URL = "https://api.apify.com/v2/acts/pennydata~shopify-store-leads-contacts/run-sync-get-dataset-items"
domains = ["allbirds.com", "kith.com", "example.com"]   # or read your CSV
body = {"domains": [{"url": d} for d in domains], "maxConcurrency": 1}

r = requests.post(URL, params={"token": os.environ["APIFY_TOKEN"]}, json=body, timeout=280)
r.raise_for_status()
items = r.json()

ok = [x for x in items if x.get("status") == "ok"]
skipped = [(x.get("input"), x.get("reason") or x.get("status")) for x in items if x.get("status") != "ok"]

df = pd.DataFrame([{
    "domain": x["domain"],
    "platform": x["platform"],
    "store": x.get("storeName"),
    "email": ", ".join(x.get("emails", [])),
    "phone": ", ".join(x.get("phones", [])),
    "instagram": x.get("socials", {}).get("instagram"),
    "products": x.get("productCount"),
    "currency": x.get("currency"),
    "lead_score": x.get("leadScore"),
} for x in ok]).sort_values("lead_score", ascending=False)

df.to_csv("store-leads.csv", index=False)
print(df.to_string(index=False))
print("skipped:", skipped)

leadScore is a simple 0-100 score built from what was found (public email, number of social links, catalogue size, store description); leadScoreSignals lists the reasons for each row, so you can sort or filter without guessing.

What a row looks like

From a real run on 2026-10-22:

{
  "input": "allbirds.com",
  "status": "ok",
  "platform": "shopify",
  "storeName": "Allbirds",
  "leadScore": 75,
  "currency": "USD",
  "emails": ["help@allbirds.com"],
  "phones": [],
  "socials": {
    "instagram": "https://www.instagram.com/allbirds",
    "facebook": "https://www.facebook.com/weareallbirds",
    "tiktok": "https://www.tiktok.com/@weareallbirds"
  },
  "productCount": 692,
  "technologies": ["Google Tag Manager", "Cloudflare"],
  "contactPagesChecked": ["/pages/contact-us"]
}

socials also carried pinterest, twitter and youtube links in that run (trimmed above). A non-Shopify domain such as example.com returns status: "skipped" with reason: "not_shopify".

Limits worth knowing

  • Only what the store publishes is returned. In a 100-brand test run on 2026-10-21, about 40% of the Shopify stores showed a public email, and some big brands blocked the request with HTTP 403 or 429. Small independent stores behave differently, so treat that as a sample.
  • Keep maxConcurrency low for polite crawling; the actor respects robots.txt.
  • Business contact details only. If you email them, follow CAN-SPAM/GDPR rules for B2B outreach, and check the addresses before sending (for example with a bulk validator) so you do not bounce.
  • run-sync times out after 300 seconds; for large lists start a normal run and poll it.

Actor page and current pay-per-event pricing: https://apify.com/pennydata/shopify-store-leads-contacts

I publish this actor on Apify and earn from its runs. Written with AI assistance (Claude).

來源:DEV Community · dev.to