{
  "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.9",
    "x-build-id": "7qQNlVDSgQvybxKlj"
  },
  "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": "Auto collects posts. Pick a comments option to get reply trees or comment rows.",
            "default": "auto"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Community names without r/, such as technology or n8n. Replace or clear this example. Leave empty if you paste URLs below instead.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs (instead of subreddit names)",
            "type": "array",
            "description": "Paste subreddit, post, profile or search links. Clear the Subreddits box above so you only scrape what you pasted.",
            "items": {
              "type": "string"
            }
          },
          "search": {
            "title": "Keyword (optional)",
            "type": "string",
            "description": "Search for these words inside the subreddits above, or across all of Reddit if you list none."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many rows to save. Use 0 for no limit."
          },
          "sort": {
            "title": "Result order",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments",
              "rising",
              "controversial",
              "best"
            ],
            "type": "string",
            "description": "How results are ordered. Relevance suits keyword searches; new or top suit plain feeds."
          },
          "time": {
            "title": "Time range",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day",
              "hour"
            ],
            "type": "string",
            "description": "How far back to look. Applies to keyword searches and Top feeds."
          },
          "postedAfter": {
            "title": "Posted on or after",
            "type": "string",
            "description": "Only items posted on or after this date, e.g. 2026-09-01."
          },
          "postedBefore": {
            "title": "Posted on or before",
            "type": "string",
            "description": "Only items posted on or before this date."
          },
          "flair": {
            "title": "Post flair",
            "type": "string",
            "description": "Only posts carrying this exact flair text."
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -1000000,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Skip anything scored below this."
          },
          "minComments": {
            "title": "Minimum comment count",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Skip posts with fewer comments than this."
          },
          "nsfw": {
            "title": "NSFW content",
            "enum": [
              "include",
              "exclude",
              "only"
            ],
            "type": "string",
            "description": "Include or exclude posts Reddit marks NSFW."
          },
          "maxComments": {
            "title": "Maximum comments",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many comments to collect in total. Use 0 for no limit."
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many comments to take from each post. Entering a number here also turns comment collection on. Leave 0 for no per-post limit.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How comments are ordered.",
            "default": "confidence"
          },
          "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."
          },
          "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."
          },
          "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."
          },
          "keywordMatch": {
            "title": "Comment keyword matching",
            "pattern": "^(?: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."
          },
          "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."
          },
          "cacheTtlSecs": {
            "title": "Page cache TTL in seconds (JSON only)",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "Reuse subreddit feed and search pages fetched by your earlier runs, for this many seconds. 0 turns the cache off and always fetches fresh. Cached pages are stored in your own account, never shared between users. Raise it for bulk jobs that do not need the newest posts; leave it low if you poll for new content."
          },
          "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}