1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "searchKeywords": [],
10 "startUrls": [{ "url": "https://www.facebook.com/marketplace/1312315172298841/search?minPrice=10000&maxMileage=60000&minYear=1980&sortBy=creation_time_descend&query=Vehicles&category_id=546583916084032&exact=false&referral_ui_component=category_menu_item" }],
11 "locationSlug": "dallas",
12 "maxItems": 5,
13 "maxPagesPerSearch": 1,
14 "scrapeItemDetails": False,
15 "duplicateCheckApiUrl": "https://ccscraperapi.up.railway.app/api/listings/exists",
16 "proxyConfiguration": {
17 "useApifyProxy": True,
18 "apifyProxyGroups": ["RESIDENTIAL"],
19 "apifyProxyCountry": "US",
20 },
21}
22
23
24run = client.actor("fmchisti/facebook-marketplace-vehicles-scraper").call(run_input=run_input)
25
26
27print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
28for item in client.dataset(run.default_dataset_id).iterate_items():
29 print(item)
30
31