{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Posts & Comments Scraper - Subreddits & Search",
    "description": "Reddit scraper for subreddit feeds, keyword search, user submissions and full comment threads. Returns score, upvote ratio, comment count, flair, awards and media URLs per post, with nested comment trees. No login, no API key, no rate-limit quota.",
    "version": "0.0",
    "x-build-id": "Pc51TEPfvh1kob4pS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~reddit-posts-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-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/eiv~reddit-posts-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-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/eiv~reddit-posts-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddits to read, one per line. Accepts a bare name (programming), the r/ shorthand (r/programming), or a full URL. Reddit serves at most about 1,000 posts per subreddit feed, so to go deeper use a narrower sort or timeframe rather than a bigger limit.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keyword searches to run, one per line. Reddit's own search operators work here, including quoted phrases, OR, and flair:\"name\". Leave Search inside subreddits empty to search all of Reddit.",
            "items": {
              "type": "string"
            }
          },
          "searchInSubreddits": {
            "title": "Search inside these subreddits",
            "type": "array",
            "description": "Restrict every search keyword to these subreddits, one per line. Accepts a bare name, the r/ shorthand, or a full URL. Reddit cannot restrict one search to several subreddits at once, so each keyword and subreddit pair is run as its own search. Ignored when Search keywords is empty. If you fill this in and none of the names can be read, the searches are NOT run against all of Reddit instead - you get a bad-input row per unreadable name, because widening a scoped search silently would return the wrong data at full price.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Reddit usernames",
            "type": "array",
            "description": "Users whose submitted posts you want, one per line. Accepts spez, u/spez or a profile URL. Returns posts only; a user's comments are not part of this listing.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Any mix of Reddit URLs: subreddit pages, user profiles, search result pages with a ?q= term, and individual post permalinks (including redd.it short links). A post URL always returns its comment thread, because Reddit serves a post and its comments in a single response.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "How Reddit should rank the feed. Reddit supports a different set per source type and silently ignores the rest, so an unsupported choice is swapped for the closest one and reported in the log: subreddits accept hot, new, top, rising and controversial; users accept hot, new, top and controversial; searches accept relevance, hot, top, new and most comments.",
            "default": "hot"
          },
          "timeframe": {
            "title": "Timeframe",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "The window Top and Controversial rank over, and the window every search is limited to. Ignored by Hot, New and Rising, which have no time window.",
            "default": "all"
          },
          "postType": {
            "title": "Only this kind of post",
            "enum": [
              "any",
              "text",
              "link",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Keep only text posts, only outbound links, only images, or only videos. Image also keeps multi-image galleries. Filtered posts are never written and never charged.",
            "default": "any"
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Skip posts scoring below this. Reddit fuzzes scores slightly to frustrate vote manipulation, so treat a threshold as approximate. Negative values are allowed.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comment count",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts with fewer comments than this. Useful when you want discussion rather than reach, and it cuts the cost of a comments run sharply.",
            "default": 0
          },
          "skipStickied": {
            "title": "Skip pinned posts",
            "type": "boolean",
            "description": "Drop the moderator posts pinned to the top of a subreddit. They appear on every page of a feed and are almost never the data you want.",
            "default": false
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Keep posts Reddit marks over-18. Turn this off to drop them.",
            "default": true
          },
          "includeComments": {
            "title": "Also scrape comments",
            "type": "boolean",
            "description": "Fetch the comment thread for every post that passes the filters. This costs one extra request per post, so a run with comments takes far longer than the same run without them: budget roughly one post per second per worker instead of a hundred. Use Minimum comment count to spend that time only where there is a discussion to read.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper bound on comment rows per post, counted depth-first so a parent always comes before its replies. 500 is Reddit's ceiling, not ours: its comments endpoint returns at most 500 nodes per request, so a larger number here could never be reached. Reddit also withholds the tail of a very large thread behind 'load more' stubs; when that happens the post row is marked commentsTruncated true rather than pretending the thread was complete.",
            "default": 50
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How Reddit should order the comment tree. Best is Reddit's own default ranking.",
            "default": "confidence"
          },
          "maxPostsPerSource": {
            "title": "Max posts per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Output cap per subreddit, search or user. Reddit stops paginating a single listing at about 1,000 posts however many pages are requested, so 1,000 is the ceiling here too.",
            "default": 100
          },
          "maxTotalPosts": {
            "title": "Max posts in the run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap across every source, so a long list of subreddits cannot run away with the bill. Reached first, it stops the run and every remaining source gets a summary row saying so.",
            "default": 1000
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Work cap: pages read per source, at 100 posts a page. Ten pages covers the whole reachable feed. The extra headroom is for a shifting listing that repeats posts across pages, which Hot constantly does, since repeats are discarded and do not count toward the post cap.",
            "default": 10
          },
          "maxConcurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests may be in flight at once, across the whole run rather than per source.",
            "default": 5
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Minimum gap between the start of one request and the next, applied globally rather than per worker, so this really is the run's request rate. Raise it if the log reports HTTP 429.",
            "default": 1000
          },
          "proxyConfig": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave this alone unless you know otherwise. Reddit refuses plain datacenter and residential IPs alike on these endpoints - measured, both returned a byte-identical HTTP 403 - so the Actor defaults to the Apify Unblocker group, which is the only one that gets through. Unblocker bills per request rather than per gigabyte, and one request carries up to 100 posts.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "UNBLOCKER"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}