{"openapi":"3.1.0","info":{"title":"Reddit Posts Comments and Subreddits Data (x402 & MCP)","version":"0.1.0","description":"Public Reddit posts, subreddit feeds, search results, comment threads and community metadata, one row per entity.","x-guidance":"Structured real-time web intelligence APIs paid per delivered row in USDC via x402 on Base, Polygon, Arbitrum, Monad, World Chain and Solana. All endpoints are synchronous at POST /s/<site>/v1/<endpoint> and also exposed over stateless MCP at POST /mcp. Supports x402 v2 'upto' (Permit2) and 'exact' (EIP-3009) on EVM chains, and 'exact' (SPL USDC transfer, facilitator-paid fees) on Solana. 'upto' charges only for the rows delivered. 'exact' settles the full quoted amount (quoted rows x the row price) even when fewer rows than maxResults are delivered. Empty/0-row (404), invalid input (422), and upstream failures or timeouts (503, see error.code) are never charged.","contact":{"email":"ops@opendata.best"}},"servers":[{"url":"https://agensi.opendata.best"}],"paths":{"/s/reddit-com/v1/search":{"post":{"operationId":"reddit_com_search","summary":"Reddit Posts Comments and Subreddits Data: Search Reddit posts, subreddits and comments","description":"Fetch public Reddit posts by subreddit, search query, preset catalog or post ID with optional comments and community metadata. Unit price: $0.003000/row USDC (default quote 5 rows, max 10 rows). Unsettled / 0-row / error responses are never charged.","tags":["reddit-com","Social"],"x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"dynamic","currency":"USD","amount":"0.015000"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddits":{"type":"array","items":{"type":"string"},"description":"Subreddit names to scrape (with or without r/). Example: [\"forhire\", \"freelance\"]. Fill this, Search Queries, or Subreddit catalog topic — any one is enough. Explicitly pass an empty array (subreddits=[]) with searchQueries for a site-wide Reddit search. Omitting subreddits and all other targets defaults to r/forhire; a searchQueries-only input also runs a site-wide search."},"searchQueries":{"type":"array","items":{"type":"string"},"description":"Keywords to search. With subreddits set, searches inside each subreddit. With subreddits empty, runs a site-wide Reddit search. If empty while subreddits are set, scrapes the subreddit feed (new/hot/top) without keyword filtering."},"subredditCatalog":{"type":"string","description":"Pick a built-in topic instead of naming subreddits. Its subreddit list is merged with Subreddits (deduplicated). Enough on its own to start a run.","enum":["hiring","programming","housing","tickets","local","classifieds","remote_jobs","startups"]},"postIds":{"type":"array","items":{"type":"string"},"description":"Collect specific posts by id or link instead of a feed: t3_ fullnames, bare ids, or reddit.com/r/<sub>/comments/<id> permalinks. Detail mode returns one row per post with the full post record and is not combined with Subreddits or Search Queries."},"maxResults":{"type":"integer","description":"Most rows this call returns, 1 to 10 (default 5). All row types count toward it. The 402 payment quote is maxResults x $0.0030/row USDC: with the upto scheme you pay only for the rows delivered, with exact you pay the quoted amount. Calls that return 0 rows or fail are not charged.","default":5,"minimum":1,"maximum":10},"sort":{"type":"string","description":"How to sort results. 'new' for latest, 'hot' for trending, 'top' for highest scored, 'relevance' for search relevance (only with searchQueries — listing mode falls back to 'new').","default":"new","enum":["new","hot","top","relevance"]},"timeFilter":{"type":"string","description":"Time range filter. Applies to 'top' sort and search results.","default":"week","enum":["hour","day","week","month","year","all"]},"includeComments":{"type":"boolean","description":"Add available comments and nested replies as separate billed rows. Comments share the maxResults limit with posts and other enabled rows; complete threads are not guaranteed.","default":false},"maxComments":{"type":"integer","description":"Maximum comment rows per post, including available nested replies, when includeComments is enabled. The remaining maxResults limit can reduce this number.","default":10,"minimum":1,"maximum":100},"expandCommentSubtrees":{"type":"integer","description":"When includeComments is on, spend up to this many extra requests filling replies that the comment page left out. Each expansion is one request and still counts against maxComments. Set 0 to turn it off.","default":0,"minimum":0,"maximum":25},"allowListingFallback":{"type":"boolean","description":"Allow an empty top/week subreddit feed to retry as new, without a time restriction. Leave off to keep the requested sort and time range.","default":false},"includeSubredditMeta":{"type":"boolean","description":"Add public details for communities found in collected posts as separate subreddit rows. Each row is billed at the same price and counts toward maxResults.","default":false},"includeUserMeta":{"type":"boolean","description":"Add available public details for post authors as separate user rows, such as karma and account creation time. Each row is billed at the same price and counts toward maxResults.","default":false},"expandRelatedSubreddits":{"type":"boolean","description":"When a subreddits entry names a catalog topic (hiring, programming, housing, tickets, local, classifieds, remote_jobs, startups), expand it into the full subreddit list for that topic. Without this flag a topic token is passed through verbatim.","default":false}},"additionalProperties":false},"example":{"subreddits":["forhire"],"sort":"new","timeFilter":"week","includeComments":false,"maxResults":5}}}},"responses":{"200":{"description":"Synchronous data rows with x402 PAYMENT-RESPONSE receipt header.","headers":{"PAYMENT-RESPONSE":{"description":"Base64-encoded x402 v2 SettleResponse receipt.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response_reddit_com"},"example":{"jobId":"job_reddit-c_example","status":"succeeded","done":true,"rowCount":1,"rowsBilled":1,"rowsDelivered":1,"rows":[{"rowType":"example_rowType","title":"example_title","subreddit":"example_subreddit","author":"example_author","score":10,"numComments":"example_numComments"}],"meta":{"site":"reddit-com","endpoint":"search","maxResults":5,"payment":{"scheme":"upto","network":"eip155:8453","quotedMicrousd":15000,"settledMicrousd":3000,"transaction":"0x0000000000000000000000000000000000000000000000000000000000000000"}}}}}},"402":{"description":"Payment required or invalid/declined payment authorization (never charged).","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired quote.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"no_results: 0 rows matched the query; aborted before settlement (charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"payment_id_conflict: payment-identifier reused with different parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid or missing request parameters (validated before /verify; charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or payer cooldown exceeded (charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"error.code collection_failed / source_blocked (upstream source failed or blocked) or upstream_timeout (synchronous deadline reached, task cancelled): charged=false. Also settlement_pending or facilitator_unavailable; retry same payment to reconcile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/s/reddit-com/v1/health":{"get":{"operationId":"reddit_com_health","summary":"Reddit Posts Comments and Subreddits Data: health check","description":"Free readiness check (never returns 402 and never starts a collection).","tags":["reddit-com","health"],"responses":{"200":{"description":"Operational","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"charged":{"type":"boolean"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}},"Row_reddit_com":{"type":"object","properties":{"rowType":{"type":["string","number","boolean","object","array","null"]},"title":{"type":["string","number","boolean","object","array","null"]},"subreddit":{"type":["string","number","boolean","object","array","null"]},"author":{"type":["string","number","boolean","object","array","null"]},"score":{"type":["number","string","null"]},"numComments":{"type":["string","number","boolean","object","array","null"]},"commentsFetched":{"type":["string","number","boolean","object","array","null"]},"createdAt":{"type":["string","number","boolean","object","array","null"]},"url":{"type":["string","null"],"format":"uri"},"scrapedAt":{"type":["string","number","boolean","object","array","null"]}},"additionalProperties":true},"Response_reddit_com":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"done":{"type":"boolean"},"rowCount":{"type":"integer","minimum":1},"rowsBilled":{"type":"integer","minimum":1},"rowsDelivered":{"type":"integer","minimum":1},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row_reddit_com"}},"meta":{"type":"object","properties":{"site":{"type":"string"},"endpoint":{"type":"string"},"maxResults":{"type":"integer"},"payment":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"quotedMicrousd":{"type":"integer"},"settledMicrousd":{"type":"integer"},"transaction":{"type":"string"},"payer":{"type":"string"}}}}}},"required":["jobId","status","done","rowCount","rows"]}}}}