> ## Documentation Index
> Fetch the complete documentation index at: https://creatorinsights.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit Subreddit

Searches within a specific subreddit for posts, comments, and media matching a query. Returns posts with title, votes, num\_comments, url, and created\_at; comments with author, body, votes, and parent post info; and media with title, media\_type, image dimensions, and gallery\_count. Supports sort, timeframe filtering, and cursor-based pagination. Scraper responses preserve their public source field names by default (trim omitted or true) while removing only noisy, heavy, or unsafe fields. Set trim=false for the full sanitized source response.

Intelligence uses plan credits; niche searches start at 2, other ordinary fetches at 1, and applicable options can cost more.

> [!NOTE]
>
> Examples use illustrative values. The playground sends a real request. Intelligence can consume plan credits. Publishing examples save drafts.

## Endpoint

**GET** `https://api.creatorinsights.in/v1/reddit/search-subreddits`

**Content type:** Query parameters; no JSON request body.

**Authentication:** `x-api-key: YOUR_SAVED_API_KEY`

**MCP tool:** `search_reddit_subreddit`. See [MCP Setup](https://creatorinsights.mintlify.site/mcp-setup.md) for AI clients.

## Request parameters

**x-workspace-id** `string`

Active workspace ID or current name in your organization. Optional header alternative to passing workspace in the query.

**subreddit** `string` *required*

Subreddit name (e.g. 'Fitness', not 'r/Fitness' or a full URL)

**query** `string`

Search query to find matching content

**sort** `string`

Sort order. For posts/media: relevance, hot, top, new, comments. For comments: relevance, top, new Allowed values: `relevance`, `hot`, `top`, `new`, `comments`.

**timeframe** `string`

Timeframe to filter results Allowed values: `all`, `year`, `month`, `week`, `day`, `hour`.

**cursor** `string`

Cursor to get more results. Get 'cursor' from previous response.

**workspace** `string`

Workspace ID or current name in the authenticated organization. Required for paid requests when the organization has more than one active workspace. The selected workspace receives this request charge.

**trim** `boolean` (default: true)

Defaults to true: preserve public source field names, metrics, and public media URLs while removing only noisy, heavy, or unsafe fields. Set false for the full sanitized source response; credentials, transport headers/context, internal credit data, and upstream-provider identity are always removed.

## Request example

Send these arguments as URL query parameters.

```json theme={null}
{
  "subreddit": "REPLACE_WITH_SUBREDDIT",
  "workspace": "YOUR_WORKSPACE_ID_OR_CURRENT_NAME"
}
```

```bash cURL theme={null}
curl --get 'https://api.creatorinsights.in/v1/reddit/search-subreddits' \
  -H "x-api-key: $CREATOR_INSIGHTS_API_KEY" \
  --data-urlencode 'subreddit=REPLACE_WITH_SUBREDDIT' \
  --data-urlencode 'workspace=YOUR_WORKSPACE_ID_OR_CURRENT_NAME'
```

```javascript Node.js theme={null}
const parameters = {
  "subreddit": "REPLACE_WITH_SUBREDDIT",
  "workspace": "YOUR_WORKSPACE_ID_OR_CURRENT_NAME"
};
const url = new URL('https://api.creatorinsights.in/v1/reddit/search-subreddits');
for (const [name, value] of Object.entries(parameters)) url.searchParams.set(name, String(value));
const response = await fetch(url, { headers: { 'x-api-key': process.env.CREATOR_INSIGHTS_API_KEY } });
const raw = await response.text();
let result;
try { result = JSON.parse(raw); } catch { throw new Error('Non-JSON response: ' + response.status); }
if (!response.ok || result.success === false) throw new Error(result.message || result.error || 'Request failed');
console.log(result.data);
```

```python Python theme={null}
import json, os, requests

arguments = json.loads("{\"subreddit\":\"REPLACE_WITH_SUBREDDIT\",\"workspace\":\"YOUR_WORKSPACE_ID_OR_CURRENT_NAME\"}")
response = requests.get("https://api.creatorinsights.in/v1/reddit/search-subreddits",
    headers={"x-api-key": os.environ["CREATOR_INSIGHTS_API_KEY"]},
    params=arguments, timeout=120)
response.raise_for_status()
result = response.json()
print(result["data"])
```

## Response example

HTTP 200. Illustrative values; optional fields can be omitted, null, or empty. Additional platform fields may be returned.

```json Success theme={null}
{
  "success": true,
  "data": {
    "success": true,
    "posts": [
      {
        "id": "example_id",
        "post_id": "example_id",
        "title": "Example creator content",
        "url": "https://example.com/sample",
        "permalink": "example",
        "nsfw": false,
        "spoiler": false,
        "is_crosspost": false,
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false,
          "icon": "https://media.example.com/sample.jpg",
          "banner": null,
          "description": "https://example.com/sample",
          "weekly_visitors": 1,
          "weekly_contributions": 1
        },
        "votes": 1,
        "num_comments": 120,
        "created_at": "2026-01-01T00:00:00Z",
        "created_at_iso": "2026-01-01T00:00:00Z",
        "thumbnail": null,
        "thumbnail_blurred": false,
        "position": 1,
        "relative_position": 1
      }
    ],
    "comments": [
      {
        "id": "example_id",
        "post_id": "example_id",
        "parent_comment_id": null,
        "is_reply_to_comment": false,
        "author": "example",
        "author_avatar": null,
        "author_nsfw": false,
        "body": "example",
        "images": [],
        "votes": 1,
        "url": "https://example.com/sample",
        "permalink": "example",
        "created_at": "2026-01-01T00:00:00Z",
        "created_at_iso": "2026-01-01T00:00:00Z",
        "post": {
          "id": "example_id",
          "title": "Example creator content",
          "url": "https://example.com/sample",
          "permalink": "example",
          "nsfw": false,
          "spoiler": false,
          "votes": 1,
          "num_comments": 120,
          "created_at": "2026-01-01T00:00:00Z",
          "created_at_iso": "2026-01-01T00:00:00Z"
        },
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false,
          "icon": "https://media.example.com/sample.jpg"
        },
        "position": 1
      }
    ],
    "media": [
      {
        "id": "example_id",
        "title": "Example creator content",
        "url": "https://example.com/sample",
        "permalink": "example",
        "media_type": "example",
        "video": null,
        "image": {
          "src": "https://example.com/sample",
          "width": 1080,
          "height": 1920,
          "resolutions": [
            {
              "url": "https://example.com/sample",
              "width": 1080
            }
          ]
        },
        "gallery_count": null,
        "aspect_ratio": 1,
        "nsfw": false,
        "spoiler": false,
        "is_blurred": false,
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false
        },
        "position": 1,
        "safe_search": "example"
      }
    ],
    "cursor": "EXAMPLE_CURSOR"
  },
  "credits_charged": 1
}
```

## Response fields

**success** `boolean` *required*

Whether this operation succeeded. Also check HTTP status and nested platform statuses.

**data** `object` *required*

Operation-specific payload. See the nested field table and response example below.

**credits\_charged** `number`

Creator Insights plan credits for this call; the example is illustrative.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data` | object | Public source field names are preserved by default when trim is omitted or true; only noisy, heavy, or unsafe fields are removed. Set trim=false for the full sanitized source response. Fields vary with source availability; unavailable metrics are null. |
| `data.success` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts` | array | List of returned entries; may be empty. |
| `data.posts[].id` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].post_id` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].title` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].url` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].permalink` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].spoiler` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].is_crosspost` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit` | object | Nested object. Expand the response schema for its fields. |
| `data.posts[].subreddit.id` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.name` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.quarantined` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.icon` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.banner` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.posts[].subreddit.description` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.weekly_visitors` | integer | Example response field. Availability depends on the record and selected options. |
| `data.posts[].subreddit.weekly_contributions` | integer | Example response field. Availability depends on the record and selected options. |
| `data.posts[].votes` | integer | Example response field. Availability depends on the record and selected options. |
| `data.posts[].num_comments` | integer | Example response field. Availability depends on the record and selected options. |
| `data.posts[].created_at` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].created_at_iso` | string | Example response field. Availability depends on the record and selected options. |
| `data.posts[].thumbnail` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.posts[].thumbnail_blurred` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.posts[].position` | integer | Example response field. Availability depends on the record and selected options. |
| `data.posts[].relative_position` | integer | Example response field. Availability depends on the record and selected options. |
| `data.comments` | array | List of returned entries; may be empty. |
| `data.comments[].id` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post_id` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].parent_comment_id` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.comments[].is_reply_to_comment` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].author` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].author_avatar` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.comments[].author_nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].body` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].images` | array | List of returned entries; may be empty. |
| `data.comments[].votes` | integer | Example response field. Availability depends on the record and selected options. |
| `data.comments[].url` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].permalink` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].created_at` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].created_at_iso` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post` | object | Nested object. Expand the response schema for its fields. |
| `data.comments[].post.id` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.title` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.url` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.permalink` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.spoiler` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.votes` | integer | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.num_comments` | integer | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.created_at` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].post.created_at_iso` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].subreddit` | object | Nested object. Expand the response schema for its fields. |
| `data.comments[].subreddit.id` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].subreddit.name` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].subreddit.nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].subreddit.quarantined` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.comments[].subreddit.icon` | string | Example response field. Availability depends on the record and selected options. |
| `data.comments[].position` | integer | Example response field. Availability depends on the record and selected options. |
| `data.media` | array | List of returned entries; may be empty. |
| `data.media[].id` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].title` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].url` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].permalink` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].media_type` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].video` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.media[].image` | object | Nested object. Expand the response schema for its fields. |
| `data.media[].image.src` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].image.width` | integer | Example response field. Availability depends on the record and selected options. |
| `data.media[].image.height` | integer | Example response field. Availability depends on the record and selected options. |
| `data.media[].image.resolutions` | array | List of returned entries; may be empty. |
| `data.media[].gallery_count` | value | Null in the illustrative response. No concrete type is asserted; may be unavailable or populated for another record. |
| `data.media[].aspect_ratio` | integer | Example response field. Availability depends on the record and selected options. |
| `data.media[].nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.media[].spoiler` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.media[].is_blurred` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.media[].subreddit` | object | Nested object. Expand the response schema for its fields. |
| `data.media[].subreddit.id` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].subreddit.name` | string | Example response field. Availability depends on the record and selected options. |
| `data.media[].subreddit.nsfw` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.media[].subreddit.quarantined` | boolean | Example response field. Availability depends on the record and selected options. |
| `data.media[].position` | integer | Example response field. Availability depends on the record and selected options. |
| `data.media[].safe_search` | string | Example response field. Availability depends on the record and selected options. |
| `data.cursor` | string | Example response field. Availability depends on the record and selected options. |
| `credits_charged` | number | Example response field. Availability depends on the record and selected options. |

