{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments & Search",
    "description": "Scrape Reddit posts and comments from subreddits, users, search and post links in one run. Get title, text, score, comment count, flair, author, media and deep reply threads. Date range, minimum score and only-new mode. No login or API key. Export to JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "VhBCBXPAtf8Qs9eQc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wiseus-labs~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wiseus-labs-reddit-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/wiseus-labs~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-wiseus-labs-reddit-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/wiseus-labs~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-wiseus-labs-reddit-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": {
          "startUrls": {
            "title": "🔗 Reddit links",
            "type": "array",
            "description": "One link per line: a subreddit (reddit.com/r/space, /r/space/new, /r/space/top/?t=week), a user (reddit.com/user/NAME, /u/NAME, /user/NAME/submitted, /user/NAME/comments), a post (any reddit.com post link, comment links, redd.it short links, share links), or a search page (reddit.com/search?q=..., reddit.com/r/NAME/search?q=...). Shortcuts r/NAME and u/NAME work too. A sort or time in the link (/new, ?t=week) is used for that link.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "🔎 Search terms",
            "type": "array",
            "description": "Keywords to search Reddit posts for, one per line. Each term is one search; its posts are saved with the term in searchQuery.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchSubreddit": {
            "title": "📍 Search in subreddit",
            "type": "string",
            "description": "Only search inside this subreddit (name without r/, for example space). Empty: search all of Reddit.",
            "default": ""
          },
          "sort": {
            "title": "↕️ Sort",
            "enum": [
              "relevance",
              "hot",
              "new",
              "top",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "Order of posts. Subreddits use hot, new, top or rising; users use hot, new or top; searches use relevance, hot, new, top or comments. A sort that does not fit an input falls back to that input's usual order (hot for subreddits, new for users, relevance for searches).",
            "default": "hot"
          },
          "timeFilter": {
            "title": "⏱️ Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for Top and for searches: past hour, day, week, month, year or all time.",
            "default": "all"
          },
          "maxPostsPerSource": {
            "title": "🔢 Max posts per input",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many posts to save for each link or search term (for a user's comments page: how many comments). Reddit lists up to about 1000 posts per feed.",
            "default": 25
          },
          "includeComments": {
            "title": "💬 Include comments",
            "type": "boolean",
            "description": "Also save the comments of each saved post, replies included, each as its own row.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many comments to save for each post. 0 = no limit.",
            "default": 100
          },
          "maxCommentDepth": {
            "title": "🪜 Max comment depth",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How deep into reply threads to go. 1 = top-level comments only, 2 = plus their direct replies, 0 = no depth limit.",
            "default": 0
          },
          "dateFrom": {
            "title": "📅 Posted after",
            "type": "string",
            "description": "Only posts and comments created at or after this date (UTC), or within a relative period such as 7 days. With sort New, reading stops once the feed is older than this date."
          },
          "dateTo": {
            "title": "📅 Posted before",
            "type": "string",
            "description": "Only posts and comments created at or before this date (UTC; a date without a time includes that whole day)."
          },
          "minScore": {
            "title": "⬆️ Min score",
            "minimum": -100000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Only posts and comments with at least this score (upvotes minus downvotes). Empty: no score filter."
          },
          "includeNsfw": {
            "title": "🔞 Include NSFW",
            "type": "boolean",
            "description": "Include posts marked NSFW (18+) and their comments.",
            "default": true
          },
          "skipPinned": {
            "title": "📌 Skip pinned posts",
            "type": "boolean",
            "description": "Skip posts pinned by moderators in subreddit feeds (rules, weekly threads, announcements). Skipped pinned posts are not charged and do not count toward Max posts per input.",
            "default": false
          },
          "onlyNew": {
            "title": "🆕 Only new items",
            "type": "boolean",
            "description": "On repeated runs with the same inputs, skip (and do not charge) posts and comments that earlier runs already returned. Earlier results are remembered per input in a key-value store of your account named reddit-scraper-only-new (up to 50,000 per input).",
            "default": false
          },
          "maxItems": {
            "title": "🛑 Max results per run",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many posts and comments in total. 0 = no limit.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "⚙️ Max parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Requests in flight at once. The scraper lowers it on its own when Reddit pushes back.",
            "default": 8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}