1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "trendingSearches",
12 "region": "US",
13 "trendType": "topMonthly",
14 "lookbackWindow": "30D",
15 "interest": "all",
16 "moment": "all",
17 "keywordsToInclude": [],
18 "keywordsToExclude": [],
19 "ageGroup": "all",
20 "gender": "all",
21 "keywords": [],
22 "days": 90,
23 "predictedDays": 0,
24 "includeRelated": false,
25 "includeAudience": false,
26 "includeImages": false,
27 "includeSuggestions": false,
28 "shoppingEvent": "OUTBOUND_CLICK",
29 "includeTopCategories": false,
30 "categoryNames": [],
31 "maxItems": 3
32};
33
34
35const run = await client.actor("vexaloom-labs/pinterest-trending-topics-and-shopping-category").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45