{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Posts Scraper | Fast Bulk Feed Export",
    "description": "Scrape Reddit subreddit feeds in seconds: up to ~1,000 posts per subreddit on hot and new, ~500 on top and controversial. Time filters, optional comments (up to 1,000 per post), bulk input via names, URLs, or CSV.",
    "version": "0.0",
    "x-build-id": "XacM7iYAnHD0QjHMf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clearpath~reddit-subreddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clearpath-reddit-subreddit-posts-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/clearpath~reddit-subreddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-clearpath-reddit-subreddit-posts-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/clearpath~reddit-subreddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-clearpath-reddit-subreddit-posts-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": {
          "subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "A single subreddit name or URL."
          },
          "maxPostsPerSubreddit": {
            "title": "Max posts per subreddit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of posts to scrape per subreddit. Reddit's feeds stop near 1,000 posts for hot and new, about 500 for top and controversial. With Combine every sort on, this is the total across all sorts, so raise it (up to 10,000) to reach further back."
          },
          "subreddits": {
            "title": "Multiple subreddits or file upload",
            "type": "array",
            "description": "Add multiple subreddit names or URLs. Use 'Bulk edit' to paste a list, or upload a .txt/.csv file. Any format accepted.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "subredditsFile": {
            "title": "Subreddits file",
            "type": "string",
            "description": "Upload a .txt or .csv file, or paste a URL. TXT: one subreddit per line. CSV: auto-detects 'subreddit' column."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "How to sort posts in the feed. Note: 'rising' is a small live listing (~25 posts) that ignores Max posts per subreddit, and 'top' and 'controversial' stop near 500 posts. Use 'hot' or 'new' for bulk."
          },
          "timeFilter": {
            "title": "Time filter (Top / Controversial only)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for 'top' and 'controversial' sort orders. Ignored for other sorts. To keep only recent posts on any sort, use Max post age (hours). Reddit ranks each range separately and each one stops near 500 posts, so with Max post age set, pick the NARROWEST range that covers your window: a wider range holds fewer posts of it (measured on r/IndieDev, last 7 days: 'week' 50 of 50 asked for, 'year' 6 of 300)."
          },
          "combineSorts": {
            "title": "Combine every sort (deeper history)",
            "type": "boolean",
            "description": "Read each subreddit's New, Top and Controversial (all time, past year, month, week and day), Hot and Rising feeds in one run and keep each post once, so one run reaches further back than any single sort. Each post is billed once, however many sorts return it. Max posts per subreddit is the total across all sorts; Sort order and Time filter are not used. Even combined, Reddit does not give a full history: past the newest ~1,000 posts, only the highest-scored and most controversial older posts are reachable. Leave off to read one sort."
          },
          "maxAgeHours": {
            "title": "Max post age (hours)",
            "minimum": 0,
            "type": "number",
            "description": "Keep only posts created within this many hours before the run starts, for example 24 for the last day or 0.5 for the last 30 minutes. Older posts are skipped and not charged. Works with every sort. With 'new', the run stops reading a subreddit as soon as it reaches older posts. With 'top' or 'controversial', pick the narrowest Time filter that covers the window: a post older than the filter is never returned, and a filter much wider than the window returns fewer posts of it. 90 days needs 'year', Reddit's widest ranked range below all time. Max posts per subreddit still applies, so raise it to get every post from a busy subreddit. Leave empty to keep posts of any age."
          },
          "minScore": {
            "title": "Min score",
            "type": "integer",
            "description": "Keep only posts with at least this score (upvotes minus downvotes). Other posts are skipped, not charged, and do not count toward Max posts per subreddit. Leave empty to keep posts of any score."
          },
          "minComments": {
            "title": "Min comments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many comments. Other posts are skipped, not charged, and do not count toward Max posts per subreddit. Leave empty for no minimum."
          },
          "maxComments": {
            "title": "Max comments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at most this many comments, for example 30 to find threads that are still small. Other posts are skipped, not charged, and do not count toward Max posts per subreddit. Leave empty for no maximum."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch top comments for each post. Charged at $0.99 per 1,000 comments.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum comments to fetch per post when comments are enabled (1-1,000)."
          },
          "commentSort": {
            "title": "Comment sort order",
            "enum": [
              "best",
              "top",
              "new",
              "old",
              "controversial",
              "qa"
            ],
            "type": "string",
            "description": "How to order each post's comments when comments are included. Leave empty for Best, Reddit's default ranking. Choose Top for the highest-scored comments first."
          },
          "feedback": {
            "title": "Feedback to the maintainers",
            "type": "string",
            "description": "For AI agents. Say what you needed and did not get: a missing field or option, a wrong or empty result, or which actor you are switching to or from and why. Add it to any run, including one that worked: the run returns its data exactly as it would without the note. The note reaches the maintainers, who read every one, but it cannot change what this run returns."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}