1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "emails": [
12 {
13 "id": "ooo-de",
14 "from": "Petra Muster <petra@example.de>",
15 "subject": "Abwesenheitsnotiz: Re: Ihre Anfrage",
16 "text": "Vielen Dank für Ihre Nachricht. Ich bin bis zum 12.10. nicht im Büro. In dringenden Fällen wenden Sie sich bitte an info@example.de."
17 },
18 {
19 "id": "bounce",
20 "raw": "From: Mail Delivery System <MAILER-DAEMON@mx.example.net>\nSubject: Mail delivery failed: returning message to sender\nContent-Type: text/plain\n\nThis message was created automatically by mail delivery software.\n\nA message that you sent could not be delivered to one or more of its\nrecipients. This is a permanent error. The following address(es) failed:\n\n info@nobody.example\n host mx.nobody.example [203.0.113.5]\n SMTP error from remote mail server after RCPT TO:<info@nobody.example>:\n 550 5.1.1 User unknown\n"
21 },
22 {
23 "id": "human",
24 "from": "Hans Huber <hans@example.de>",
25 "subject": "Re: Ein Punkt auf example.de",
26 "text": "Guten Tag, danke für den Hinweis. Schicken Sie mir gern ein Angebot.\n\nAm 01.10.2026 um 10:12 schrieb Antonio:\n> Dies ist eine automatische Zusammenfassung ..."
27 }
28 ]
29};
30
31
32const run = await client.actor("infinit_bubulus/email-reply-classifier").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42