1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "namespace": "demo-campaign",
12 "batchId": "demo-001",
13 "observedAt": "2026-10-13T12:00:00Z",
14 "posts": [
15 {
16 "id": "3333333333333333333",
17 "shortCode": "CygCarousel",
18 "url": "https://www.instagram.com/p/CygCarousel/?example=synthetic",
19 "type": "Sidecar",
20 "timestamp": "2026-10-12T10:00:00Z",
21 "caption": "Synthetic carousel 🌿",
22 "likesCount": -1,
23 "commentsCount": 0,
24 "ownerUsername": "cygnix_example",
25 "childPosts": [
26 {
27 "id": "child-synthetic-1",
28 "type": "Image",
29 "displayUrl": "https://example.invalid/photo.jpg",
30 "customField": {
31 "retained": true
32 }
33 },
34 {
35 "id": "child-synthetic-2",
36 "type": "Video",
37 "videoUrl": "https://example.invalid/video.mp4"
38 }
39 ]
40 },
41 {
42 "id": "4444444444444444444",
43 "shortCode": "CygReel",
44 "url": "https://www.instagram.com/p/CygReel/",
45 "type": "Video",
46 "productType": "clips",
47 "timestamp": "2026-10-11T12:00:00+02:00",
48 "likesCount": 0,
49 "videoViewCount": null,
50 "videoPlayCount": 72,
51 "audioUrl": "https://example.invalid/audio.mp3"
52 },
53 {
54 "id": "5555555555555555555",
55 "shortCode": "CygImage",
56 "type": "Image",
57 "timestamp": "2026-10-12T08:00:00Z",
58 "caption": "Example image without supplied engagement counts",
59 "sourceExtra": {
60 "retained": true
61 }
62 }
63 ],
64 "timezone": "UTC",
65 "epochUnit": "seconds",
66 "rightsAcknowledged": false
67};
68
69
70const run = await client.actor("cygnix_labs/cygnix-instagram-export-cleaner").call(input);
71
72
73console.log('Results from dataset');
74console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
75const { items } = await client.dataset(run.defaultDatasetId).listItems();
76items.forEach((item) => {
77 console.dir(item);
78});
79
80