1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [
10 { "url": "https://www.facebook.com/humansofnewyork" },
11 { "url": "https://www.facebook.com/NASA" },
12 ],
13 "pageNames": [],
14 "maxPostsPerPage": 20,
15 "onlyPostsNewerThan": "",
16 "onlyPostsOlderThan": "",
17 "minReactions": 0,
18 "minComments": 0,
19 "minShares": 0,
20 "minVideoViews": 0,
21 "includeKeywords": [],
22 "excludeKeywords": [],
23 "maxCommentsPerPost": 20,
24 "onlyNewRowsStore": "",
25 "proxyConfiguration": { "useApifyProxy": True },
26}
27
28
29run = client.actor("apimy/facebook-posts-scraper").call(run_input=run_input)
30
31
32print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
33for item in client.dataset(run.default_dataset_id).iterate_items():
34 print(item)
35
36