1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "shortCode": "SyntheticDemoIG",
14 "type": "Video",
15 "caption": "Synthetic Instagram demo record. Replace this with your scraped data.",
16 "ownerUsername": "rdn_synthetic_demo",
17 "likesCount": 12,
18 "commentsCount": 3,
19 "videoViewCount": 120
20 },
21 {
22 "id": "9000000000000000001",
23 "webVideoUrl": "https://www.tiktok.com/@rdn_synthetic_demo/video/9000000000000000001",
24 "text": "Synthetic TikTok demo record. Replace this with your scraped data.",
25 "authorMeta": {
26 "name": "rdn_synthetic_demo"
27 },
28 "diggCount": 24,
29 "commentCount": 6,
30 "playCount": 240
31 }
32 ]
33};
34
35
36const run = await client.actor("jfinny/research-data-normalizer").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46