1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "autoReplies": [
12 {
13 "id": "ooo-maria",
14 "fromEmail": "jordan.lee@brightbloom.example",
15 "subject": "Automatic reply: Spring collab idea",
16 "text": "Hi there,\n\nThanks for your email. I'm out of the office on annual leave and will return on Monday, November 23, 2026, with limited access to email.\n\nFor anything marketing related, please contact my colleague Maria Lopez, Head of Growth, at maria.lopez@brightbloom.example or +1 (555) 010-2233.\nFor invoices and payments, email billing@brightbloom.example.\n\nBest,\nJordan Lee\nBrand Manager | Brightbloom Skincare\njordan.lee@brightbloom.example | +1 555 010 9999"
17 },
18 {
19 "id": "left-priya",
20 "fromEmail": "priya.shah@northpeak.example",
21 "subject": "Re: Wholesale pricing",
22 "text": "Priya Shah is no longer with Northpeak Outdoor. Her last day was October 30.\n\nPlease direct partnership and wholesale questions to Daniel Okafor (Director of Business Development) at daniel.okafor@northpeak.example. For order status and shipping, contact our logistics team at logistics@northpeak.example.\n\nThis mailbox is no longer monitored."
23 },
24 {
25 "id": "ooo-social",
26 "fromEmail": "sam@loomandlark.example",
27 "subject": "Out of Office",
28 "text": "I'm currently travelling for a trade show and back in the office on 12/02.\n\nIn my absence, our Social Media Manager, Chloe Martin (chloe@loomandlark.example), is covering creator and influencer requests. Anything urgent can go to our founder Ben Hart on 07700 900123.\n\nCheers,\nSam"
29 },
30 {
31 "id": "other-helpdesk",
32 "fromEmail": "support@cartwheelgoods.example",
33 "subject": "We received your message [Ticket #48213]",
34 "text": "Thanks for contacting Cartwheel Goods! This is an automated confirmation that we received your message. Our team replies within 1 to 2 business days.\n\nPlease do not reply to this email. Sent from noreply@cartwheelgoods.example"
35 },
36 {
37 "id": "ooo-plain-noalt",
38 "fromEmail": "alex.wu@harborlane.example",
39 "subject": "Automatic reply",
40 "text": "Hello,\n\nI am on parental leave until 15 January 2027 and will not be checking email. I will respond to your message when I return.\n\nThank you,\nAlex Wu"
41 },
42 {
43 "id": "es-ooo",
44 "fromEmail": "lucia.fernandez@solymar.example",
45 "subject": "Respuesta automática: Propuesta",
46 "text": "Hola,\n\nEstoy fuera de la oficina de vacaciones hasta el 2 de diciembre de 2026, con acceso limitado al correo.\n\nPara temas urgentes, contacte con mi compañera Carmen Ruiz, responsable de marketing, en carmen.ruiz@solymar.example o al +34 912 345 678.\n\nSaludos,\nLucía Fernández"
47 },
48 {
49 "id": "fr-left",
50 "fromEmail": "julien.moreau@atelierlumen.example",
51 "subject": "Réponse automatique",
52 "text": "Bonjour,\n\nJulien Moreau ne fait plus partie de l'équipe Atelier Lumen.\n\nPour toute demande commerciale, veuillez contacter Élodie Bernard, directrice commerciale : elodie.bernard@atelierlumen.example.\nPour la comptabilité : compta@atelierlumen.example.\n\nCordialement"
53 },
54 {
55 "id": "de-ooo",
56 "fromEmail": "markus.becker@waldwerk.example",
57 "subject": "Abwesenheitsnotiz",
58 "text": "Guten Tag,\n\nich bin bis einschließlich 27.11.2026 nicht im Büro und habe keinen Zugriff auf meine E-Mails.\n\nIn dringenden Fällen wenden Sie sich bitte an meine Kollegin Anna Schmidt (Leiterin Logistik) unter anna.schmidt@waldwerk.example oder +49 30 1234567.\n\nMit freundlichen Grüßen\nMarkus Becker"
59 },
60 {
61 "id": "html-left",
62 "fromEmail": "kate.oneill@ferncrest.example",
63 "subject": "Kate has left Ferncrest",
64 "text": "<p>Hi,</p><p>Kate O'Neill has left Ferncrest Home as of November 6. Kate's accounts have been taken over by <a href=\"mailto:tom.becker@ferncrest.example\">Tom Becker</a>, our Ecommerce Director.</p><p>For press and PR, email <a href=\"mailto:press@ferncrest.example\">press@ferncrest.example</a>.</p>"
65 },
66 {
67 "id": "ooo-card",
68 "fromEmail": "nina@coastcandle.example",
69 "subject": "OOO until Dec 1",
70 "text": "Thanks for reaching out! I'm out of office until Tuesday, Dec 1 for a family event.\n\nIf you need something before then, please contact:\nRosa Diaz\nOperations Manager\nrosa.diaz@coastcandle.example\n(555) 010-4477\n\nTalk soon,\nNina Park\nFounder, Coast Candle Co.\nnina@coastcandle.example"
71 }
72 ]
73};
74
75
76const run = await client.actor("kingly_contest_7cb/autoreply-contact-extractor").call(input);
77
78
79console.log('Results from dataset');
80console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
81const { items } = await client.dataset(run.defaultDatasetId).listItems();
82items.forEach((item) => {
83 console.dir(item);
84});
85
86