1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "country": "US",
12 "enableListingSearch": true,
13 "searchKeywords": [
14 "carhartt detroit jacket",
15 "vintage 90s levis 501",
16 "patagonia fleece"
17 ],
18 "searchMaxResults": 10,
19 "searchSort": "created_time",
20 "searchItemCondition": [],
21 "searchStatus": [
22 "STATUS_ON_SALE"
23 ],
24 "searchFetchFullDetails": false,
25 "enableListingDetails": false,
26 "itemIds": [],
27 "itemUrls": [],
28 "enableClosetListings": false,
29 "enableSellerProfile": false,
30 "enableSoldHistory": false,
31 "sellerIds": [],
32 "sellerUsernames": [],
33 "sellerMaxListings": 30,
34 "soldMaxItems": 30,
35 "enableScrapeByUrl": false,
36 "scrapeUrls": [
37 "https://www.mercari.com/search/?keyword=vintage%20levis"
38 ],
39 "scrapeMaxPages": 3,
40 "includeDescription": true,
41 "includeShippingDetails": true,
42 "includeSellerDetails": true,
43 "webhookFormat": "json",
44 "proxyConfiguration": {
45 "useApifyProxy": true,
46 "apifyProxyGroups": [
47 "RESIDENTIAL"
48 ],
49 "apifyProxyCountry": "US"
50 }
51};
52
53
54const run = await client.actor("b2b_leads/mercari-real-time-data-scraper").call(input);
55
56
57console.log('Results from dataset');
58console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
59const { items } = await client.dataset(run.defaultDatasetId).listItems();
60items.forEach((item) => {
61 console.dir(item);
62});
63
64