{"uid":"cap_fxKKnc0KqN4hruRNry5sX","slug":"api-direct-reddit-subreddit-posts-29fefbdc","name":"API Direct - Reddit Subreddit Posts","description":"Get a subreddit's posts by name or URL.","url":"https://x402.apidirect.io/v1/reddit/subreddit/posts?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5by-AcwS8GLldzspyURMn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches posts from a specified Reddit subreddit by name or URL, with optional filtering by flair, sort order, time window, and AI sentiment analysis.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Monitor trending posts in a niche community","prompt":"Fetch the top 25 hot posts from r/startups on Reddit and include sentiment analysis so I can understand what the startup community is excited or worried about today."},{"title":"Research job listings in a subreddit","prompt":"Pull 2 pages of posts from r/forhire sorted by most recent, and only show me posts with the 'Hiring' flair — I want to see the latest job opportunities people are posting."},{"title":"Analyze controversial discussions over past week","prompt":"Get the controversial posts from r/technology over the last 7 days — I want to see what's sparking the most debate in that community."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:07:20.545Z","isFirstParty":false,"canonicalSlug":"api-direct-reddit-subreddit-posts-29fefbdc"}