1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "headers": [
12 "Received: from mail.example.com (mail.example.com [192.0.2.1])\n\tby mx.google.com with ESMTPS id abc123;\n\tMon, 01 Jan 2024 00:00:00 -0800 (PST)\nFrom: sender@example.com\nTo: recipient@example.com\nSubject: Test message\nDate: Mon, 01 Jan 2024 00:00:00 -0800\nMessage-ID: <abc123@example.com>"
13 ]
14};
15
16
17const run = await client.actor("gochujang/email-header-analyzer").call(input);
18
19
20console.log('Results from dataset');
21console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
22const { items } = await client.dataset(run.defaultDatasetId).listItems();
23items.forEach((item) => {
24 console.dir(item);
25});
26
27