{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & Search",
    "description": "Scrape Reddit posts, comments, subreddits, user profiles and keyword search results. Filter by flair, score and date; export reply trees, text and media to JSON, CSV or Excel. No Reddit API key required. Run through the Apify API or connect n8n, Make and Zapier.",
    "version": "1.8",
    "x-build-id": "hfq8GtueXa7fBKOT4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smart_albatross~reddit-posts-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smart_albatross-reddit-posts-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/smart_albatross~reddit-posts-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-smart_albatross-reddit-posts-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/smart_albatross~reddit-posts-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-smart_albatross-reddit-posts-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What do you want to collect?",
            "enum": [
              "auto",
              "posts",
              "comments",
              "posts-and-comments",
              "flairs",
              "communities",
              "users",
              "comment-search"
            ],
            "type": "string",
            "description": "Choose posts, posts with comments, comment rows from post URLs, or keyword-matching comments. Auto detects ordinary URLs. No separate Search mode is needed.",
            "default": "auto"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Names without r/, e.g. n8n and automation. For posts, add a keyword to search within these communities. Required for comment keyword search. Leave empty when using URLs instead.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs (alternative to subreddit names)",
            "type": "array",
            "description": "Subreddit feeds, posts, profiles or complete search URLs. With a keyword, subreddit feeds become scoped post searches. For comment keyword search use Subreddits instead. Do not enter the same source twice.",
            "items": {
              "type": "string"
            }
          },
          "search": {
            "title": "Keyword or search query (optional for posts)",
            "type": "string",
            "description": "With subreddit names/feed URLs: search posts in those communities. With no sources: global Reddit search. Posts use Reddit search syntax, not strict literal filtering. Comment keyword search requires literal text and Subreddits."
          },
          "maxItems": {
            "title": "Maximum output rows",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum saved rows across this run, after filtering and deduplication. Default 100; 0 removes this cap, not Reddit's coverage limits. Comment trees have separate expansion caps below."
          },
          "sort": {
            "title": "Result order",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments",
              "rising",
              "controversial",
              "best"
            ],
            "type": "string",
            "description": "Post search: relevance, hot, top, new, comments. Comment keyword search: new, top, relevance. Feeds use their URL order; when adding a keyword to a feed, this field orders the search instead."
          },
          "time": {
            "title": "Time range",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day",
              "hour"
            ],
            "type": "string",
            "description": "Reddit search/top-feed time window. For exact timestamps use Optional filters. Not every feed sort supports time windows."
          },
          "postedAfter": {
            "title": "Posted on or after",
            "type": "string",
            "description": "Inclusive ISO date/time, e.g. 2026-09-01 or 2026-09-01T12:00:00Z."
          },
          "postedBefore": {
            "title": "Posted on or before",
            "type": "string",
            "description": "Inclusive ISO date/time. Date-only values mean midnight UTC."
          },
          "flair": {
            "title": "Post flair text",
            "type": "string",
            "description": "Only post rows with this exact flair text (case insensitive). Continues pagination until the output/page limit or feed exhaustion."
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -1000000,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Minimum score for post and comment rows."
          },
          "minComments": {
            "title": "Minimum comment count",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Minimum Reddit-reported comment count for post rows."
          },
          "nsfw": {
            "title": "NSFW content",
            "enum": [
              "include",
              "exclude",
              "only"
            ],
            "type": "string",
            "description": "Filters returned rows by Reddit's NSFW flag. Does not grant access to restricted content."
          },
          "maxComments": {
            "title": "Total comments to expand",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Comment trees only: total comments retrieved across posts. Default 100. Use 0 to remove this expansion cap; Maximum output rows still applies to flat comment output.",
            "default": 100
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional per-post cap. Set 0 for no per-post cap.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Ordering used for comment trees.",
            "default": "confidence"
          },
          "keywordMatch": {
            "title": "Comment keyword matching",
            "enum": [
              "substring",
              "whole-word",
              "phrase"
            ],
            "type": "string",
            "description": "Comment-search mode only. Defaults to substring. Applied to the full current comment body before saving. Reddit's index determines which candidates are discoverable; substring matching does not expand its index coverage."
          },
          "caseSensitive": {
            "title": "Case-sensitive comment matching",
            "type": "boolean",
            "description": "Comment-search mode only. False by default; true requires matching letter case in the comment body."
          },
          "maxScannedComments": {
            "title": "Maximum scanned comments",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Comment-search safety cap across all sources, counting candidates including duplicates and non-matches. Defaults to 10000. Separate from Maximum output rows, which counts only verified matches. Check SUMMARY for early stops."
          },
          "endPage": {
            "title": "Maximum pages per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum listing pages fetched per source. Comment search defaults to 20 per subreddit; other modes default to no page cap. 0 removes this cap, but comment search still enforces Maximum scanned comments."
          },
          "searchMode": {
            "title": "Search mode",
            "pattern": "^(?:link|sr|user|comment)$",
            "type": "string",
            "description": "Select what the keyword search returns. Comment search requires Subreddits below and a literal keyword/phrase; clear Start URLs."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Expand replies and attach a reply tree plus commentsFlat under each post. maxComments and maxCommentsPerPost bound expansion. Nested comments are part of the post row."
          },
          "pageSize": {
            "title": "Posts per request",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Up to 100 listing records per request; use 25 when comparing page counts with smaller-page scrapers."
          },
          "flairId": {
            "title": "Post flair template ID",
            "type": "string",
            "description": "Exact flair template ID. Use flair discovery to retrieve IDs and colors."
          },
          "authorFlair": {
            "title": "Author flair text",
            "type": "string",
            "description": "Only post/comment rows with this exact author flair (case insensitive)."
          },
          "discoverFlairs": {
            "title": "Discover subreddit flairs",
            "type": "boolean",
            "description": "Emit available flair templates before scraping each subreddit URL. Flair rows count toward maxItems. Use mode flairs with subreddit to retrieve templates only."
          },
          "outputFormat": {
            "title": "Output naming",
            "pattern": "^(?:epctex|legacy)$",
            "type": "string",
            "description": "epctex naming uses lowercase types, full post IDs, and compatible aliases; comments keep short IDs plus commentId. Legacy preserves original post id/type."
          },
          "subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name without r/. Use this or Profile, not both."
          },
          "profile": {
            "title": "Profile",
            "type": "string",
            "description": "Reddit username without u/. Use this or Subreddit, not both."
          },
          "maxPosts": {
            "title": "Maximum posts",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique posts. Set 0 to continue until Reddit exhausts its listing."
          },
          "postSort": {
            "title": "Post sort",
            "pattern": "^(?:new|hot|top|controversial)$",
            "type": "string",
            "description": "Legacy post-sort option. Prefer Sort above for URL/search runs; original browser-only CLI profile continuation supports New."
          },
          "timeRange": {
            "title": "Post time range",
            "pattern": "^(?:hour|day|week|month|year|all)$",
            "type": "string",
            "description": "Time filter used by Top and Controversial post sorts."
          },
          "includePromoted": {
            "title": "Include promoted posts",
            "type": "boolean",
            "description": "Include advertisements when Reddit returns them."
          },
          "skipRemoved": {
            "title": "Skip removed comments",
            "type": "boolean",
            "description": "Drop comment rows whose body is [removed] or [deleted]."
          },
          "includePostBody": {
            "title": "Repeat post body on comment rows",
            "type": "boolean",
            "description": "Convenient for flat exports but increases dataset size."
          },
          "repairMissing": {
            "title": "Repair missing reply groups",
            "type": "boolean",
            "description": "Re-fetch parent subtrees when Reddit's batch endpoint silently omits several reply IDs."
          },
          "repairThreshold": {
            "title": "Missing replies before repair",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Repair a parent subtree after this many omitted replies. Lower values improve coverage but cost more requests."
          },
          "requestDelayMs": {
            "title": "Delay between Reddit requests",
            "minimum": 1500,
            "maximum": 60000,
            "type": "integer",
            "description": "Minimum delay between successive requests in this run. Managed access enforces at least 1500 ms and stops on access failures/rate limits."
          },
          "searchScope": {
            "title": "Search source behavior (JSON only)",
            "pattern": "^(?:targets|independent)$",
            "type": "string",
            "description": "Default targets searches within supplied subreddit feeds. independent explicitly restores the older separate URL + global-search jobs sharing one row cap."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}