1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "pinDetail",
12 "startUrls": [],
13 "keywords": [
14 "minimalist home office"
15 ],
16 "pinUrls": [
17 "https://www.pinterest.com/pin/142567144448888376/"
18 ],
19 "usernames": [
20 "nasa"
21 ],
22 "boardUrls": [
23 "https://www.pinterest.com/nasa/ceres/"
24 ],
25 "ideaUrls": [
26 "https://www.pinterest.com/ideas/beauty/935541271955/"
27 ],
28 "ideaSlugs": [],
29 "maxItems": 1,
30 "urls": [],
31 "language": "en",
32 "maxPages": 10,
33 "verifiedOnly": false,
34 "requireOutboundLink": false,
35 "imageOnly": false,
36 "excludeAds": false,
37 "commerceOnly": false,
38 "enrichPinDetails": false,
39 "includeComments": false,
40 "maxComments": 10,
41 "limit": 10
42};
43
44
45const run = await client.actor("crawlerbros/pinterest-scraper-pro").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55