1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "products": [
12 "rice",
13 "spices"
14 ],
15 "minScore": 40,
16 "maxDiscoveryChargeUsd": 0.5,
17 "postedWithinDays": 14,
18 "maxPagesPerBoard": 2,
19 "sourceMode": "list",
20 "itemsList": [
21 {
22 "product": "1121 Golden Sella Basmati Rice (sample)",
23 "board": "go4worldbusiness",
24 "boardLeadId": "sample-1001",
25 "sample": true,
26 "url": "https://www.go4worldbusiness.com/buyers/basmati-rice.html",
27 "buyerName": "Gulf Star Foodstuff Trading LLC (sample)",
28 "country": "AE",
29 "quantity": 2,
30 "unit": "Twenty-Foot Container",
31 "paymentTerms": "LC at sight",
32 "destination": "Jebel Ali, United Arab Emirates",
33 "sourcingCountries": "India, Pakistan",
34 "postedText": "2 days ago",
35 "contactShown": "premium members",
36 "description": "Please quote for 1121 golden sella basmati rice, 5 kg and 25 kg PP bags, moisture 12 % max, broken 2 % max. Shipping terms: CIF Jebel Ali. Monthly requirement for our distribution company."
37 },
38 {
39 "product": "Turmeric Finger, Polished, Curcumin 3 %+ (sample)",
40 "board": "alibaba",
41 "boardLeadId": "sample-1002",
42 "sample": true,
43 "url": "https://sourcing.alibaba.com/rfq/rfq_search_list.htm#rfq-1002",
44 "country": "NL",
45 "quantity": 10,
46 "unit": "Metric Ton/Metric Tons",
47 "postedText": "3 days ago",
48 "quotesLeft": 4,
49 "contactShown": "after login",
50 "description": "We import spices for the Benelux food industry. Looking for polished turmeric fingers, curcumin 3 % minimum, EU MRL compliant, 25 kg jute bags. FOB Indian port, first order 10 MT then quarterly."
51 },
52 {
53 "product": "Non Basmati Rice (sample)",
54 "board": "exportersindia",
55 "boardLeadId": "sample-1003",
56 "sample": true,
57 "url": "https://www.exportersindia.com/buyers/rice.htm",
58 "country": "IN",
59 "quantity": 50,
60 "unit": "Metric Ton",
61 "paymentTerms": "online",
62 "destination": "Chennai, Tamil Nadu, India",
63 "postedText": "1 day ago",
64 "contactShown": "after login",
65 "description": "I am interested in buying Non Basmati Rice · Requirement: Urgent · Frequency: Monthly · Buys: Sona masoori rice, Ponni rice"
66 },
67 {
68 "product": "Black Pepper 550 GL Required (sample)",
69 "board": "tradekey",
70 "boardLeadId": "sample-1004",
71 "sample": true,
72 "url": "https://importer.tradekey.com/black-pepper-importer.html",
73 "country": "GB",
74 "quantity": 5,
75 "unit": "MT",
76 "postedText": "4 days ago",
77 "contactShown": "premium members",
78 "description": "We have buyers in the UK for black pepper 550 GL and work on commission on behalf of our client. Send your best price."
79 },
80 {
81 "product": "Rice Mill Machine, 5 Tons per Day (sample)",
82 "board": "alibaba",
83 "boardLeadId": "sample-1005",
84 "sample": true,
85 "url": "https://sourcing.alibaba.com/rfq/rfq_search_list.htm#rfq-1005",
86 "country": "NG",
87 "quantity": 1,
88 "unit": "Set/Sets",
89 "postedText": "5 days ago",
90 "quotesLeft": 6,
91 "contactShown": "after login",
92 "description": "Need a complete rice milling plant line, 5 TPD, with destoner, husker and polisher."
93 }
94 ]
95};
96
97
98const run = await client.actor("rich_minds/buy-leads-ai").call(input);
99
100
101console.log('Results from dataset');
102console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
103const { items } = await client.dataset(run.defaultDatasetId).listItems();
104items.forEach((item) => {
105 console.dir(item);
106});
107
108