1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "productKeywords": [
12 "email marketing",
13 "newsletter tool"
14 ],
15 "sourceMode": "list",
16 "offer": "Email marketing tool for Shopify stores",
17 "maxDiscoveryChargeUsd": 0.5,
18 "itemsList": [
19 {
20 "id": "1971839201584730112",
21 "url": "https://x.com/mayachenmakes/status/1971839201584730112",
22 "text": "Switching from Mailchimp, it's getting way too expensive for a 3k-subscriber list. What email marketing tool do other Shopify stores use?",
23 "createdAt": "Sat Sep 26 14:12:00 +0000 2026",
24 "lang": "en",
25 "likeCount": 14,
26 "replyCount": 1,
27 "retweetCount": 2,
28 "viewCount": 2310,
29 "isReply": false,
30 "isRetweet": false,
31 "conversationId": "1971839201584730112",
32 "searchTerm": "(\"Mailchimp alternative\" OR \"switching from Mailchimp\") -filter:nativeretweets -filter:links lang:en",
33 "authorId": "1402937745",
34 "authorUsername": "mayachenmakes",
35 "authorName": "Maya Chen (sample)",
36 "authorDescription": "Founder @threadandloom Β· handmade linen on Shopify Β· ecommerce nerd",
37 "authorFollowers": 2140,
38 "authorFollowing": 610,
39 "authorLocation": "Portland, OR",
40 "authorUrl": "https://threadandloom.example",
41 "authorCreatedAt": "Tue Mar 03 09:00:00 +0000 2015",
42 "authorIsBlueVerified": false,
43 "authorIsAutomated": false,
44 "authorProtected": false
45 },
46 {
47 "id": "1971802655010341201",
48 "url": "https://x.com/jdrewbakes/status/1971802655010341201",
49 "text": "Can anyone recommend a newsletter tool that plays nice with Shopify? Need abandoned-cart emails without paying a fortune.",
50 "createdAt": "Sat Sep 26 11:47:00 +0000 2026",
51 "lang": "en",
52 "likeCount": 6,
53 "replyCount": 0,
54 "retweetCount": 0,
55 "viewCount": 880,
56 "isReply": true,
57 "inReplyToUsername": "shopify",
58 "isRetweet": false,
59 "conversationId": "1971797001882240000",
60 "searchTerm": "(\"can anyone recommend\" OR \"any recommendations\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
61 "authorId": "2291840012",
62 "authorUsername": "jdrewbakes",
63 "authorName": "Jordan Drew (sample)",
64 "authorDescription": "Owner at Drew's Bakehouse. Sourdough, Shopify and too much coffee. hello@drewsbakehouse.example",
65 "authorFollowers": 860,
66 "authorFollowing": 402,
67 "authorLocation": "Leeds, UK",
68 "authorCreatedAt": "Fri Jun 12 18:30:00 +0000 2020",
69 "authorIsBlueVerified": false,
70 "authorIsAutomated": false,
71 "authorProtected": false
72 },
73 {
74 "id": "1971790112930027520",
75 "url": "https://x.com/kaylaships/status/1971790112930027520",
76 "text": "Our Klaviyo bill doubled this year and flows keep breaking. Seriously looking for a Klaviyo alternative for email marketing before our renewal in October.",
77 "createdAt": "Sat Sep 26 10:58:00 +0000 2026",
78 "lang": "en",
79 "likeCount": 41,
80 "replyCount": 3,
81 "retweetCount": 4,
82 "viewCount": 9120,
83 "isReply": false,
84 "isRetweet": false,
85 "conversationId": "1971790112930027520",
86 "searchTerm": "(\"Klaviyo alternative\" OR \"switching from Klaviyo\") -filter:nativeretweets -filter:links lang:en",
87 "authorId": "887123450",
88 "authorUsername": "kaylaships",
89 "authorName": "Kayla Ortiz (sample)",
90 "authorDescription": "Head of Growth at Northpeak Supply | DTC & ecommerce",
91 "authorFollowers": 5400,
92 "authorFollowing": 1210,
93 "authorLocation": "Austin, TX",
94 "authorUrl": "https://northpeak.example",
95 "authorCreatedAt": "Wed Jan 14 16:20:00 +0000 2015",
96 "authorIsBlueVerified": true,
97 "authorIsAutomated": false,
98 "authorProtected": false
99 },
100 {
101 "id": "1971761830077370988",
102 "url": "https://x.com/priyamakes/status/1971761830077370988",
103 "text": "Any recommendations for a newsletter tool that is free until 500 subscribers? Launching my candle shop on Shopify next week.",
104 "createdAt": "Sat Sep 26 09:05:00 +0000 2026",
105 "lang": "en",
106 "likeCount": 3,
107 "replyCount": 0,
108 "retweetCount": 0,
109 "viewCount": 410,
110 "isReply": false,
111 "isRetweet": false,
112 "isQuoteStatus": true,
113 "quoted_tweet": {
114 "text": "Launch week checklist for new Shopify stores: domain, payments, a welcome email."
115 },
116 "conversationId": "1971761830077370988",
117 "searchTerm": "(\"can anyone recommend\" OR \"any recommendations\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
118 "authorId": "1500021987",
119 "authorUsername": "priyamakes",
120 "authorName": "Priya Nair (sample)",
121 "authorDescription": "Frontend developer. Building a tiny candle shop on the side.",
122 "authorFollowers": 310,
123 "authorFollowing": 280,
124 "authorLocation": "Toronto",
125 "authorCreatedAt": "Mon Mar 07 12:00:00 +0000 2022",
126 "authorIsBlueVerified": false,
127 "authorIsAutomated": false,
128 "authorProtected": false
129 },
130 {
131 "id": "1971755002111823872",
132 "url": "https://x.com/benbuildsstuff/status/1971755002111823872",
133 "text": "We just launched our new email marketing tool for Shopify! 50% off with code LAUNCH50, link in bio",
134 "createdAt": "Sat Sep 26 08:38:00 +0000 2026",
135 "lang": "en",
136 "likeCount": 22,
137 "replyCount": 5,
138 "retweetCount": 6,
139 "viewCount": 4020,
140 "isReply": false,
141 "isRetweet": false,
142 "searchTerm": "(\"looking for\" OR \"best tool for\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
143 "authorId": "3301122334",
144 "authorUsername": "benbuildsstuff",
145 "authorName": "Ben Ruiz (sample)",
146 "authorDescription": "Building MailBloom, email for Shopify",
147 "authorFollowers": 1800,
148 "authorIsAutomated": false,
149 "authorProtected": false
150 },
151 {
152 "id": "1971740188200001536",
153 "url": "https://x.com/lumenhomegoods/status/1971740188200001536",
154 "text": "We're hiring an email marketing manager for our Shopify brand! Remote, 3 days a week. DM me.",
155 "createdAt": "Sat Sep 26 07:39:00 +0000 2026",
156 "lang": "en",
157 "likeCount": 9,
158 "replyCount": 2,
159 "retweetCount": 3,
160 "viewCount": 1500,
161 "isReply": false,
162 "isRetweet": false,
163 "searchTerm": "(\"looking for\" OR \"need a\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
164 "authorId": "4410092211",
165 "authorUsername": "lumenhomegoods",
166 "authorName": "Lumen Home Goods (sample)",
167 "authorDescription": "Home goods, made slowly. Shopify store.",
168 "authorFollowers": 7400,
169 "authorIsAutomated": false,
170 "authorProtected": false
171 },
172 {
173 "id": "1971722904455512064",
174 "url": "https://x.com/dealsdailyhq/status/1971722904455512064",
175 "text": "GIVEAWAY: RT and follow to win a 1-year newsletter tool subscription! #giveaway #shopify #email #marketing #ecommerce #win",
176 "createdAt": "Sat Sep 26 06:30:00 +0000 2026",
177 "lang": "en",
178 "likeCount": 120,
179 "replyCount": 64,
180 "retweetCount": 210,
181 "viewCount": 22000,
182 "isReply": false,
183 "isRetweet": false,
184 "searchTerm": "(\"looking for\" OR \"best tool for\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
185 "authorId": "5500112233",
186 "authorUsername": "dealsdailyhq",
187 "authorName": "Deals Daily (sample)",
188 "authorDescription": "Daily deals for makers",
189 "authorFollowers": 15800,
190 "authorIsAutomated": false,
191 "authorProtected": false
192 },
193 {
194 "id": "1971710077431996416",
195 "url": "https://x.com/marcuswebb_ecom/status/1971710077431996416",
196 "text": "Not looking for recommendations, just venting: email marketing deliverability in 2026 is a mess.",
197 "createdAt": "Sat Sep 26 05:39:00 +0000 2026",
198 "lang": "en",
199 "likeCount": 33,
200 "replyCount": 12,
201 "retweetCount": 2,
202 "viewCount": 6100,
203 "isReply": false,
204 "isRetweet": false,
205 "searchTerm": "(\"sick of\" OR \"frustrated with\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
206 "authorId": "6612300441",
207 "authorUsername": "marcuswebb_ecom",
208 "authorName": "Marcus Webb (sample)",
209 "authorDescription": "Ecommerce consultant. I help Shopify brands grow retention.",
210 "authorFollowers": 12800,
211 "authorIsAutomated": false,
212 "authorProtected": false
213 },
214 {
215 "id": "1971698830113120256",
216 "url": "https://x.com/shoptipsbot/status/1971698830113120256",
217 "text": "Looking for an email marketing tool? Here are 5 we tested for Shopify stores this month",
218 "createdAt": "Sat Sep 26 04:54:00 +0000 2026",
219 "lang": "en",
220 "likeCount": 2,
221 "replyCount": 0,
222 "retweetCount": 1,
223 "viewCount": 300,
224 "isReply": false,
225 "isRetweet": false,
226 "searchTerm": "(\"looking for\" OR \"best tool for\") (\"email marketing\" OR \"newsletter tool\") -filter:nativeretweets -filter:links lang:en",
227 "authorId": "7700998811",
228 "authorUsername": "shoptipsbot",
229 "authorName": "Shop Tips Bot (sample)",
230 "authorDescription": "Automated tips for online stores",
231 "authorFollowers": 950,
232 "authorIsAutomated": true,
233 "authorProtected": false
234 }
235 ],
236 "discoveryInput": {}
237};
238
239
240const run = await client.actor("rich_minds/twitter-lead-generation-ai").call(input);
241
242
243console.log('Results from dataset');
244console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
245const { items } = await client.dataset(run.defaultDatasetId).listItems();
246items.forEach((item) => {
247 console.dir(item);
248});
249
250