The interactive schema includes deeper nested fields. Sample fields are descriptive, not a promise that every record includes them.

## n8n and JSON tool endpoint

**POST** `https://api.creatorinsights.in/api/v1/tools/search_reddit_subreddit`. Use Header Auth with `x-api-key` and body content type JSON. This alias returns the n8n envelope below; included operations can report zero credits\_deducted.

```bash theme={null}
curl -X POST 'https://api.creatorinsights.in/api/v1/tools/search_reddit_subreddit' \
  -H "x-api-key: $CREATOR_INSIGHTS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{\"subreddit\":\"REPLACE_WITH_SUBREDDIT\",\"workspace\":\"YOUR_WORKSPACE_ID_OR_CURRENT_NAME\"}'
```

```json theme={null}
{
  "status": true,
  "tool": "search_reddit_subreddit",
  "credits_deducted": 1,
  "data": {
    "success": true,
    "posts": [
      {
        "id": "example_id",
        "post_id": "example_id",
        "title": "Example creator content",
        "url": "https://example.com/sample",
        "permalink": "example",
        "nsfw": false,
        "spoiler": false,
        "is_crosspost": false,
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false,
          "icon": "https://media.example.com/sample.jpg",
          "banner": null,
          "description": "https://example.com/sample",
          "weekly_visitors": 1,
          "weekly_contributions": 1
        },
        "votes": 1,
        "num_comments": 120,
        "created_at": "2026-01-01T00:00:00Z",
        "created_at_iso": "2026-01-01T00:00:00Z",
        "thumbnail": null,
        "thumbnail_blurred": false,
        "position": 1,
        "relative_position": 1
      }
    ],
    "comments": [
      {
        "id": "example_id",
        "post_id": "example_id",
        "parent_comment_id": null,
        "is_reply_to_comment": false,
        "author": "example",
        "author_avatar": null,
        "author_nsfw": false,
        "body": "example",
        "images": [],
        "votes": 1,
        "url": "https://example.com/sample",
        "permalink": "example",
        "created_at": "2026-01-01T00:00:00Z",
        "created_at_iso": "2026-01-01T00:00:00Z",
        "post": {
          "id": "example_id",
          "title": "Example creator content",
          "url": "https://example.com/sample",
          "permalink": "example",
          "nsfw": false,
          "spoiler": false,
          "votes": 1,
          "num_comments": 120,
          "created_at": "2026-01-01T00:00:00Z",
          "created_at_iso": "2026-01-01T00:00:00Z"
        },
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false,
          "icon": "https://media.example.com/sample.jpg"
        },
        "position": 1
      }
    ],
    "media": [
      {
        "id": "example_id",
        "title": "Example creator content",
        "url": "https://example.com/sample",
        "permalink": "example",
        "media_type": "example",
        "video": null,
        "image": {
          "src": "https://example.com/sample",
          "width": 1080,
          "height": 1920,
          "resolutions": [
            {
              "url": "https://example.com/sample",
              "width": 1080
            }
          ]
        },
        "gallery_count": null,
        "aspect_ratio": 1,
        "nsfw": false,
        "spoiler": false,
        "is_blurred": false,
        "subreddit": {
          "id": "example_id",
          "name": "Example creator content",
          "nsfw": false,
          "quarantined": false
        },
        "position": 1,
        "safe_search": "example"
      }
    ],
    "cursor": "EXAMPLE_CURSOR"
  }
}
```

## Errors

Handle non-2xx responses before mapping data. Error codes vary with the cause; these are representative examples. A 429 response may be plain text. Never treat a queued post as published or blindly retry a partial publication.

```json theme={null}
{
  "success": false,
  "error": "UNAUTHORIZED",
  "message": "Missing or invalid API key"
}
```

| HTTP status | Meaning |
| - | - |
| 400 | Invalid arguments |
| 401 | Missing or invalid API key |
| 402 | Insufficient Creator Insights plan credits |
| 403 | Subscription or permission required |
| 404 | Resource not found |
| 409 | Conflicting request, idempotency key, or unfinished upload |
| 410 | Managed media expired; upload the file again |
| 413 | Media too large |
| 415 | Unsupported media type |
| 422 | Account selection, connection, or platform payload needs attention |
| 500 | Authentication or server error |
| 503 | Service temporarily unavailable or operation failed; inspect saved status before retrying |
| 429 | Rate limit; inspect response headers and retry later. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.