{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Subreddit Posts and Comments",
    "description": "Scrape Reddit data from any public subreddit, post link or search, no login or Reddit API key needed: posts with title, text, score, flair, link and time, plus comments and replies as a Reddit comments scraper. Filter by date, score, flair or type, or run a subreddit monitor for new posts.",
    "version": "0.1",
    "x-build-id": "oDRIM5dBM5LzvaoNh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kaleidoscopelabs~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kaleidoscopelabs-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/kaleidoscopelabs~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kaleidoscopelabs-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/kaleidoscopelabs~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kaleidoscopelabs-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": {
          "queries": {
            "title": "Subreddits or posts",
            "maxItems": 200,
            "type": "array",
            "description": "What to read, one per line: a public subreddit (SaaS, r/SaaS, or its link; a link's order, such as /top/?t=week, is kept), or a post's link (that post, with its comments when Comments is on). Up to 100 subreddits and 100 post links.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "best"
            ],
            "type": "string",
            "description": "The order the subreddit lists its posts in, as on Reddit: Hot, New, Top, Rising or Best.",
            "default": "new"
          },
          "time": {
            "title": "Top of",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "For the Top order: the period its posts are the top of.",
            "default": "day"
          },
          "searches": {
            "title": "Searches",
            "type": "array",
            "description": "Reddit searches, one per line, as typed into Reddit's search: air fryer, or \"customer support\" in quotes for the phrase. Each gives the posts Reddit finds for it; a search's results show less than a subreddit's (no body, flair or link), and with Comments on each post is read whole. Each line goes to Reddit as typed, author: included. To run searches only, leave Subreddits or posts empty.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "The order of a search's results, as on Reddit: Relevance, Hot, Top, New or Comment count. A monitor reads its searches in the New order.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search top of",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "For the Top search order: the period its results are the top of.",
            "default": "all"
          },
          "searchSubreddits": {
            "title": "Search within",
            "type": "array",
            "description": "Run each search inside each of these subreddits (SaaS or r/SaaS); empty searches all of Reddit. Each search within each subreddit counts as one of the run's 100 subreddits and searches.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "posts",
              "comments"
            ],
            "type": "string",
            "description": "What the searches find: posts, or comments (each result a comment record, charged as a comment, up to Posts per subreddit per search; order Relevance, Top or New).",
            "default": "posts"
          },
          "maxPosts": {
            "title": "Posts per subreddit",
            "minimum": 0,
            "type": "integer",
            "description": "How many posts each subreddit or search contributes, in its order; 0 takes as many as Reddit lists.",
            "default": 100
          },
          "postedAfter": {
            "title": "Posted after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only posts from this day on, in UTC: a date or a span such as 7 days. In the New order the subreddit is read back to that day only; in other orders each post is checked, so a run may read more than it keeps."
          },
          "postedBefore": {
            "title": "Posted before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only posts from before this day, in UTC: a date or a span such as 1 day. With Posted after 1 day and Posted before 0 days, a run keeps yesterday's posts. Newer posts are read past, not kept."
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Keep only posts of these types; none chosen keeps every type. Galleries include Reddit's mixed-media posts. On searches it needs Comments on, as a search's results do not show the type.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "image",
                "gallery",
                "link",
                "video"
              ],
              "enumTitles": [
                "Text",
                "Image",
                "Gallery",
                "Link",
                "Video"
              ]
            },
            "default": []
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Keep only posts with at least this score. In the New order, young posts have not collected their votes yet."
          },
          "flairs": {
            "title": "Flairs",
            "type": "array",
            "description": "Keep only posts whose flair is one of these lines, such as Question, letter case ignored; empty keeps every post. On searches it needs Comments on, as a search's results do not show it.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "skipLocked": {
            "title": "Only posts open for comments",
            "type": "boolean",
            "description": "Leave out locked posts, which take no new comments. On searches it needs Comments on, as a search's results do not show it.",
            "default": false
          },
          "skipNsfw": {
            "title": "Leave out NSFW posts",
            "type": "boolean",
            "description": "Leave out posts Reddit marks NSFW (over 18). Off, every post is kept with its nsfw field.",
            "default": false
          },
          "pagesWithoutMatch": {
            "title": "Pages without a match",
            "minimum": 0,
            "type": "integer",
            "description": "Stop reading a subreddit after this many pages in a row (a page is about 24 posts) with no post that passes the filters; 0 reads on to Reddit's end. A filter that matches rarely may need more.",
            "default": 20
          },
          "monitorName": {
            "title": "Monitor ($)",
            "type": "string",
            "description": "Name a monitor, such as saas-daily, to store only new posts: each subreddit, read in the New order, gives the posts since the monitor's last run. Its first run stores up to Posts per subreddit as the baseline. Searches are monitored too, in the New order. Each subreddit or search read is one check. Up to 40 letters, digits, hyphens."
          },
          "includeComments": {
            "title": "Comments ($)",
            "type": "boolean",
            "description": "Read each post's comments too, each a record of its own tied to its parent, and a thread record per post saying how many of Reddit's count were stored and why. Each comment stored is charged; off by default.",
            "default": false
          },
          "maxComments": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "How many comments each post contributes, the first Reddit shows as the thread opens (top-level comments with their replies); 0 takes every comment Reddit shows, which on large threads is slow.",
            "default": 100
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "The order comments are read in, as on Reddit: Best, Top, New, Controversial, Old or Q&A. With Comments per post set, it decides which comments are kept.",
            "default": "best"
          },
          "commentDepth": {
            "title": "Reply depth",
            "minimum": 0,
            "type": "integer",
            "description": "How deep into the replies to read: 1 keeps top-level comments only, 2 adds their replies; 0 reads every depth.",
            "default": 0
          },
          "commentsPostedAfter": {
            "title": "Comments posted after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only comments from this day on, in UTC: a date or a span such as 7 days. Each thread is still read whole; comments outside the dates are not stored or charged."
          },
          "commentsPostedBefore": {
            "title": "Comments posted before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only comments from before this day, in UTC: a date or a span such as 1 day."
          },
          "deepThreads": {
            "title": "Deep threads",
            "type": "boolean",
            "description": "Also open the \"more replies\" pages Reddit links to, for replies nested deeper than the thread's page shows. A run is slower; worth it when the deepest exchanges matter. Off, the thread record says when such pages were left.",
            "default": false
          },
          "includeAuthors": {
            "title": "Author names",
            "type": "boolean",
            "description": "Add each post's and comment's author: username and account ID. Usernames are personal data; you decide whether and why you collect them. Off, posts and comments come without them.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}