{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Scraper - Posts by Community",
    "description": "Export posts from 1 to 100 subreddits as flat rows in Hot, New, Top, Rising or Controversial order, with optional comments, subreddit stats, flair filter and an only-new mode for daily feeds. Same columns as Reddit Search Scraper. $1.19 per 1,000 posts. No login.",
    "version": "1.0",
    "x-build-id": "smsjlsAtYs4hyIYey"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/studioxl~reddit-subreddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-studioxl-reddit-subreddit-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/studioxl~reddit-subreddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-studioxl-reddit-subreddit-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/studioxl~reddit-subreddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-studioxl-reddit-subreddit-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",
        "required": [
          "subreddits"
        ],
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "One community per line, or paste a whole list separated by lines, commas or spaces (100 at most). Write it as startups, r/startups or a reddit.com/r/startups link. Private, banned, quarantined and missing communities are skipped and named in the run message, with nothing charged.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "default": [
              "startups"
            ]
          },
          "subredditsFileUrl": {
            "title": "Subreddit list file (URL)",
            "type": "string",
            "description": "Optional. Link to a plain text or CSV file (1 MB at most) with one subreddit per line; in a CSV the first column is used and a title row is skipped. Added to the list above."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "The order the subreddit shows its posts in. Newest suits monitoring; Top with a time range finds the highest-scoring posts.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time range (Top and Controversial)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Used with Top and Controversial only. Every saved post was created inside this range. For other orders, use the dates below.",
            "default": "all"
          },
          "maxPosts": {
            "title": "Max posts",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many posts to save in this run, across all subreddits (1 to 10,000). The limit is shared fairly: each subreddit gets an equal part, and what one cannot use goes to the others. You pay only for saved posts.",
            "default": 100
          },
          "maxPostsPerSubreddit": {
            "title": "Max posts per subreddit",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional. Stop each subreddit after this many posts, for example 200. 0 means no per-subreddit limit (the total is still shared fairly).",
            "default": 0
          },
          "flair": {
            "title": "Only these post flairs",
            "maxItems": 50,
            "type": "array",
            "description": "Optional. Keep only posts whose flair matches one of these, ignoring letter case, for example \"Question\". Posts without a flair are skipped when this is set.",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "postedWithinHours": {
            "title": "Posted within the last hours",
            "minimum": 0,
            "maximum": 87600,
            "type": "integer",
            "description": "Optional. Keep posts created in the last N hours, for example 24. With Newest, a subreddit stops being read once its posts are older. 0 means off.",
            "default": 0
          },
          "dateFrom": {
            "title": "Posted after",
            "type": "string",
            "description": "Optional. Keep posts created on or after this date, for example 2026-01-01 or \"7 days\". With Newest, the run stops reading a subreddit once its posts are older than this date."
          },
          "dateTo": {
            "title": "Posted before",
            "type": "string",
            "description": "Optional. Keep posts created on or before this date, for example 2026-03-31."
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Off by default: posts marked NSFW (18+) are skipped and not charged, and NSFW subreddits are skipped whole. Turn on to keep them.",
            "default": false
          },
          "includeComments": {
            "title": "Add comments for each post",
            "type": "boolean",
            "description": "Off by default. Adds the first comments of every saved post as rows of their own (recordType \"comment\"), in thread order with replies. Deleted and removed comments are skipped and not charged.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many comments to save per post when comments are on (0 to 500). A post with fewer comments gives what it has.",
            "default": 20
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "best",
              "new"
            ],
            "type": "string",
            "description": "Which comments come first when a post has more than your limit.",
            "default": "top"
          },
          "includeSubredditInfo": {
            "title": "Add a row describing each subreddit",
            "type": "boolean",
            "description": "Off by default. Adds one row per subreddit (recordType \"subreddit\"): title, description, subscribers, weekly active users, creation date, NSFW flag and link. Charged as one post.",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only posts not saved by an earlier run",
            "type": "boolean",
            "description": "Off by default. For scheduled runs: posts this feed saved in an earlier run are skipped and not charged. With Newest, a subreddit stops being read once it reaches posts saved before.",
            "default": false
          },
          "feedName": {
            "title": "Feed name",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,39}$",
            "type": "string",
            "description": "Optional, used with the option above. Runs with the same feed name share one memory of saved posts, for example \"startups-daily\". Leave empty to use one memory per list of subreddits and order."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}