# Search posts

Search public posts globally or within selected subreddits, with Reddit sort and time filters and cursor pagination. May take up to 60 seconds.

- Platform: [Reddit](https://docs.upscrape.com/docs/platforms/reddit)
- Capability ID: `reddit.posts.search`
- Cost: 1 credit per request
- Maximum runtime: 60 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "limit": 25,
    "q": "supabase alternative",
    "sort": "new",
    "time": "all"
  },
  "capability": "reddit.posts.search"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `string` | No | Opaque cursor from a previous result's next field. |
| `limit` | `integer` | No | Page size (default 50). From 1 to 100. Default: `50`. |
| `q` | `string` | Yes | Search query passed to Reddit's public post search. |
| `sort` | `string` | No | Reddit search order. Allowed values: `relevance`, `hot`, `top`, `new`, `comments`. Default: `new`. |
| `subreddits` | `string` | No | Comma-separated individual community names. Aggregate feeds all and popular are unavailable; omit this field for global post search. |
| `time` | `string` | No | Search time window. Allowed values: `hour`, `day`, `week`, `month`, `year`, `all`. Default: `all`. |

### Example input

```json
{
  "limit": 25,
  "q": "supabase alternative",
  "sort": "new",
  "time": "all"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "items": [
    {
      "author": "ClaudeAI-mod-bot",
      "body": "Agentic Engineering Workflow: Shared Knowledge Base with Adversarial AI Review Workflow value: 75/100 Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: advanced Categories: Quality Control, Token Saving, Context & Memory, Debugging, Shipping, CLAUDE.md, Skills, MCP, Multi-Agent Original source: r/ClaudeAI post/comment What problem this solves Inefficient knowledge sharing and review p…",
      "created_utc": 1787372245,
      "id": "t3_1vv28k3",
      "nsfw": false,
      "num_comments": 0,
      "num_comments_available": false,
      "permalink": "https://www.reddit.com/r/ClaudeWorkflows/comments/1vv28k3/workflow_agentic_engineering_workflow_shared/",
      "score": 0,
      "score_available": false,
      "subreddit": "ClaudeWorkflows",
      "title": "[Workflow] Agentic Engineering Workflow: Shared Knowledge Base with Adversarial AI Review",
      "type": "post",
      "url": null
    },
    {
      "author": "take52020",
      "body": "I built an internal tool for my team using Lovable. We're an advertising agency and the tool stores a lot of images, videos, and other content that our team accesses regularly. I'm using Supabase for the database and file storage right now, but the egress charges are starting to get surprisingly expensive as the amount of content and usage grows. Has anyone else run into this with Supabase? I'm wo…",
      "created_utc": 1787369880,
      "id": "t3_1vv1gng",
      "nsfw": false,
      "num_comments": 0,
      "num_comments_available": false,
      "permalink": "https://www.reddit.com/r/lovable/comments/1vv1gng/alternatives_to_supabase_for_storing_files/",
      "score": 0,
      "score_available": false,
      "subreddit": "lovable",
      "title": "Alternatives to supabase for storing files?",
      "type": "post",
      "url": null
    },
    {
      "author": "bitdoze",
      "body": "I've been tracking the growth of self-hosted apps on Cloudflare Workers and decided to put together a comprehensive list. Every project on this list runs entirely on Workers + D1 + R2/KV/Durable Objects — no VPS, no Docker, no server to maintain. Here are some highlights by category: Email (8 apps ) — Agentic Inbox (6.9k ⭐, official Cloudflare project), HQBase (shared team inbox with per-mailbox R…",
      "created_utc": 1787301675,
      "id": "t3_1vualgt",
      "nsfw": false,
      "num_comments": 0,
      "num_comments_available": false,
      "permalink": "https://www.reddit.com/r/selfhosted/comments/1vualgt/[redacted:token]/",
      "score": 0,
      "score_available": false,
      "subreddit": "selfhosted",
      "title": "I cataloged 28 self-hosted apps that run entirely on Cloudflare Workers",
      "type": "post",
      "url": null
    }
  ],
  "next": "t3_1vlrox1"
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `next` | `string` | t3_1vlrox1 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
