# Reddit search

`POST https://api.endless.app/social/reddit_search`

Source: https://endless.app/docs/api/social/reddit-search

Search Reddit for public posts about a topic, brand, product, or keyword. Use it for community sentiment, product complaints, niche discussion, or 'what is Reddit saying about…' questions — early signal often appears here before X or the news. Optionally scope to a single subreddit. Returns posts with title, text, score, comment count and an absolute reddit.com `url`; cite the `url` of any post you use. `text` is an excerpt — `reddit_post` reads a full post, `reddit_post_comments` its discussion.

## Authentication

- `bearerAuth`: HTTP bearer (JWT)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Endless-Api-Version` | header | string | no | Pin the caller to an API major (`1`). Omit to accept the current version. A major this deployment cannot serve is refused with 400 `unsupported_api_version`. |

## Request body

Required.

Content type: `application/json` — object

- `organization_id` (string, required)
- `max_credits` (integer): Refuse the call when its quoted ceiling exceeds this many credits.
- `tool_call_id` (string | null): The tool call behind this read, for the ledger. Every read that runs is billed, a repeated id too.
- `conversation_id` (string (uuid) | null): The chat this call belongs to, for cost attribution.
- `message_id` (string (uuid) | null): The chat turn this call belongs to, for cost attribution.
- `input` (object, required)
  - `query` (string, required): The search query, e.g. a brand, product, or topic.
  - `subreddit` (string): Restrict the search to one subreddit (without the r/ prefix).
  - `sort` ("relevance" | "hot" | "top" | "new" | "comments"): 'relevance' for best matches, 'new' for the most recent, 'top' for highest scoring, 'comments' for most discussed.
  - `within` (string): Only posts from the last relative window, e.g. '30m', '1h', '8h', '7d'. Use for real-time monitoring.
  - `max_items` (integer): Maximum posts to return (paginated upstream, max 100).

## Responses

### 200 OK

Content type: `application/json` — object

- `operation` ("instagram_profile" | "instagram_user_posts" | "instagram_user_reels" | "instagram_user_stories" | "instagram_user_highlights" | "instagram_highlight_stories" | "instagram_post" | "instagram_post_comments" | "tiktok_profile" | "tiktok_user_posts" | "tiktok_post" | "tiktok_post_comments" | "tiktok_search" | "tiktok_hashtag_posts" | "tiktok_music_posts" | "tiktok_trending" | "tiktok_trend_scan" | "linkedin_profile" | "linkedin_company" | "linkedin_user_posts" | "linkedin_company_posts" | "linkedin_post" | "linkedin_search_people" | "linkedin_search_posts" | "youtube_channel" | "youtube_channel_videos" | "youtube_channel_playlists" | "youtube_channel_shorts" | "youtube_video" | "youtube_search" | "youtube_trending" | "facebook_page" | "facebook_page_posts" | "facebook_page_reels" | "facebook_post" | "facebook_post_comments" | "facebook_group" | "facebook_group_posts" | "facebook_search" | "reddit_search" | "reddit_subreddit_posts" | "reddit_post" | "reddit_post_comments" | "x_search" | "x_profile" | "x_user_posts" | "x_post" | "x_post_comments" | "x_user_connections" | "x_tweet_engagers" | "x_trends" | "resolve_mention", required): Operation name — see the operations catalog.
- `result` (object, required)
  - `summary` (string, required): One-line result, for the reader.
  - `query` (string, required)
  - `subreddit` (string)
  - `count` (integer, required)
  - `truncated` (boolean, required)
  - `posts` (array<object>, required)
    - `id` (string)
    - `url` (string)
    - `title` (string)
    - `text` (string)
    - `subreddit` (string)
    - `author` (string)
    - `score` (number)
    - `num_comments` (number)
    - `created_at` (string)
    - `flair` (string)
    - `over_18` (true)
    - `link_url` (string)
- `requests` (integer, required)
- `credits_charged` (integer, required)

### Errors

- `400` (Error): The request is malformed, or failed input validation. `message` names the field and the rule it broke; `data.issues` carries them individually.
- `401` (Error): No bearer token, or a token that failed verification.
- `402` (Error): The workspace has no credits left, or the caller is over a spending limit.
- `403` (Error): Authenticated, but the caller's role in this workspace does not carry the permission this operation needs.
- `409` (Error): The request is well-formed, but the resource's current state forbids it — a taken name, a last admin, a limit already reached.
- `429` (Error): The caller has spent its rate-limit window. `Retry-After` says when to come back.
- `500` (Error): The request failed on our side. Safe to retry an idempotent operation with backoff.
