LurkAPI
Docs · Subreddit posts

Subreddit posts

A subreddit's feed (hot, new, top, rising or best), with titles, text, scores and comment counts.

1 credit per callFresh within 1 minuteMCP tool: reddit_subreddit_posts
GEThttps://api.lurkapi.com/v1/reddit/subreddit

Example response

When to use this

Use it to track what a community talks about: one page of its feed, sorted as on reddit.com, with each post's title, text, score and comment count. timeframe only applies with sort=top.

Pagination. About 25 posts per page. Pass the response's after back as after for the next page; it's null at the end.

Missing, private and banned subreddits return an empty posts list.

Example request

Copy one and replace YOUR_API_KEY with your API key (get one free). The code versions read the key from the LURKAPI_API_KEY environment variable instead.

Language

Parameters

Add them to the URL after a ?, as in ?subreddit=marketing. Join several with &.

ParameterDescription
subreddit
stringrequired
Subreddit name without r/, e.g. marketing.
Example
marketing
sort
stringoptional
Feed order, as on reddit.com.
One of
besthotnewtoprising
Default
hot
timeframe
stringoptional
Time window for sort=top: hour, day, week, month, year or all.
One of
allhourdayweekmonthyear
Default
all
after
stringoptional
The after from the previous response, to get the next page.
trim
booleanoptional
true omits selftext_html for a smaller response.
One of
truefalse
Default
false

Example response

A real response, captured from the live API. Lists are trimmed to a couple of items, and long text such as media links is cut short with ….

Show the example response (3 KB)
{
  "success": true,
  "credits_remaining": 999959,
  "credits_charged": 1,
  "posts": [
    {
      "id": "1wvg2hm",
      "name": "t3_1wvg2hm",
      "title": "A hard truth I’m discovering",
      "author": "mikysupergirl",
      "author_fullname": "t2_1ft0fg7lvh",
      "subreddit": "marketing",
      "subreddit_id": "t5_2qhmg",
      "subreddit_name_prefixed": "r/marketing",
      "permalink": "/r/marketing/comments/1wvg2hm/a_hard_truth_im_discovering/",
      "url": "https://www.reddit.com/r/marketing/comments/1wvg2hm/a_hard_truth_im_discovering/",
      "domain": "self.marketing",
      "score": 34,
      "ups": 34,
      "upvote_ratio": 0.9,
      "num_comments": 32,
      "created": 1790901601,
      "created_utc": 1790901601,
      "is_self": true,
      "is_video": false,
      "over_18": false,
      "spoiler": false,
      "stickied": false,
      "locked": false,
      "link_flair_text": "Discussion",
      "link_flair_background_color": "#DADADA",
      "selftext": "I’m a marketing professional with +15 years experience in advertising th…",
      "selftext_html": "<p>I’m a marketing professional with +15 years experience in advertising…",
      "thumbnail": null,
      "total_awards_received": 0,
      "crosspost_parent_list": null,
      "poll_data": null,
      "gallery_data": null,
      "media": null
    },
    {
      "id": "1wuua6v",
      "name": "t3_1wuua6v",
      "title": "Are 6 rounds of interviews too much?",
      "author": "OkIce8958",
      "author_fullname": "t2_22zyc4v866",
      "subreddit": "marketing",
      "subreddit_id": "t5_2qhmg",
      "subreddit_name_prefixed": "r/marketing",
      "permalink": "/r/marketing/comments/1wuua6v/are_6_rounds_of_interviews_too_much/",
      "url": "https://www.reddit.com/r/marketing/comments/1wuua6v/are_6_rounds_of_interviews_too_much/",
      "domain": "self.marketing",
      "score": 98,
      "ups": 98,
      "upvote_ratio": 0.98,
      "num_comments": 117,
      "created": 1790844412,
      "created_utc": 1790844412,
      "is_self": true,
      "is_video": false,
      "over_18": false,
      "spoiler": false,
      "stickied": false,
      "locked": false,
      "link_flair_text": "Question",
      "link_flair_background_color": "#94E044",
      "selftext": "Hi folks, I've applied for a Strategic Marketing Manager position in an …",
      "selftext_html": "<p>Hi folks, I&#39;ve applied for a Strategic Marketing Manager position…",
      "thumbnail": null,
      "total_awards_received": 0,
      "crosspost_parent_list": null,
      "poll_data": null,
      "gallery_data": null,
      "media": null
    }
  ],
  "after": "t3_1wohura"
}

