1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchQueries": [
13 "nature"
14 ],
15 "mediaType": "photos",
16 "orientation": "all",
17 "size": "all",
18 "color": "all",
19 "colorHex": "",
20 "peopleCount": "all",
21 "peopleAge": "all",
22 "locale": "en-US",
23 "minWidth": 0,
24 "minHeight": 0,
25 "minFps": 0,
26 "minDuration": 0,
27 "maxDuration": 0,
28 "publishedAfter": "",
29 "publishedBefore": "",
30 "mediaIds": [
31 "18872916"
32 ],
33 "username": "alex-ivanov-773258579",
34 "collectionSlug": "aquatic-aesthetic-bw7dkse",
35 "maxItems": 3,
36 "includeDetails": false,
37 "dedupe": true,
38 "proxyConfiguration": {
39 "useApifyProxy": false
40 }
41};
42
43
44const run = await client.actor("nimbryxo-studio/pexels-stock-media-scraper-2").call(input);
45
46
47console.log('Results from dataset');
48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54