1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [
10 "https://www.facebook.com/NASA/posts/pfbid05iTU3evLJsniFub2nbTVz6Yq4CnWKPZdGLnPt4nJ7tQmRvmjpphruNdz2jmfc4w7l",
11 "https://www.facebook.com/bbcnews/posts/pfbid0vhfgXVk8cN6Y9P3zRiqu84cizVGTFtJTNUMZQwN7fXtH9wWsg1EK6stRfG6gKCpyl",
12 "https://www.facebook.com/nasa",
13 "https://www.facebook.com/natgeo",
14 ],
15 "searchQueries": [],
16 "maxResults": 10,
17 "sort": "latest",
18 "minReactions": 0,
19 "minComments": 0,
20 "minShares": 0,
21 "mediaTypes": [],
22 "authorInclude": [],
23 "authorExclude": [],
24 "sourceTypes": [],
25 "locations": [],
26 "maxResultsPerSource": 0,
27 "stopAfterConsecutiveOldPosts": 3,
28 "skipPostIds": [],
29 "skipUrls": [],
30 "includeUnavailableRows": False,
31 "proxyConfiguration": { "useApifyProxy": True },
32}
33
34
35run = client.actor("coregent/facebook-posts-scraper").call(run_input=run_input)
36
37
38print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
39for item in client.dataset(run.default_dataset_id).iterate_items():
40 print(item)
41
42