Docs · Subreddit posts
Subreddit posts
A subreddit's feed (hot, new, top, rising or best), with titles, text, scores and comment counts.
https://api.lurkapi.com /v1/reddit/subredditWhen 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.
curl "https://api.lurkapi.com/v1/reddit/subreddit?subreddit=marketing" \
-H "x-api-key: YOUR_API_KEY"Paste it into a terminal, with your key in place of YOUR_API_KEY.
const params = new URLSearchParams({
subreddit: "marketing",
});
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);Node 18+. Save it as lurk.mjs and run node lurk.mjs. It reads your key from LURKAPI_API_KEY.
import os
import requests
res = requests.get(
"https://api.lurkapi.com/v1/reddit/subreddit",
params={
"subreddit": "marketing",
},
headers={"x-api-key": os.environ["LURKAPI_API_KEY"]},
timeout=60,
)
data = res.json()
if not data["success"]:
raise RuntimeError(f"{data['code']}: {data['error']}")
print(data["posts"])Run pip install requests, save it as lurk.py and run python lurk.py. It reads your key from LURKAPI_API_KEY.
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"time"
)
func main() {
params := url.Values{}
params.Set("subreddit", "marketing")
req, _ := http.NewRequest("GET", "https://api.lurkapi.com/v1/reddit/subreddit?"+params.Encode(), nil)
req.Header.Set("x-api-key", os.Getenv("LURKAPI_API_KEY"))
client := &http.Client{Timeout: 60 * time.Second}
res, err := client.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var data map[string]any
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
panic(err)
}
if data["success"] != true {
panic(fmt.Sprintf("%v: %v", data["code"], data["error"]))
}
out, _ := json.MarshalIndent(data["posts"], "", " ")
fmt.Println(string(out))
}Save it as main.go and run go run main.go. It reads your key from LURKAPI_API_KEY.
<?php
$params = http_build_query([
'subreddit' => 'marketing',
]);
$context = stream_context_create(['http' => [
'header' => 'x-api-key: ' . getenv('LURKAPI_API_KEY'),
'timeout' => 60,
'ignore_errors' => true,
]]);
$body = file_get_contents('https://api.lurkapi.com/v1/reddit/subreddit?' . $params, false, $context);
$data = json_decode($body, true);
if (!$data['success']) {
throw new Exception("{$data['code']}: {$data['error']}");
}
print_r($data['posts']);Save it as lurk.php and run php lurk.php. It reads your key from LURKAPI_API_KEY.
require 'json'
require 'net/http'
uri = URI('https://api.lurkapi.com/v1/reddit/subreddit')
uri.query = URI.encode_www_form(
'subreddit' => 'marketing',
)
req = Net::HTTP::Get.new(uri)
req['x-api-key'] = ENV.fetch('LURKAPI_API_KEY')
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https', read_timeout: 60) do |http|
http.request(req)
end
data = JSON.parse(res.body)
raise "#{data['code']}: #{data['error']}" unless data['success']
puts JSON.pretty_generate(data['posts'])Save it as lurk.rb and run ruby lurk.rb. It reads your key from LURKAPI_API_KEY.
Parameters
Add them to the URL after a ?, as in ?subreddit=marketing. Join several with &.
| Parameter | Description |
|---|---|
subredditstringrequired | Subreddit name without r/, e.g. marketing.
|
sortstringoptional | Feed order, as on reddit.com.
|
timeframestringoptional | Time window for sort=top: hour, day, week, month, year or all.
|
afterstringoptional | The after from the previous response, to get the next page. |
trimbooleanoptional | true omits selftext_html for a smaller response.
|
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)Hide
{
"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'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 fieldsHide
| Field | Type | Description |
|---|---|---|
| success | true | Always true here; errors have success: false. |
| credits_remaining | number | Your balance after this call. On anonymous playground calls: free tries left today. |
| credits_charged | number | Credits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1). |
| posts | object[] | One page of posts, in feed order. |
| posts[].id | string | Post id, e.g. 1wtfnyr. |
| posts[].name | string | Fullname, t3_ + id. Subreddit listings paginate with it. |
| posts[].title | string | Post title. |
| posts[].author | stringcan be null | Username, without u/; null if unknown. |
| posts[].author_fullname | stringcan be null | Author's account fullname, t2_ + id; null if unknown. |
| posts[].subreddit | string | Subreddit name without r/, e.g. marketing. |
| posts[].subreddit_id | stringcan be null | Subreddit fullname, t5_ + id. |
| posts[].subreddit_name_prefixed | stringcan be null | Subreddit name with the r/ prefix, e.g. r/marketing. |
| posts[].permalink | string | Path on reddit.com; prepend https://www.reddit.com. |
| posts[].url | string | The link a link post points to (the original post for crossposts), or the post itself for text posts. |
| posts[].url_overridden_by_dest | stringmay be missing | Outbound link, on link posts only. |
| posts[].domain | stringcan be null | self.<subreddit> for text posts, else the linked site. |
| posts[].selftext | string | Post body as plain text. Empty for link, media and crosspost posts. |
| posts[].selftext_html | stringcan be null · may be missing | Post body as HTML. Omitted with trim=true. |
| posts[].score | number | Upvotes minus downvotes. |
| posts[].ups | number | Same as score. |
| posts[].upvote_ratio | numbercan be null | Share of votes that are upvotes, 0–1. |
| posts[].num_comments | number | Comment count when fetched. |
| posts[].created | number | Posted at, Unix seconds. |
| posts[].created_utc | number | Posted at, Unix seconds. |
| posts[].is_self | boolean | A text post rather than a link. |
| posts[].is_video | boolean | A video post. |
| posts[].is_gallery | booleanmay be missing | Present (true) on image galleries; absent otherwise. |
| posts[].over_18 | boolean | Marked NSFW. |
| posts[].spoiler | boolean | Marked as a spoiler. |
| posts[].stickied | boolean | Pinned by moderators. |
| posts[].locked | boolean | Locked: no new comments allowed. |
| posts[].link_flair_text | stringcan be null | Post flair, e.g. "Question"; null without flair. |
| posts[].link_flair_background_color | stringcan be null | Flair color as a hex code, e.g. #94E044; null without flair. |
| posts[].thumbnail | stringcan be null | Preview image URL; null for posts without media. |
| posts[].total_awards_received | number | Awards the post received. |
| posts[].crosspost_parent_list | object[]can be null | On 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[].id | string | The original post's id, e.g. 1ww1x9d. |
| posts[].crosspost_parent_list[].name | string | Its fullname, t3_ + id. |
| posts[].crosspost_parent_list[].title | string | Its title. |
| posts[].crosspost_parent_list[].subreddit | string | Its subreddit, without r/. |
| posts[].crosspost_parent_list[].subreddit_name_prefixed | string | Its subreddit with the r/ prefix, e.g. r/soccer. |
| posts[].crosspost_parent_list[].permalink | string | Its path on reddit.com. Pass it to post comments for its body and replies. |
| posts[].crosspost_parent_list[].score | numbercan be null | Its upvotes minus downvotes; null if the card doesn't show them. |
| posts[].crosspost_parent_list[].num_comments | numbercan be null | Its comment count; null if the card doesn't show it. |
| posts[].crosspost_parent_list[].created_utc | numbercan be null | Posted at, Unix seconds; null if the card doesn't show it. |
| posts[].poll_data | objectcan be null | Poll options and votes; null for other posts. |
| posts[].poll_data.options | object[] | Options in display order. |
| posts[].poll_data.options[].id | stringcan be null | Option id; null on closed polls, which reddit.com shows without ids. |
| posts[].poll_data.options[].text | string | Option text. |
| posts[].poll_data.options[].vote_count | numbercan be null | Votes for this option; null while the poll is open (Reddit shows them once it closes). |
| posts[].poll_data.total_vote_count | numbercan be null | Votes cast. |
| posts[].poll_data.voting_end_timestamp | numbercan be null | When voting closes, Unix milliseconds as in Reddit's JSON; null once closed. |
| posts[].gallery_data | objectcan be null | Every image of a gallery post (on crossposts, the original's); null otherwise. |
| posts[].gallery_data.items | object[] | Images in gallery order. |
| posts[].gallery_data.items[].url | string | Full-size image URL (i.redd.it), or a preview if that's all the page has. |
| posts[].gallery_data.items[].width | numbercan be null | Original width in pixels. |
| posts[].gallery_data.items[].height | numbercan be null | Original height in pixels. |
| posts[].media | objectcan be null | Reddit-hosted video (v.redd.it; on crossposts, the original's); null otherwise, including YouTube and other embeds. |
| posts[].media.reddit_video | object | The video's streams. |
| posts[].media.reddit_video.hls_url | string | HLS playlist with video and audio, as reddit.com plays it. |
| posts[].media.reddit_video.fallback_url | stringcan be null | Largest MP4 with audio. A signed link that expires within hours; null when reddit.com offers none. |
| posts[].media.reddit_video.width | numbercan be null | That MP4's width in pixels. |
| posts[].media.reddit_video.height | numbercan be null | That MP4's height in pixels. |
| posts[].media.reddit_video.duration | numbercan be null | Length in seconds. |
| after | stringcan be null | Pass 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.
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.
| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No API key was sent. Put it in the x-api-key header. |
| 401 | invalid_api_key | This key doesn't exist or was revoked. |
| 402 | insufficient_credits | Not enough credits for this call. Buy a pack, or wait for tomorrow's free top-up. |
| 402 | over_max_credits | This call would cost more than the max_credits you set. The error says what it needs; raise max_credits to allow it. Not charged. |
| 403 | account_suspended | This account is suspended. Email support@lurkapi.com. Not charged. |
| 405 | method_not_allowed | Endpoints only take GET, with parameters in the URL. |
| 429 | rate_limited | Too many calls in a short time. Wait as many seconds as the retry-after header says, then retry. |
| 500 | internal_error | Something broke on our side. Retry. Not charged. |
| 502 | upstream_error | The platform didn't send a usable answer. Retry. Not charged. |
| 503 | upstream_busy | All our connections to the platform are busy. Retry in a few seconds. Not charged. |
| 504 | upstream_timeout | The 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:
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:
{"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
· 5 min read
Best Reddit scrapers in 2026: price and speed compared
LurkAPI is the best Reddit scraper: 1,000 subreddit posts for $0.04, a feed in 0.92 s, and search and comment threads on the same key.

· 5 min read
Instagram MCP server for Claude and ChatGPT
Claude can’t read Instagram on its own. Add one MCP URL and it reads any public account’s posts, reels and comments, 1 credit a call, no Meta app.

· 5 min read
Best Threads scrapers in 2026: what 1,000 posts cost
LurkAPI is the best Threads scraper: 1,000 posts for $0.06, a page in about 1.2 s, and pages back to an account's first post.