Response fields

Every field in a successful response, and what it means. A name with [] belongs to each item of a list: posts[].id is the id of every item in posts. null means there's no value.

Show all 65 fields
FieldTypeDescription
successtrueAlways true here; errors have success: false.
credits_remainingnumberYour balance after this call. On anonymous playground calls: free tries left today.
credits_chargednumberCredits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1).
postsobject[]One page of posts, in feed order.
posts[].idstringPost id, e.g. 1wtfnyr.
posts[].namestringFullname, t3_ + id. Subreddit listings paginate with it.
posts[].titlestringPost title.
posts[].authorstringcan be nullUsername, without u/; null if unknown.
posts[].author_fullnamestringcan be nullAuthor's account fullname, t2_ + id; null if unknown.
posts[].subredditstringSubreddit name without r/, e.g. marketing.
posts[].subreddit_idstringcan be nullSubreddit fullname, t5_ + id.
posts[].subreddit_name_prefixedstringcan be nullSubreddit name with the r/ prefix, e.g. r/marketing.
posts[].permalinkstringPath on reddit.com; prepend https://www.reddit.com.
posts[].urlstringThe link a link post points to (the original post for crossposts), or the post itself for text posts.
posts[].url_overridden_by_deststringmay be missingOutbound link, on link posts only.
posts[].domainstringcan be nullself.<subreddit> for text posts, else the linked site.
posts[].selftextstringPost body as plain text. Empty for link, media and crosspost posts.
posts[].selftext_htmlstringcan be null · may be missingPost body as HTML. Omitted with trim=true.
posts[].scorenumberUpvotes minus downvotes.
posts[].upsnumberSame as score.
posts[].upvote_rationumbercan be nullShare of votes that are upvotes, 0–1.
posts[].num_commentsnumberComment count when fetched.
posts[].creatednumberPosted at, Unix seconds.
posts[].created_utcnumberPosted at, Unix seconds.
posts[].is_selfbooleanA text post rather than a link.
posts[].is_videobooleanA video post.
posts[].is_gallerybooleanmay be missingPresent (true) on image galleries; absent otherwise.
posts[].over_18booleanMarked NSFW.
posts[].spoilerbooleanMarked as a spoiler.
posts[].stickiedbooleanPinned by moderators.
posts[].lockedbooleanLocked: no new comments allowed.
posts[].link_flair_textstringcan be nullPost flair, e.g. "Question"; null without flair.
posts[].link_flair_background_colorstringcan be nullFlair color as a hex code, e.g. #94E044; null without flair.
posts[].thumbnailstringcan be nullPreview image URL; null for posts without media.
posts[].total_awards_receivednumberAwards the post received.
posts[].crosspost_parent_listobject[]can be nullOn crossposts, the original post as a one-item list (Reddit's shape), with what the card shows: no author or body. null otherwise.
posts[].crosspost_parent_list[].idstringThe original post's id, e.g. 1ww1x9d.
posts[].crosspost_parent_list[].namestringIts fullname, t3_ + id.
posts[].crosspost_parent_list[].titlestringIts title.
posts[].crosspost_parent_list[].subredditstringIts subreddit, without r/.
posts[].crosspost_parent_list[].subreddit_name_prefixedstringIts subreddit with the r/ prefix, e.g. r/soccer.
posts[].crosspost_parent_list[].permalinkstringIts path on reddit.com. Pass it to post comments for its body and replies.
posts[].crosspost_parent_list[].scorenumbercan be nullIts upvotes minus downvotes; null if the card doesn't show them.
posts[].crosspost_parent_list[].num_commentsnumbercan be nullIts comment count; null if the card doesn't show it.
posts[].crosspost_parent_list[].created_utcnumbercan be nullPosted at, Unix seconds; null if the card doesn't show it.
posts[].poll_dataobjectcan be nullPoll options and votes; null for other posts.
posts[].poll_data.optionsobject[]Options in display order.
posts[].poll_data.options[].idstringcan be nullOption id; null on closed polls, which reddit.com shows without ids.
posts[].poll_data.options[].textstringOption text.
posts[].poll_data.options[].vote_countnumbercan be nullVotes for this option; null while the poll is open (Reddit shows them once it closes).
posts[].poll_data.total_vote_countnumbercan be nullVotes cast.
posts[].poll_data.voting_end_timestampnumbercan be nullWhen voting closes, Unix milliseconds as in Reddit's JSON; null once closed.
posts[].gallery_dataobjectcan be nullEvery image of a gallery post (on crossposts, the original's); null otherwise.
posts[].gallery_data.itemsobject[]Images in gallery order.
posts[].gallery_data.items[].urlstringFull-size image URL (i.redd.it), or a preview if that's all the page has.
posts[].gallery_data.items[].widthnumbercan be nullOriginal width in pixels.
posts[].gallery_data.items[].heightnumbercan be nullOriginal height in pixels.
posts[].mediaobjectcan be nullReddit-hosted video (v.redd.it; on crossposts, the original's); null otherwise, including YouTube and other embeds.
posts[].media.reddit_videoobjectThe video's streams.
posts[].media.reddit_video.hls_urlstringHLS playlist with video and audio, as reddit.com plays it.
posts[].media.reddit_video.fallback_urlstringcan be nullLargest MP4 with audio. A signed link that expires within hours; null when reddit.com offers none.
posts[].media.reddit_video.widthnumbercan be nullThat MP4's width in pixels.
posts[].media.reddit_video.heightnumbercan be nullThat MP4's height in pixels.
posts[].media.reddit_video.durationnumbercan be nullLength in seconds.
afterstringcan be nullPass as after for the next page. null on the last page.

Pagination

Results come in pages. For the next page, repeat the call with the same parameters and add the response's after as after. On the last page, after is null. Each page costs 1 credit.

The first five pages, in JavaScript
let after = null;for (let page = 1; page <= 5; page++) {const params = new URLSearchParams({ subreddit: "marketing" });if (after) params.set("after", after);const res = await fetch(`https://api.lurkapi.com/v1/reddit/subreddit?${params}`, {headers: { "x-api-key": process.env.LURKAPI_API_KEY },});const data = await res.json();if (!data.success) throw new Error(`${data.code}: ${data.error}`);console.log(data.posts);after = data.after;if (!after) break; // last page}

Cost and freshness

Each call costs 1 credit. Calls turned away before they reach the platform (invalid parameters, a key or balance problem, a rate limit) are free, and so are 5xx errors. A not_found is charged, since the platform was checked. How charging works.

Answers are cached for up to 1 minute. A repeat call within that time can return the same data, and costs the same.

Errors

A failed call returns success: false, an error message, a code your program can check, and a docs link. These are the errors this endpoint can return. All error codes.

StatusCodeMeaning
401missing_api_keyNo API key was sent. Put it in the x-api-key header.
401invalid_api_keyThis key doesn't exist or was revoked.
402insufficient_creditsNot enough credits for this call. Buy a pack, or wait for tomorrow's free top-up.
402over_max_creditsThis call would cost more than the max_credits you set. The error says what it needs; raise max_credits to allow it. Not charged.
403account_suspendedThis account is suspended. Email support@lurkapi.com. Not charged.
405method_not_allowedEndpoints only take GET, with parameters in the URL.
429rate_limitedToo many calls in a short time. Wait as many seconds as the retry-after header says, then retry.
500internal_errorSomething broke on our side. Retry. Not charged.
502upstream_errorThe platform didn't send a usable answer. Retry. Not charged.
503upstream_busyAll our connections to the platform are busy. Retry in a few seconds. Not charged.
504upstream_timeoutThe platform took over 30 seconds to answer (90 for web pages). Retry. Not charged.

Use it in Claude

Connect LurkAPI to Claude and ask in plain English. This endpoint is the reddit_subreddit_posts tool. For example:

Ask Claude
Use LurkAPI's reddit_subreddit_posts tool with subreddit "marketing", then summarize what you find.

Claude calls reddit_subreddit_posts with arguments like these, and each call costs 1 credit:

Tool arguments
{"subreddit": "marketing"}

To save tokens, tool results leave out empty fields, keep one URL per image or video, and give transcripts as plain text unless you pass timestamps=true. A result over 45,000 characters comes in parts. Its _note gives the offset for the next part, and later parts are free for 15 minutes. Pass trim=false for the full response.

From the blog

All posts