{
  "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": "XNihwAuoeKYl9gt4Y"
  },
  "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. Reddit's search shows about 7 results per page, so a search is slower per post than a subreddit feed.",
            "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 returns that post; turn on Also scrape comments to get its comment thread too.",
            "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
          },
          "searchDetails": {
            "title": "Full post details for search results",
            "type": "boolean",
            "description": "Reddit's search page shows only each result's title, score, comment count and date. With this on, every result is opened (one small extra request each) to add the post text, post kind, destination link and media. Needed for Only this kind of post to work on searches. Turn it off for faster, lighter search rows.",
            "default": true
          },
          "includeComments": {
            "title": "Also scrape comments",
            "type": "boolean",
            "description": "Fetch the comment thread for every post that passes the filters, and for every post URL. A thread costs one request for its first ~25 comments and one more for each further ~10, so a run with comments takes longer than the same run without them. 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. Comments are read the way Reddit's own 'load more' buttons read them, about ten at a time, top-level comments first, and written in thread order so a parent always comes before its replies. When a thread has more than this, or Reddit still offers more, 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 (100 posts each)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Work cap per source, counted in units of 100 posts read (Reddit serves them about 25 at a time, so one unit is about four requests). Ten 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": 250
          },
          "proxyConfig": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave this alone unless you know otherwise. Reddit refuses datacenter IPs, so the Actor uses Apify's residential proxies, which get through in about a second per page. An old saved setting of UNBLOCKER is switched to residential automatically, because Unblocker no longer reaches Reddit. Your own proxy URLs work too, if they are residential.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}