Reddit and Hacker News
PullMD recognizes Reddit and Hacker News links and reads them through each site's API. The result is the post and a nested comment tree as Markdown. Reading Reddit needs API credentials. The MCP read_url tool handles Reddit this way and reads Hacker News links as web pages.
curl "http://localhost:3000/api?url=https://news.ycombinator.com/item?id=1&lang=en"
# Y Combinator
http://ycombinator.com
---
## Comments (3 of 3)
**sama** · 20y ago: "the rising star of venture capital" -unknown VC eating lunch on SHR
…
Supported links
| Site | Links |
|---|---|
Post URLs, redd.it short links, /s/ share links, galleries, and subreddit pages (/r/<name>, which return the Hot posts). Other Reddit pages, such as user profiles, wikis and sorted listings like /r/<name>/top, return 400. | |
| Hacker News | Items, comment permalinks, and the front page (/ or /news), /newest, /ask, /show, /jobs and /best listings |
A listing returns 30 stories from the Hacker News search API as a numbered list with points, comment counts, and a discussion link for each. The order can differ from the site's own pages, and /best returns the front page.
Shape the comments
| Parameter | Default | Effect |
|---|---|---|
comments | true | false or 0 returns the post without comments. A cached copy that includes comments is served unchanged, so add nocache=true. |
comment_depth | 3 | How many levels of replies to include, or all for the whole thread. The MCP tool accepts 1 to 10 or "all". |
comment_limit | no limit | Maximum number of top-level comments. The MCP tool accepts 1 to 500. |
lang | de | Language of the comments heading: ## Kommentare or ## Comments. |
On REST, comment_depth and comment_limit skip the cache, so they always take effect. On MCP they don't. lang doesn't skip it, so add nocache=true when you change lang for a thread fetched in the last hour.
With comment_depth=all, PullMD removes the depth limit and also loads the comments Reddit hides behind "load more comments" and "continue this thread". This takes extra requests to Reddit, at most 20 per conversion with credentials and 5 without. Set PULLMD_REDDIT_MORE_REQUESTS to change the limit (up to 200), or 0 to turn the loading off. On Hacker News, all removes the depth limit.
On Reddit, comments still missing within the requested depth are noted below the comment tree, for example Nicht geladen: 3 weitere Kommentare, or Not loaded: 3 more comments with lang=en.
lang=en on every request.Frontmatter
With frontmatter=true, posts include author, published and upvotes, plus subreddit for Reddit. These fields appear only in the frontmatter.
Describe images in Reddit posts
With a vision provider configured, PullMD can add a short description and a transcript of the legible text under each image of a Reddit post: single images, galleries and images inside a text post. Comment images stay as they are.
To transcribe the images of one post, pass images=on (MCP: images: "on"). On REST, true and 1 work like on, and false and 0 like off. PULLMD_EMBEDDED_IMAGES sets the instance behavior:
| Value | Effect |
|---|---|
on-request (default) | Images are transcribed when a request passes images=on. |
always | Images are transcribed unless a request passes images=off. |
off | Images are never transcribed, and a request can't turn it on. |
With a provider and a mode other than off, an image without a transcript carries a one-line Bild nicht transkribiert marker (Image not transcribed with lang=en), so an agent reading the result knows to ask for it. With frontmatter=true, images_transcribed reports the count as <done>/<total>.
PullMD transcribes up to PULLMD_EMBEDDED_IMAGES_MAX images per post (default 4, range 1 to 20). Each new image costs one unit of PULLMD_LLM_RATE_LIMIT and one vision call. Transcripts are stored per image and reused for as long as cache retention keeps them.
Reddit credentials
PullMD reads Reddit through Reddit's Data API, with the credentials of an existing Reddit app. Without credentials, Reddit blocks the requests and PullMD returns 502 with Reddit blocked the request.
- Add the credentials to .envREDDIT_CLIENT_ID=your-client-idREDDIT_CLIENT_SECRET=your-client-secretREDDIT_USER_AGENT=linux:pullmd:1.0 (by u/yourname)
Reddit requires a unique user agent in this form:
platform:appname:version (by u/yourname) - Restartdocker compose up -d
PullMD then uses
oauth.reddit.com.
Errors
| Status | Message | Cause |
|---|---|---|
400 | Unsupported Reddit page: PullMD reads Reddit posts and subreddits, not … | The link isn't a post, gallery or subreddit page. The JSON also has "code": "reddit_unsupported_page". |
404 | Post not found | The post was deleted or the link is wrong. |
502 | Reddit rate limit. Try again later. | Too many requests. Slow down. |
502 | Reddit blocked the request. | No credentials are set, or Reddit refused them. Nothing is cached. |
500 | Internal server error | Reddit rejected the credentials or returned another unexpected status. |
If the Hacker News API fails, PullMD reads the page as a normal web page, so a 502 from the page fetch can replace the API error.