Skip to content
ChangelogNew

You can now search Reddit with any API key

API
A Reddit search in the Playground for best mechanical keyboard for programming, with posts from r/buildapc and r/mkindia, beside the sort and timeRange values of POST /v1/serp/reddit/search

A new search endpoint finds posts across all of Reddit or in one subreddit, sorted by top, new or hot and narrowed to the last hour up to the last year, at 1 credit a search.

What you get

  • POST /v1/serp/reddit/search: search all of Reddit, or one community with subreddit, and get each post’s postId, title, url, subreddit and preview.
  • sort by relevance, hot, top, new or comments, keep the last hour, day, week, month or year with timeRange, and get 1 to 100 posts with limit.
  • REDDIT on POST /v1/async/task for three more reads: one post with its first page of comments (url), a subreddit’s newest posts (action feed) and a user’s posts (action user_posts).
  • Reddit in the Playground, in API key scopes and in the MCP server, at 1 credit a task.

How it works

The body is flat JSON: query with the optional subreddit, sort, timeRange, limit and country, beside idempotencyKey, priority and webhook. The endpoint waits for the task as POST /v1/sync/task does, up to 290 seconds or what Prefer: wait asks, and answers 202 with Location while the task still runs.

When every concurrency slot on the plan is busy, the endpoint answers 429 PLAN_CONCURRENCY_LIMIT at once; send Prefer: wait=0 to queue the task. POST /v1/async/task takes the same fields in the REDDIT payload.

subreddit is the name after r/, 2 to 21 letters, digits or underscores. preview is the start of the post’s text, up to 2,000 characters. A post read returns the first page of comments, about 20 to 25, each with depth, score and isSubmitter. An empty results in a completed task means the search matched 0 posts on Reddit.

Where it helps

  • Each morning, read what r/dataengineering posted about scraping in the last day with sort new and timeRange day.
  • Find the most upvoted threads of the past year that ask for a tool like yours with sort top and timeRange year, then read each one’s comments with its url.
  • Read the Reddit threads that AI answers cite: send each cited post’s url and get the post with its comments.
  • Pull a subreddit’s newest posts every hour with action feed and catch your brand’s name the day it comes up.

Send a request

Send the request with your API key in the Authorization header.

curl -X POST https://api.querying.ai/v1/serp/reddit/search \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "best mechanical keyboard for programming" }'

Request fields

querystringRequired
The search, as you would type it into Reddit’s search box.
subredditstring
Searches one subreddit: the name after r/, 2 to 21 letters, digits or underscores. Without it, the search covers all of Reddit.
sortstring
The order of the posts: relevance (the default), hot, top, new or comments.
timeRangestring
How far back the posts go: hour, day, week, month, year or all (the default).
limitinteger
Posts to return, from 1 to 100. Default 25.
webhook.urlstring
An HTTPS address on your server. The finished task is posted there the moment it completes.

Response

The response, trimmed for length.

JSON
{
  "success": true,
  "task": {
    "id": "…",
    "taskType": "REDDIT",
    "status": "COMPLETED",
    "createdAt": "…"
  },
  "credits": { "creditsToCharge": 1, "creditsCharged": 1 },
  "response": {
    "results": [
      {
        "postId": "1qz6da6",
        "title": "Best silent mechanical keyboard for programming?",
        "url": "https://www.reddit.com/r/MechanicalKeyboardsUK/comments/1qz6da6/best_silent_mechanical_keyboard_for_programming/",
        "subreddit": "MechanicalKeyboardsUK",
        "preview": "I currently have a mechanical keyboard but I often wake up in the middle of the night and it is quite loud so I can't use my computer because …"
      },
      "…"
    ]
  }
}
task.statusstring
QUEUED, PROCESSING, then COMPLETED with the answer or FAILED with error.
credits.creditsChargedinteger
Credits charged for the finished task. A failed task charges 0.
response.resultsarray
Posts that match the search: postId, title, url, subreddit and preview.

Pricing

Each completed REDDIT task costs 1 credit, charged when the task completes: a search, a post with its comments, a feed or a user’s posts. Plans and credits: https://querying.ai/pricing

More updates

Stay in the loop

Get new product updates in your inbox.

RSS feed