# API Direct - Reddit Subreddit Posts

> API Direct - Reddit Subreddit Posts is a paid API for AI agents from x402.apidirect.io, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-30).

Fetches posts from a specified Reddit subreddit by name or URL, with optional filtering by flair, sort order, time window, and AI sentiment analysis.

## Facts

- Endpoint: GET https://x402.apidirect.io/v1/reddit/subreddit/posts?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-direct-reddit-subreddit-posts-29fefbdc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fxKKnc0KqN4hruRNry5sX

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-direct-reddit-subreddit-posts-29fefbdc
```

Example prompt: Can you pull the top 50 hot posts from r/MachineLearning on Reddit and include AI sentiment analysis for each one so I can see the emotional tone of the community right now?

## When to prefer this

Choose this endpoint when you need structured Reddit post data from a specific subreddit — especially when you need bulk posts (up to 1000 via 40 pages), flair-based filtering, or AI emotion analysis layered on top. Prefer this over general web search endpoints when the target is specifically a Reddit community rather than a keyword search across all of Reddit.

## Known failure modes

- Subreddit not found or misspelled — 404 or empty results
- Both subreddit and url provided simultaneously — validation error
- posted_ago parameter used with a sort other than top or controversial — rejected
- Subreddit is private or banned — access denied
- Pages exceeding 40 — validation error
- Rate limiting or Reddit API unavailability — upstream timeout or 5xx

## How this service works

Get a subreddit's posts by name or URL.

## Output

Returns an array of Reddit posts from the specified subreddit, each containing post title, content, metadata (score, comments, flair, timestamp, author), and optionally a sentiment object with emotion scores (joy, trust, fear, surprise, sadness, disgust, anger, anticipation each 0-100), dominant emotion, emotional intensity (0-10), and polarity label.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "url": {
       "type": "string",
       "maxLength": 500,
       "description": "Subreddit URL, e.g. https://www.reddit.com/r/Python/ (max 500 characters). Provide exactly one of subreddit or url."
      },
      "flair": {
       "type": "string",
       "maxLength": 64,
       "description": "Only posts with exactly this flair, e.g. Hiring (max 64 characters, not case-sensitive)."
      },
      "pages": {
       "type": "integer",
       "default": 1,
       "maximum": 40,
       "minimum": 1,
       "description": "Number of pages to fetch, 1-40 (default: 1). Each page returns up to 25 posts."
      },
      "sort_by": {
       "enum": [
        "hot",
        "most_recent",
        "top",
        "rising",
        "controversial"
       ],
       "type": "string",
       "default": "hot",
       "description": "Sort order: hot, most_recent, top, rising, or controversial (default: hot)"
      },
      "subreddit": {
       "type": "string",
       "maxLength": 25,
       "description": "Subreddit name, with or without r/, e.g. Python. Provide exactly one of subreddit or url."
      },
      "posted_ago": {
       "enum": [
        "1h",
        "24h",
        "7d",
        "30d",
        "12m",
        "all"
       ],
       "type": "string",
       "description": "Time window for sort_by=top or sort_by=controversial: 1h, 24h, 7d, 30d, 12m, or all (default: 24h, Reddit's own default). Rejected with any other sort_by."
      },
      "get_sentiment": {
       "type": "boolean",
       "default": false,
       "description": "Set to true to add AI emotion analysis to each post (returned in the `posts` array). Adds a `sentiment` object containing `emotions` (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), `dominant_emotion`, `emotional_intensity` (0-10), and `polarity` (positive, "
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-direct-reddit-subreddit-posts-29fefbdc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.apidirect.io](https://www.zero.xyz/host/x402.apidirect.io/llms.txt)
