{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments, Subreddits & Users",
    "description": "🔥 ~$0.05/1K results 🔥 Scrape Reddit without an account. Search posts, pull a subreddit or user feed, fetch full comment trees by URL, or discover communities. Clean structured JSON, no browser, no proxy required.",
    "version": "0.2",
    "x-build-id": "kiipwBykyuvI5moti"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kaix~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kaix-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/kaix~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kaix-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/kaix~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kaix-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "subreddit",
              "user",
              "post",
              "community"
            ],
            "type": "string",
            "description": "What to scrape. Each mode uses one target selector below.",
            "default": "search"
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Search terms. Used by <code>search</code> and <code>community</code> modes. In search mode, add a subreddit below to restrict results to that community."
          },
          "subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Community name, with or without the <code>r/</code> prefix. Target for <code>subreddit</code> mode; optional filter for <code>search</code> mode."
          },
          "username": {
            "title": "Username",
            "type": "string",
            "description": "Reddit username, with or without the <code>u/</code> prefix. Target for <code>user</code> mode."
          },
          "postUrls": {
            "title": "Post URLs or IDs",
            "type": "array",
            "description": "Target for <code>post</code> mode. Accepts full post URLs, redd.it short links, <code>t3_</code> fullnames, or bare post IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "How to order the leading results. Once that listing is exhausted, the other sorts and time windows follow until Max items is reached. Unsupported values fall back to the nearest one (e.g. relevance becomes hot in a subreddit listing).",
            "default": "hot"
          },
          "time": {
            "title": "Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for <code>top</code>, <code>controversial</code>, and search results. A window narrower than all time is a filter: <code>hot</code>, <code>new</code>, and <code>rising</code> cannot be filtered by time, so a feed then starts with the windowed <code>top</code> instead.",
            "default": "all"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum posts, comments, or subreddits to collect in the list modes. Set to 0 for everything Reddit offers. Past the size of one listing, the Actor continues through the target's other sorts and time windows, without duplicates. Not used in <code>post</code> mode, where the URL list sets the size.",
            "default": 50
          },
          "userContent": {
            "title": "User content",
            "enum": [
              "submitted",
              "comments"
            ],
            "type": "string",
            "description": "For <code>user</code> mode: fetch the user's submitted posts or their comments.",
            "default": "submitted"
          },
          "includeNsfw": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Include posts and subreddits marked over-18.",
            "default": true
          },
          "depth": {
            "title": "Data depth",
            "enum": [
              "basic",
              "detailed"
            ],
            "type": "string",
            "description": "Basic: core fields, images and video. Detailed: adds the HTML body of each post and comment.",
            "default": "basic"
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Save each post's comments as their own records, right after the post. Always on for <code>post</code> mode results.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on comments saved per post, counting nested replies. Set to 0 for no limit.",
            "default": 50
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Order of the comment tree.",
            "default": "confidence"
          },
          "expandComments": {
            "title": "Expand collapsed comments",
            "type": "boolean",
            "description": "Collect the complete thread: every 'load more comments' batch and every 'continue this thread' branch, down to the last reply. Without it, you get the comments Reddit shows on first load.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy settings for the run. Apify proxy is on by default and helps large runs finish sooner. Switch it off to run without one.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}