Lemmy Mastodon Posts Scraper
Pricing
from $1.19 / 1,000 results
Lemmy Mastodon Posts Scraper
Collect public posts from Lemmy communities, search results and front pages, or Mastodon hashtags and local timelines. Records include text, author, community or hashtag, score, reply count, publication time and links. Uses each instance’s public JSON API without logging in.
Pricing
from $1.19 / 1,000 results
Rating
0.0
(0)
Developer
Axiom Works
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Returns: one row per post with platform, title, text, author, community, score, commentsCount and url.
Input: {"platform":"lemmy","instance":"lemmy.world","communities":["technology"],"sort":"Hot","maxItems":50}
Best for: community monitoring, hashtag tracking, content research across fediverse servers.
{"id": "53584067","platform": "lemmy","title": "Chinese manufacturers dominate Latin America's bus fleet","author": "yogthos","community": "technology","score": 21,"upvotes": 21,"url": "https://lemmy.ml/post/53584067"}
What does Lemmy Mastodon Posts Scraper do?
Lemmy Mastodon Posts Scraper is a Lemmy scraper and Mastodon scraper in one Actor. It reads the public JSON APIs that every Lemmy and Mastodon server exposes and returns posts as clean, flat records. You choose the platform, name the server (the instance), and say what to read: one or more Lemmy communities, a Lemmy keyword search, one or more Mastodon hashtags, public account handles, or the local public timeline of a Mastodon server.
Both platforms are part of the fediverse, so the same fields are returned for both. That makes it easy to compare discussions across servers, feed one dashboard, or build one dataset from many sources. You can use it as a Lemmy API alternative when you do not want to write pagination, rate limiting and retry code yourself, and as a Mastodon API alternative for hashtag collection.
The Actor does not log in and never reads private or follower-only content. It only collects what a server shows publicly without an account. Some Mastodon servers turn off their public timelines; for those the Actor logs a clear message and moves on.
You can run it from the Apify Console, on a schedule, through the API, or from an AI agent over MCP.
What data can you get?
Every record is one post. Fields that a platform does not have are returned as null.
| Field | Type | Description |
|---|---|---|
id | string | Post ID on the instance, unique within a run |
platform | string | lemmy or mastodon |
instance | string | Hostname of the server the post came from |
title | string | Lemmy post title; null on Mastodon, which has no titles |
text | string | Post body. Mastodon HTML is converted to plain text |
author | string | Username of the poster; Mastodon returns the full account address |
community | string | Lemmy community name, the Mastodon hashtag you searched, or public for the timeline |
score | number | Lemmy: upvotes minus downvotes. Mastodon: number of favourites |
upvotes, downvotes | number | Lemmy vote counts; null for Mastodon |
thumbnailUrl | string | Lemmy thumbnail URL when present |
nsfw | boolean | Lemmy post flag when present |
reblogsCount | number | Mastodon boost count; null for Lemmy |
language | string | Mastodon language code when present |
tags | array | Mastodon hashtags on the post |
mediaUrls | array | Mastodon media attachment URLs |
authorDisplayName | string | Mastodon author display name |
commentsCount | number | Lemmy comments or Mastodon replies |
publishedAt | string | ISO timestamp of publication |
url | string | Link to the post on the instance |
externalUrl | string | Link the post points to, when there is one. Mastodon uses the preview card first, then the first body link excluding hashtags and mentions |
scrapedAt | string | ISO timestamp of the run |
sentiment | string | positive, neutral or negative; only present when sentiment is switched on and succeeded |
sourceUrl | string | API endpoint the record was fetched from |
How to use
- Open the Actor in Apify Console and pick the platform:
lemmyormastodon. - Enter the instance, for example
lemmy.worldormastodon.social. - For Lemmy, list communities (for example
technology), set a search query, or leave both empty to read the instance front page. - For Mastodon, list hashtags without the
#, account handles or profile URLs, or leave both empty to read the local public timeline. - Set
maxItemsand press Start. Results appear in the dataset as they are collected, and you can export them as JSON, CSV, Excel or XML.
Account handles are looked up through the selected instance’s public API. A profile URL such as https://mastodon.social/@Gargron also works when it matches the selected instance. If you provide handles and hashtags together, the Actor collects the account timelines first, then the hashtag timelines until maxItems is reached. Each output row is still a post; the Actor does not emit separate profile records.
The Actor requests about one page per second from each instance, which is polite to community-run servers. Lemmy pages hold up to 50 posts and Mastodon pages up to 40, and the run stops as soon as maxItems posts are saved.
Practical tips
Start small. Run with maxItems set to 10 to confirm that the instance, community or hashtag is spelled correctly, then raise the limit. Community names on Lemmy are the short name that appears in the community address, for example technology for the technology community on the instance you chose. Hashtags on Mastodon are matched without case, so Caturday and caturday return the same posts.
If you want a broad sample of a Lemmy server, leave the community list empty and pick a sort order. Hot shows what is active now, New shows the latest posts, and TopDay or TopWeek show the best-scoring posts of the period. For monitoring, schedule a daily run with New and a modest maxItems, then compare the id values with the previous day to find fresh posts.
To follow one topic across the fediverse, run the Actor once per instance with the same hashtag or search query, then merge the datasets. Each record carries the instance field, so you can always tell where a post came from.
Mastodon posts keep line breaks from the original, HTML entities are decoded, and links and mentions are reduced to plain text. Lemmy bodies are returned as the Markdown the author wrote.
Input
| Field | Type | Description |
|---|---|---|
instance | string, required | Hostname of the server, for example lemmy.world |
platform | string | lemmy (default) or mastodon |
communities | array | Lemmy community names, one per line |
hashtags | array | Mastodon hashtags without # |
handles | array | Mastodon account handles or profile URLs on the selected instance |
searchQuery | string | Lemmy keyword search; combined with communities if both are set |
sort | string | Lemmy ordering: Hot (default), New, TopDay, TopWeek |
minScore | integer | Skip posts below this score (Lemmy score or Mastodon favourites); default 0 keeps all. Skipped posts are not charged |
enrichSentiment | boolean | Adds a sentiment field using a third-party AI processor |
maxItems | integer | Maximum posts to return, 1-10000, default 50 |
proxyConfiguration | object | Apify Proxy settings; off by default, enable it if an instance blocks you |
Example Lemmy input:
{"platform": "lemmy","instance": "lemmy.world","communities": ["technology"],"sort": "Hot","maxItems": 30}
Example Mastodon input:
{"platform": "mastodon","instance": "mastodon.social","hashtags": ["caturday"],"maxItems": 30}
Output
The dataset holds one item per post. A Mastodon example from a real run:
{"id": "117379741313064696","platform": "mastodon","instance": "mastodon.social","title": null,"text": "We took our Landlady (cat) to the vet yesterday and she's still pouting ...","author": "todays_wander@pixelfed.social","community": "caturday","score": 0,"commentsCount": 0,"publishedAt": "2026-10-04T00:11:43.000Z","url": "https://pixelfed.social/p/todays_wander/1012152259384724103","externalUrl": null,"scrapedAt": "2026-10-04T00:13:08.670Z","sourceUrl": "https://mastodon.social/api/v1/timelines/tag/caturday?limit=5"}
Items are unique by id within a run. When you read several communities or hashtags, a post that appears twice is saved once.
Sentiment is an optional extra. When enrichSentiment is on, the title and text of each post are sent to a third-party AI processor, which returns one of three labels. If the AI service is unavailable the post is still saved without the field and the enrichment is not charged.
How much does it cost?
The Actor is charged per result: you pay for each post saved to the dataset, and the optional sentiment field is charged only for posts where it succeeded. Current rates are on the Pricing tab of the Actor page. Because the run stops exactly at maxItems, you control the cost with that one number.
Use with AI agents (MCP)
Add the Actor to any MCP client through the Apify MCP server:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=axiomworks/lemmy-mastodon-posts-scraper"}}}
Example prompts:
- "Get the 30 hottest posts from the technology community on lemmy.world and summarise the main themes."
- "Collect 50 recent mastodon.social posts tagged caturday and list the most favourited ones."
- "Search lemmy.world for posts about linux and return titles with their scores."
Integrations and API
Python:
from apify_client import ApifyClientclient = ApifyClient("<APIFY_TOKEN>")run = client.actor("axiomworks/lemmy-mastodon-posts-scraper").call(run_input={"platform": "lemmy","instance": "lemmy.world","communities": ["technology"],"maxItems": 50,})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item["title"], item["score"])
JavaScript:
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: '<APIFY_TOKEN>' });const run = await client.actor('axiomworks/lemmy-mastodon-posts-scraper').call({platform: 'mastodon',instance: 'mastodon.social',hashtags: ['caturday'],maxItems: 50,});const { items } = await client.dataset(run.defaultDatasetId).listItems();process.stdout.write(`${items.length} posts\n`);
cURL:
curl -X POST "https://api.apify.com/v2/acts/axiomworks~lemmy-mastodon-posts-scraper/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"platform":"lemmy","instance":"lemmy.world","communities":["technology"],"maxItems":20}'
You can also connect the dataset to Google Sheets, Slack, Zapier, Make or webhooks from the Integrations tab, and schedule runs to track a community or hashtag over time.
FAQ
Which servers work? Any Lemmy or Mastodon server that answers its public API. Pick the matching platform; a Mastodon hostname used with lemmy returns nothing.
Why is title empty for Mastodon? Mastodon posts have no title, so the field is null. The post is in text.
What does score mean? On Lemmy it is upvotes minus downvotes. On Mastodon it is the favourites count, which is the closest equivalent.
A Mastodon server returned nothing. Why? Some servers disable the public timeline or hashtag timeline for visitors without an account. The run ends successfully with zero items and a status message. Try another instance.
Does it need a proxy? Normally not. If an instance blocks the request, enable Apify Proxy in the input; blocked requests are retried on a new IP.
Can I get comments? This version returns posts. Comment-level data is not included.
What happens with a wrong community or hashtag? The run finishes with zero items and a message that says what to change. It never saves placeholder rows.
Is it legal to scrape Lemmy and Mastodon?
The Actor reads only public data that the servers publish through their open APIs, with no login and at a modest request rate. Posts can still contain personal data, so use them in line with the privacy laws that apply to you, such as GDPR, and respect the rules of each instance. Do not use the data for harassment, spam or to re-identify people. This Actor is an independent tool and is not affiliated with or endorsed by Lemmy, Mastodon or any instance. If in doubt, ask a legal adviser about your use case.
Feedback
Found a bug or need another field? Open an issue from the Actor page in Apify Console. Include the input you used and the instance, and we will look into it.