{"openapi":"3.1.0","info":{"title":"Surf Reddit","version":"1.0.0","description":"Reddit data API with x402 or MPP micropayments. All endpoints require x402 or MPP payment (USDC on Solana, Base, or Tempo).","x-guidance":"Reddit data API. Search posts, browse subreddits, fetch posts with comments, user profiles. Pricing: $0.001 (lookups), $0.003 (listings), $0.004 (posts/user content), $0.005 (search). All requests require x402 or MPP payment (USDC on Solana, Base, or Tempo)."},"servers":[{"url":"https://reddit.surf.cascade.fyi"}],"components":{"schemas":{"PostsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]},"Post":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"author":{"type":"string"},"subreddit":{"type":"string"},"url":{"type":"string"},"permalink":{"type":"string"},"selftext":{"type":"string"},"created_at":{"type":"string"},"time_ago":{"type":"string"},"is_self":{"type":"boolean"},"over_18":{"type":"boolean"},"thumbnail":{"type":"string"},"post_hint":{"type":"string"},"link_flair_text":{"type":"string"},"public_metrics":{"$ref":"#/components/schemas/PostMetrics"}},"required":["id"]},"PostMetrics":{"type":"object","properties":{"score":{"type":"integer"},"num_comments":{"type":"integer"},"upvote_ratio":{"type":"number"}},"required":["score","num_comments"]},"PaginationMeta":{"type":"object","properties":{"result_count":{"type":"integer"},"has_next_page":{"type":"boolean"},"next_cursor":{"type":"string"}},"required":["result_count","has_next_page"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"]},"SubredditResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Subreddit"}},"required":["data"]},"Subreddit":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"public_description":{"type":"string"},"subscribers":{"type":"integer"},"active_users":{"type":"integer"},"created_at":{"type":"string"},"over_18":{"type":"boolean"},"url":{"type":"string"}},"required":["name"]},"PostDetailResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Post"},"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"meta":{"type":"object","properties":{"comment_count":{"type":"integer"}},"required":["comment_count"]}},"required":["data","comments","meta"]},"Comment":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"body":{"type":"string"},"score":{"type":"integer"},"created_at":{"type":"string"},"time_ago":{"type":"string"},"depth":{"type":"integer"},"parent_id":{"type":"string"},"is_submitter":{"type":"boolean"}},"required":["id"]},"RedditUserResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RedditUser"}},"required":["data"]},"RedditUser":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"link_karma":{"type":"integer"},"comment_karma":{"type":"integer"},"is_gold":{"type":"boolean"},"is_mod":{"type":"boolean"},"icon_img":{"type":"string"}},"required":["name"]},"CommentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}},"parameters":{}},"paths":{"/search":{"get":{"tags":["Search"],"summary":"Search Reddit posts","description":"Search across all of Reddit with filters","parameters":[{"schema":{"type":"string","minLength":1,"description":"Search query","example":"x402 protocol"},"required":true,"description":"Search query","name":"q","in":"query"},{"schema":{"type":"string","enum":["relevance","hot","top","new","comments"],"default":"relevance","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time range"},"required":false,"description":"Time range","name":"t","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Max results"},"required":false,"description":"Max results","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005"}}},"/r/{subreddit}/posts":{"get":{"tags":["Subreddits"],"summary":"Subreddit posts","description":"Fetch posts from a subreddit by sort order","parameters":[{"schema":{"type":"string","minLength":1,"description":"Subreddit name","example":"programming"},"required":true,"description":"Subreddit name","name":"subreddit","in":"path"},{"schema":{"type":"string","enum":["hot","new","top","rising"],"default":"hot","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"day","description":"Time range (for top sort)"},"required":false,"description":"Time range (for top sort)","name":"t","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Max results"},"required":false,"description":"Max results","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"Posts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.003"}}},"/r/{subreddit}":{"get":{"tags":["Subreddits"],"summary":"Subreddit info","description":"Fetch subreddit metadata (description, subscribers, etc.)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Subreddit name","example":"programming"},"required":true,"description":"Subreddit name","name":"subreddit","in":"path"}],"responses":{"200":{"description":"Subreddit info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubredditResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.001"}}},"/posts/{id}":{"get":{"tags":["Posts"],"summary":"Post with comments","description":"Fetch a post and its comments. Comments are flattened with depth and parent_id fields.","parameters":[{"schema":{"type":"string","description":"Post ID or full Reddit URL","example":"1a2b3c"},"required":true,"description":"Post ID or full Reddit URL","name":"id","in":"path"},{"schema":{"type":"string","enum":["confidence","top","new","controversial","old","qa"],"default":"confidence","description":"Comment sort order"},"required":false,"description":"Comment sort order","name":"comment_sort","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":200,"default":50,"description":"Max comments"},"required":false,"description":"Max comments","name":"comment_limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":10,"default":5,"description":"Max comment nesting depth"},"required":false,"description":"Max comment nesting depth","name":"comment_depth","in":"query"}],"responses":{"200":{"description":"Post with comments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDetailResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.004"}}},"/users/{username}":{"get":{"tags":["Users"],"summary":"User profile","description":"Fetch Reddit user profile (karma, account age, etc.)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Reddit username","example":"spez"},"required":true,"description":"Reddit username","name":"username","in":"path"}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedditUserResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.001"}}},"/users/{username}/posts":{"get":{"tags":["Users"],"summary":"User posts","description":"Fetch posts submitted by a user","parameters":[{"schema":{"type":"string","minLength":1,"description":"Reddit username","example":"spez"},"required":true,"description":"Reddit username","name":"username","in":"path"},{"schema":{"type":"string","enum":["hot","new","top","controversial"],"default":"new","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time range"},"required":false,"description":"Time range","name":"t","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Max results"},"required":false,"description":"Max results","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"User posts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.004"}}},"/users/{username}/comments":{"get":{"tags":["Users"],"summary":"User comments","description":"Fetch comments by a user","parameters":[{"schema":{"type":"string","minLength":1,"description":"Reddit username","example":"spez"},"required":true,"description":"Reddit username","name":"username","in":"path"},{"schema":{"type":"string","enum":["hot","new","top","controversial"],"default":"new","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time range"},"required":false,"description":"Time range","name":"t","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Max results"},"required":false,"description":"Max results","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"User comments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required"}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.004"}}}}}