LurkAPI
Docs · Subreddit search

Subreddit search

Search one subreddit's posts by keyword, returned as compact result cards.

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

Example response

When to use this

Use it to find what one community says about a product, a competitor or a problem. It works like the search box on a community page. Each result has its title, votes, num_comments, created_at and subreddit, but not the post's text.

For the text and replies, pass a result's url to post comments (reddit_post_comments).

Pagination. Pass the response's cursor back as cursor for the next page; it's null at the end.

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&query=AI+video. Join several with &.

ParameterDescription
subreddit
stringrequired
Subreddit name without r/, e.g. marketing.
Example
marketing
query
stringoptional
Keywords. Leave empty to list the subreddit's posts in sort order.
Example
AI video
sort
stringoptional
Result order. comments = most commented.
One of
relevancehottopnewcomments
Default
relevance
timeframe
stringoptional
Only posts from the last hour, day, week, month, year, or all time.
One of
allhourdayweekmonthyear
Default
all
cursor
stringoptional
The cursor from the previous response, to get the next page.

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": 993,
  "credits_charged": 1,
  "posts": [
    {
      "id": "t3_1t673is",
      "post_id": "t3_1t673is",
      "title": "Have any of you made a documentary style video using an AI tool?",
      "url": "https://www.reddit.com/r/marketing/comments/1t673is/have_any_of_you_made…",
      "permalink": "/r/marketing/comments/1t673is/have_any_of_you_made_a_documentary_style_video/",
      "nsfw": false,
      "spoiler": false,
      "is_crosspost": false,
      "subreddit": {
        "id": "t5_2qhmg",
        "name": "marketing",
        "nsfw": false,
        "quarantined": false,
        "icon": null,
        "banner": null,
        "description": null,
        "weekly_visitors": null,
        "weekly_contributions": null
      },
      "votes": 0,
      "num_comments": 37,
      "created_at": "2026-05-07T10:59:35.000+0000",
      "created_at_iso": "2026-05-07T10:59:35.000Z",
      "thumbnail": null,
      "thumbnail_blurred": false,
      "position": 0,
      "relative_position": 0
    },
    {
      "id": "t3_1woq8xa",
      "post_id": "t3_1woq8xa",
      "title": "YouTube to start allowing A/B testing of video content",
      "url": "https://www.reddit.com/r/marketing/comments/1woq8xa/youtube_to_start_all…",
      "permalink": "/r/marketing/comments/1woq8xa/youtube_to_start_allowing_ab_testing_of_video/",
      "nsfw": false,
      "spoiler": false,
      "is_crosspost": false,
      "subreddit": {
        "id": "t5_2qhmg",
        "name": "marketing",
        "nsfw": false,
        "quarantined": false,
        "icon": null,
        "banner": null,
        "description": null,
        "weekly_visitors": null,
        "weekly_contributions": null
      },
      "votes": 32,
      "num_comments": 9,
      "created_at": "2026-09-24T02:58:53.000+0000",
      "created_at_iso": "2026-09-24T02:58:53.000Z",
      "thumbnail": null,
      "thumbnail_blurred": false,
      "position": 1,
      "relative_position": 1
    }
  ],
  "cursor": "eyJjYW5kaWRhdGVzX3JldHVybmVkIjoie1wic2VjdGlvbl8xX3BpcGVsaW5lXzBfZ2xvYmFs…"
}

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 31 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[]Matching posts, best match first (or in sort order).
posts[].idstringFullname, e.g. t3_1t673is.
posts[].post_idstringSame as id.
posts[].titlestringPost title.
posts[].urlstringThe post on reddit.com. Pass it to post comments for the body and replies.
posts[].permalinkstringPath on reddit.com.
posts[].votesnumberScore (upvotes minus downvotes).
posts[].num_commentsnumberComment count when fetched.
posts[].created_atstringPosted at, e.g. 2026-05-07T10:59:35.000+0000.
posts[].created_at_isostringPosted at, ISO 8601.
posts[].nsfwbooleanMarked NSFW.
posts[].spoilerbooleanMarked as a spoiler.
posts[].is_crosspostbooleanAlways false: search results don't say whether a post is a crosspost.
posts[].thumbnailstringcan be nullPreview image URL; null for posts without media.
posts[].thumbnail_blurredbooleanAlways false: search results don't include it.
posts[].positionnumberRank in the results, from 0.
posts[].relative_positionnumberRank as Reddit reports it; usually equal to position.
posts[].subredditobjectThe subreddit the post is in.
posts[].subreddit.idstringcan be nullSubreddit fullname, t5_ + id.
posts[].subreddit.namestringSubreddit name without r/.
posts[].subreddit.nsfwbooleanThe subreddit is NSFW.
posts[].subreddit.quarantinedbooleanThe subreddit is quarantined.
posts[].subreddit.iconstringcan be nullSubreddit icon URL, when the result shows one.
posts[].subreddit.bannerstringcan be nullAlways null here; get it from subreddit details.
posts[].subreddit.descriptionstringcan be nullAlways null here; get it from subreddit details.
posts[].subreddit.weekly_visitorsnumbercan be nullAlways null here; get it from subreddit details.
posts[].subreddit.weekly_contributionsnumbercan be nullAlways null here; get it from subreddit details.
cursorstringcan be nullPass as cursor 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 cursor as cursor. On the last page, cursor is null. Each page costs 1 credit.

The first five pages, in JavaScript
let cursor = null;for (let page = 1; page <= 5; page++) {const params = new URLSearchParams({ subreddit: "marketing", query: "AI video" });if (cursor) params.set("cursor", cursor);const res = await fetch(`https://api.lurkapi.com/v1/reddit/subreddit/search?${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);cursor = data.cursor;if (!cursor) 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_search tool. For example:

Ask Claude
Use LurkAPI's reddit_subreddit_search tool with subreddit "marketing", query "AI video", then summarize what you find.

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

Tool arguments
{"subreddit": "marketing","query": "AI video"}

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