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": "sample-en",
14 "text": "From: Sarah O'Connor <sarah.oconnor@globex.com>\nSubject: Re: Q1 campaign\n\nHi Tom,\n\nSounds great - I will send the brief tomorrow morning.\n\nBest regards,\nSarah O'Connor\nVP of Marketing | Globex Inc.\nM: +1 646 555 0199 | O: (212) 555-0147\n350 Fifth Avenue, Suite 4100, New York, NY 10118\nwww.globex.com | linkedin.com/in/sarahoconnor | Twitter: @sarahoconnor\n\nOn Mon, Nov 16, 2026 at 9:12 AM Tom Baker <tom@example.com> wrote:\n> Can you share the brief?\n> Tom"
15 },
16 {
17 "id": "sample-fr",
18 "text": "Bonjour,\n\nJe vous prie de trouver ci-joint notre proposition.\n\nCordialement,\n\nJean DUPONT\nDirecteur Commercial\nSociété Générale de Logistique SAS\n12 rue de la Paix\n75002 Paris\nTél : 01 42 68 53 00\nPortable : 06 12 34 56 78\njean.dupont@sgl-logistique.fr\n\nCe message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires."
19 }
20 ]
21};
22
23
24const run = await client.actor("freecamp008/email-signature-parser").call(input);
25
26
27console.log('Results from dataset');
28console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
29const { items } = await client.dataset(run.defaultDatasetId).listItems();
30items.forEach((item) => {
31 console.dir(item);
32});
33
34