-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.py
More file actions
54 lines (40 loc) · 1.8 KB
/
quickstart.py
File metadata and controls
54 lines (40 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""
Quickstart: analyze a single Shopify store.
pip install -r requirements.txt
export APIFY_API_TOKEN=apify_api_xxxxxx
python examples/quickstart.py
"""
from shopify_analyzer import ShopifyAnalyzerClient
def main() -> None:
client = ShopifyAnalyzerClient() # picks up APIFY_API_TOKEN from env
store = "https://allbirds.com"
rec = client.analyze_one(store)
print(f"\n=== {rec['domain']} ===\n")
traffic = rec.get("traffic") or {}
revenue = rec.get("revenue_estimate") or {}
print(f"Monthly visits: {traffic.get('monthly_visits') or '-':,}")
print(f"Monthly revenue: ${revenue.get('monthly_revenue_usd_est') or 0:,}")
print(f"Annualized: ${revenue.get('annualized_revenue_usd_est') or 0:,}")
print(f"AOV: ${rec.get('avg_order_value') or 0}")
print(f"Brand age: {rec.get('estimated_brand_age_years') or '-'} years")
print(f"Customer segment: {rec.get('customer_segment') or '-'}")
print(f"Marketing mix: {rec.get('marketing_channel_mix') or '-'}")
print(f"\nTech stack ({len(rec.get('tech_stack') or [])}):")
for app in rec.get("tech_stack") or []:
print(f" - {app}")
tracking = rec.get("tracking_ids") or {}
if tracking:
print(f"\nTracking IDs:")
for k, v in tracking.items():
print(f" - {k}: {v}")
ann = rec.get("announcement") or {}
if ann:
print(f"\nActive promo:")
for k, v in ann.items():
print(f" - {k}: {v}")
print(f"\nDropshipper risk: {rec.get('dropshipper_risk_score', 0)}/100 "
f"({rec.get('dropshipper_risk_bucket', '?')})")
for reason in rec.get("dropshipper_signals") or []:
print(f" • {reason}")
if __name__ == "__main__":
main()