1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "profiles",
10 "instanceUrl": "https://mastodon.social",
11 "profileSource": "both",
12 "urls": [
13 "https://mastodon.social/explore",
14 "https://mastodon.social/@Mastodon",
15 "https://mastodon.social/@Mastodon/with_replies",
16 "https://mastodon.social/@Mastodon/117466985005297414",
17 "https://mastodon.social/tags/news",
18 "https://mastodon.social/users/Mastodon",
19 "https://mastodon.social/web/@Mastodon",
20 "https://mastodon.social/@Mastodon.rss",
21 "https://fosstodon.org/@fosstodon",
22 "https://mastodon.social/directory",
23 "https://mastodon.social/api/v1/accounts/lookup?acct=Mastodon",
24 "https://mastodon.social/@Mastodon/with_replies?max_id=1",
25 "https://mastodon.social/@Mastodon/117466983307949301/embed",
26 "https://mastodon.social/users/Mastodon/statuses/117411420916699261",
27 "https://mastodon.social/web/statuses/117156549508722805",
28 "https://mastodon.social/explore/posts",
29 "https://mastodon.social/api/v1/timelines/tag/fediverse?limit=2",
30 "https://mastodon.social/api/v1/trends/statuses?limit=2",
31 "https://mastodon.social/api/v1/directory?limit=2",
32 "https://mastodon.social/api/v1/statuses/117128801091131239/context",
33 ],
34 "accounts": [],
35 "keywords": ["news"],
36 "maxProfiles": 10,
37 "maxReviewsPerProfile": 5,
38 "maxRepliesPerPost": 10,
39 "maxPosts": 500,
40 "proxy": { "useApifyProxy": True },
41 "incrementalMode": False,
42 "emitUnchanged": False,
43 "emitExpired": False,
44 "ignoreFieldsForChanges": [],
45}
46
47
48run = client.actor("abotapi/mastodon-social-scraper").call(run_input=run_input)
49
50
51print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
52for item in client.dataset(run.default_dataset_id).iterate_items():
53 print(item)
54
55