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": "relevance",
20 "searchCondition": "",
21 "searchOnSale": false,
22 "searchFetchFullDetails": false,
23 "enableListingDetails": false,
24 "listingIds": [],
25 "listingUrls": [],
26 "enableClosetListings": false,
27 "sellerUsernames": [
28 "poshmark"
29 ],
30 "sellerMaxListings": 30,
31 "enableSellerProfile": false,
32 "enableSoldHistory": false,
33 "soldMaxItems": 30,
34 "enableScrapeByUrl": false,
35 "scrapeUrls": [
36 "https://poshmark.com/search?query=vintage%20carhartt&type=listings"
37 ],
38 "webhookFormat": "json",
39 "proxyConfiguration": {
40 "useApifyProxy": true,
41 "apifyProxyGroups": [
42 "RESIDENTIAL"
43 ],
44 "apifyProxyCountry": "US"
45 }
46};
47
48
49const run = await client.actor("b2b_leads/poshmark-real-time-data-scraper").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59