{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Posts Scraper",
    "description": "Scrape any subreddit into clean, structured data: title, full text, author, score, upvote ratio, comments, flair, awards, dates, links and every image, gallery and video URL. Sort by new, hot, top, rising or controversial, and filter by date, score, comments, flair or keyword. No account needed.",
    "version": "0.0",
    "x-build-id": "8H4KqjU5RHxQWiTyk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apt_marble~reddit-subreddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apt_marble-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/apt_marble~reddit-subreddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apt_marble-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/apt_marble~reddit-subreddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apt_marble-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",
        "required": [
          "subreddits"
        ],
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "The subreddits to scrape. Paste names (python), r/ handles (r/python) or full subreddit URLs — all three work. Use all or popular to read Reddit's site-wide feeds.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort posts by",
            "enum": [
              "new",
              "hot",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Which listing to read. New returns the most recent posts, Hot the ones Reddit is currently pushing, Top the highest scoring in the chosen time range, Rising the ones gaining traction right now, Controversial the most divisive.",
            "default": "new"
          },
          "time": {
            "title": "Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for the Top and Controversial sorts. Ignored by New, Hot and Rising.",
            "default": "all"
          },
          "maxPostsPerSubreddit": {
            "title": "Max posts per subreddit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to save per subreddit. Reddit itself stops any single listing at about 1,000 posts, so that is the ceiling.",
            "default": 100
          },
          "postedAfter": {
            "title": "Only posts newer than",
            "type": "string",
            "description": "Keep only posts published after this point. Accepts a date (2026-01-31), a full timestamp, or a relative window such as 24h, 7d or 4w. Leave empty for no date limit."
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only posts with at least this many upvotes (score = upvotes minus downvotes). Leave empty to keep every post."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only posts with at least this many comments. Useful for finding threads with real discussion in them."
          },
          "flairFilter": {
            "title": "Keep only these flairs",
            "type": "array",
            "description": "Keep only posts whose link flair matches one of these values. Case-insensitive, and a partial match counts (Hiring matches [Hiring] - Remote). Leave empty to keep every flair.",
            "items": {
              "type": "string"
            }
          },
          "keywordFilter": {
            "title": "Keep only posts containing",
            "type": "array",
            "description": "Keep only posts whose title or body contains at least one of these words or phrases. Case-insensitive. Leave empty to keep every post.",
            "items": {
              "type": "string"
            }
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Keep posts marked 18+. Turn this off to drop them.",
            "default": true
          },
          "skipStickied": {
            "title": "Skip pinned posts",
            "type": "boolean",
            "description": "Skip the moderator-pinned posts that sit at the top of most subreddits (rules threads, weekly megathreads). Turn this off to include them.",
            "default": true
          },
          "includeMedia": {
            "title": "Include media URLs",
            "type": "boolean",
            "description": "Add a media array to every post with direct image, gallery, GIF and video URLs (including the DASH and HLS streams for Reddit-hosted video).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel subreddits",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many subreddits to read at the same time. Higher is faster on long lists; 4 is a good balance.",
            "default": 4
          },
          "proxyCountry": {
            "title": "Browse from",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "de",
              "fr",
              "es",
              "it",
              "nl",
              "ie",
              "in",
              "sg",
              "br",
              "jp",
              "pl",
              "se",
              "mx"
            ],
            "type": "string",
            "description": "Country to appear to browse from. Reddit content is the same worldwide, so change this only if you want traffic to originate somewhere specific.",
            "default": "us"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}