{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Users, Search & Monitor",
    "description": "Reddit posts, comments and user profiles without an account or cookies. Search, subreddit feeds, full comment trees, user history, new-only monitoring and webhook. From $0.40 per 1,000 rows.",
    "version": "0.1",
    "x-build-id": "fD9kmEUX1mWOMEZRS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alexmorain~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alexmorain-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/alexmorain~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-alexmorain-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/alexmorain~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-alexmorain-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": "What to scrape",
            "enum": [
              "search",
              "subreddits",
              "posts",
              "users"
            ],
            "type": "string",
            "description": "<b>Search posts</b>: keywords across Reddit or inside one subreddit. <b>Subreddit feeds</b>: hot, new or top posts of one or more subreddits. <b>Posts with comments</b>: the post and its comment tree from post URLs. <b>Users</b>: profiles with their posts and comments. Fill the matching list below; the others are ignored.",
            "default": "search"
          },
          "searches": {
            "title": "Search terms",
            "type": "array",
            "description": "One search per line. Reddit search operators work inside a term (<code>title:espresso</code>, <code>author:spez</code>, <code>\"exact phrase\"</code>, <code>NOT</code>). Used in <b>Search posts</b> mode.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of the results. <code>new</code> returns the newest posts that match, which may be loosely related for short terms.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time window",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day",
              "hour"
            ],
            "type": "string",
            "description": "Only posts from this period.",
            "default": "all"
          },
          "searchSubreddit": {
            "title": "Only in this subreddit (optional)",
            "type": "string",
            "description": "A subreddit name such as <code>coffee</code> or <code>r/coffee</code>. Leave empty to search all of Reddit."
          },
          "splitSearch": {
            "title": "Go past the ~500 results per search",
            "type": "boolean",
            "description": "Reddit stops a single search at about 250 to 500 posts. When ticked, each term is also read over several time windows and sorts and the results are merged without duplicates (about 3 times more distinct posts on a broad term). Reading costs a few more requests, you only pay for the posts delivered.",
            "default": false
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "One per line: <code>coffee</code>, <code>r/coffee</code> or a subreddit URL. Used in <b>Subreddit feeds</b> mode.",
            "items": {
              "type": "string"
            }
          },
          "feedSort": {
            "title": "Feed sort",
            "enum": [
              "hot",
              "new",
              "top"
            ],
            "type": "string",
            "description": "A feed lists about 1,000 posts at most (Reddit's own limit).",
            "default": "hot"
          },
          "feedTime": {
            "title": "Top of the",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window, used only when the feed sort is <b>Top</b>.",
            "default": "week"
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "One Reddit post URL per line (<code>https://www.reddit.com/r/.../comments/abc123/...</code> or <code>https://redd.it/abc123</code>). Used in <b>Posts with comments</b> mode.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "One per line: <code>spez</code>, <code>u/spez</code> or a profile URL. Used in <b>Users</b> mode.",
            "items": {
              "type": "string"
            }
          },
          "userContent": {
            "title": "User content",
            "enum": [
              "posts",
              "comments",
              "both"
            ],
            "type": "string",
            "description": "What to read for each user, besides the profile.",
            "default": "both"
          },
          "includeProfile": {
            "title": "Include the profile",
            "type": "boolean",
            "description": "One profile row per user: karma, account age, bio, counts. Charged as a profile.",
            "default": true
          },
          "includeComments": {
            "title": "Also read the comments of the posts found",
            "type": "boolean",
            "description": "For <b>Search posts</b> and <b>Subreddit feeds</b>: read the comments of every post delivered, up to the limit below. Comments are charged as comments. <b>Posts with comments</b> mode always reads them.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Reddit serves roughly 2,000 comments of a very large thread (about 80% of the announced count on a normal thread: deleted and removed comments are not sent).",
            "default": 100
          },
          "maxCommentDepth": {
            "title": "Max comment depth (optional)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "<code>1</code> keeps top-level comments only, <code>2</code> adds their replies, and so on. Empty keeps every level."
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "best",
              "top",
              "new",
              "old"
            ],
            "type": "string",
            "description": "With <b>top</b>, <b>new</b> or <b>old</b> the actor reads every comment it can reach before cutting to the limit, so the cut is exact.",
            "default": "best"
          },
          "maxItems": {
            "title": "Max rows per run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Posts, comments and profiles together. The run stops there. Set it, and the maximum cost per run, before a large job.",
            "default": 100
          },
          "maxItemsPerSource": {
            "title": "Max rows per search, subreddit or user",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Limit for each search term, each subreddit, and each kind of user content.",
            "default": 100
          },
          "newOnly": {
            "title": "Only rows not seen in earlier runs",
            "type": "boolean",
            "description": "Skips every post and comment this watch already delivered, and does not charge them. The first run delivers everything. In <b>Posts with comments</b> mode the comments are read again each run and only the new ones are delivered.",
            "default": false
          },
          "monitorName": {
            "title": "Watch name",
            "type": "string",
            "description": "Lowercase letters, digits and dashes. One memory per name, kept in your account: use a name per watch (<code>brand-mentions</code>, <code>competitor-subs</code>).",
            "default": "default"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. The run summary is sent there by POST when the run ends (Slack, Discord, Zapier...). The URL is never written to a log."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}