{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Subreddits & Comments",
    "description": "Extract Reddit posts, nested comments as Markdown, and subreddit rules by subreddit, URL, author, or keyword. Track only new items on schedules and skip charges on errors. Not affiliated with Reddit.",
    "version": "0.0",
    "x-build-id": "TLU2ulmrJMJFO8tLa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kizukidata~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kizukidata-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/kizukidata~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kizukidata-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/kizukidata~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kizukidata-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": [
              "posts",
              "threads",
              "comments",
              "subreddits"
            ],
            "type": "string",
            "description": "posts (default): 1 row/post. threads: 1 row/post with nested comments and LLM Markdown. comments: 1 row/comment. subreddits: subreddit info and rules.",
            "default": "posts"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names (webscraping, r/python) or URLs (up to 50 in this list). Empty input reads r/webscraping.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs or IDs",
            "type": "array",
            "description": "Reddit post URLs, redd.it links, /r/{subreddit}/s/... share links, or post IDs (e.g. 1k2vnz0). Up to 50.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Mixed Reddit URLs (subreddit, post, share link, or user profile). Automatically routed by URL type (up to 50 in this list).",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "description": "Reddit usernames (spez, u/spez) or profile URLs (up to 50).",
            "items": {
              "type": "string"
            }
          },
          "queries": {
            "title": "Keywords",
            "type": "array",
            "description": "Search phrases (2-120 chars, up to 10; supports \"exact phrase\", OR, -exclude). Searches inside the subreddits or authors you list; without them, searches up to 5 communities whose names start with the keyword (English letters and digits). Not a Reddit-wide search.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Post sort order",
            "enum": [
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of the newest postsPerSource posts read from each source: new (default), top (score), or comments (comment count). Not an all-time top list.",
            "default": "new"
          },
          "after": {
            "title": "Posted after",
            "type": "string",
            "description": "Oldest post boundary: ISO date (2026-11-01), epoch seconds, or relative offset (24h, 7d, 30d). Empty means no cutoff.",
            "default": ""
          },
          "before": {
            "title": "Posted before",
            "type": "string",
            "description": "Newest post boundary: ISO date, epoch seconds, or relative offset (e.g. 7d). Empty means now.",
            "default": ""
          },
          "includeComments": {
            "title": "Include comments on posts",
            "type": "boolean",
            "description": "In posts mode, also attach nested comments and LLM-ready threadMarkdown to each post row.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum comments extracted per post (0-1000; 0 = no per-post cap). Applies in threads/comments mode or when includeComments is true.",
            "default": 50
          },
          "commentSort": {
            "title": "Comment sort order",
            "enum": [
              "top",
              "best",
              "new",
              "old",
              "controversial"
            ],
            "type": "string",
            "description": "Order comments within each tree level: top (default), best, new, old, or controversial.",
            "default": "top"
          },
          "amaFilter": {
            "title": "AMA filter",
            "enum": [
              "all",
              "answered",
              "unanswered"
            ],
            "type": "string",
            "description": "Filter top-level comment threads (root comment plus all replies) by OP replies: all (default), answered (OP replied somewhere in the thread), or unanswered (no OP reply).",
            "default": "all"
          },
          "includeNsfw": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Include posts marked NSFW (over_18). Off by default.",
            "default": false
          },
          "includeRemoved": {
            "title": "Include removed posts",
            "type": "boolean",
            "description": "Also return posts that moderators, Reddit or the author removed or deleted (the row's removedBy field says which). Off by default: subreddit, author and keyword lists skip them, so you only get and pay for posts people can still see. Posts you name in postUrls are always returned.",
            "default": false
          },
          "onlyNewItems": {
            "title": "Only new items",
            "type": "boolean",
            "description": "true skips rows already delivered by earlier runs with the same input (90-day state); false (default) returns all matching items.",
            "default": false
          },
          "postsPerSource": {
            "title": "Posts requested per source",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Posts scanned per subreddit or author before maxItems (1-500, default 25).",
            "default": 25
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Max charged rows returned per run (1-2000, default 20). Status rows (error set) are free and do not count toward this cap.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Default uses no proxy. Residential proxies are not available.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}