1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "searchUrl": "https://www.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
10 "allListingType": "all-cars",
11 "zip": "72076",
12 "searchRadius": 50,
13 "makeCodes": [
14 "BMW",
15 "TOYOTA",
16 ],
17 "listingTypes": [
18 "USED",
19 "NEW",
20 "CERTIFIED",
21 "3P_CERT",
22 ],
23 "sellerTypes": [
24 "d",
25 "p",
26 ],
27 "newSearch": True,
28 "sortBy": "relevance",
29 "maxItems": 0,
30 "proxyConfiguration": {
31 "useApifyProxy": True,
32 "apifyProxyGroups": ["RESIDENTIAL"],
33 },
34}
35
36
37run = client.actor("rigelbytes/autotrader-scraper").call(run_input=run_input)
38
39
40print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
41for item in client.dataset(run["defaultDatasetId"]).iterate_items():
42 print(item)
43
44