1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "country": "US",
10 "enableListingSearch": True,
11 "searchKeywords": [
12 "carhartt detroit jacket",
13 "vintage 90s levis 501",
14 "patagonia fleece",
15 ],
16 "searchMaxResults": 10,
17 "searchSort": "created_time",
18 "searchItemCondition": [],
19 "searchStatus": ["STATUS_ON_SALE"],
20 "searchFetchFullDetails": False,
21 "enableListingDetails": False,
22 "itemIds": [],
23 "itemUrls": [],
24 "enableClosetListings": False,
25 "enableSellerProfile": False,
26 "enableSoldHistory": False,
27 "sellerIds": [],
28 "sellerUsernames": [],
29 "sellerMaxListings": 30,
30 "soldMaxItems": 30,
31 "enableScrapeByUrl": False,
32 "scrapeUrls": ["https://www.mercari.com/search/?keyword=vintage%20levis"],
33 "scrapeMaxPages": 3,
34 "includeDescription": True,
35 "includeShippingDetails": True,
36 "includeSellerDetails": True,
37 "webhookFormat": "json",
38 "proxyConfiguration": {
39 "useApifyProxy": True,
40 "apifyProxyGroups": ["RESIDENTIAL"],
41 "apifyProxyCountry": "US",
42 },
43}
44
45
46run = client.actor("b2b_leads/mercari-real-time-data-scraper").call(run_input=run_input)
47
48
49print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
50for item in client.dataset(run.default_dataset_id).iterate_items():
51 print(item)
52
53