{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape Reddit posts, comments, users and subreddits without login or API key. Use subreddits, keyword search, usernames or any Reddit link. Deep mode collects far more than Reddit's 1,000-post limit. Full comment threads, nested or flat. Pay only per result.",
    "version": "0.0",
    "x-build-id": "eoqD3kuf1bggHRU3M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/calm_builder~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-calm_builder-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/calm_builder~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-calm_builder-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/calm_builder~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-calm_builder-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names or links, one per line. Examples: technology, r/AskReddit, https://www.reddit.com/r/Cooking/",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords searched across all of Reddit, one search per line. Reddit search operators work: \"exact phrase\", subreddit:name, author:name, site:domain.com, flair:name.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit users, one per line. Examples: spez, u/spez, https://www.reddit.com/user/spez/. Each user gives a profile row plus their posts and/or comments (see 'User content').",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Any Reddit link, one per line: a post, a subreddit (with sort, e.g. /r/technology/top/?t=week), a user profile, a search results page or a share link (/r/name/s/...). old.reddit.com, new.reddit.com and redd.it links work too.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerSource": {
            "title": "Maximum results per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many posts to collect from each subreddit, search or user (comments or subreddits for those search types). Set 0 to get only the subreddit info and user profiles, without posts. Reddit normally shows about 1,000 posts per sort and about 250 per search; turn on deep mode to collect more.",
            "default": 100
          },
          "deepMode": {
            "title": "Deep mode (collect more than Reddit normally shows)",
            "type": "boolean",
            "description": "Reddit normally shows about 1,000 posts per subreddit sort and about 250 per search. Deep mode collects many more unique posts (often several times as many on big subreddits and searches). Your time range and filters still apply. Results in your chosen sort come first, in Reddit's order; the extra posts are added after them without a guaranteed order. Takes longer. Use it with a high 'Maximum results per source'.",
            "default": false
          },
          "sort": {
            "title": "Subreddit sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Order of subreddit posts. A sort in a subreddit URL takes priority.",
            "default": "hot"
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of search results.",
            "default": "relevance"
          },
          "time": {
            "title": "Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Used by the Top and Controversial sorts and by search.",
            "default": "all"
          },
          "searchFor": {
            "title": "Search for",
            "enum": [
              "posts",
              "comments",
              "communities"
            ],
            "type": "string",
            "description": "What the search terms should find.",
            "default": "posts"
          },
          "searchSubreddit": {
            "title": "Search inside one subreddit",
            "type": "string",
            "description": "Optional. Limit the search terms to one subreddit, e.g. technology."
          },
          "strictKeywordMatch": {
            "title": "Strict keyword match",
            "type": "boolean",
            "description": "Keep only results whose title or text contains every word of the search term. Reddit search can return loosely related posts; this removes them, and you are not charged for removed results.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also collect the comments of every post found, including all nested replies. Choose the format below.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "0 = all comments. Large threads with thousands of comments are supported.",
            "default": 100
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "top",
              "new",
              "controversial",
              "old",
              "qa",
              "confidence"
            ],
            "type": "string",
            "description": "Which comments come first when you collect only part of a thread.",
            "default": "top"
          },
          "commentFormat": {
            "title": "Comment format",
            "enum": [
              "flat",
              "threads"
            ],
            "type": "string",
            "description": "How comments are saved. 'One row per comment': every comment and reply is its own row, linked by parentId, depth and postId; best for spreadsheets and analysis. 'Threads': one row per top-level comment with its replies nested inside (replies to replies too), like on Reddit; best for reading conversations or AI. Applies to comments of posts; comment search and user comments are always one row per comment. Both formats cost the same: you pay per comment.",
            "default": "flat"
          },
          "userContent": {
            "title": "User content",
            "enum": [
              "posts",
              "comments",
              "both",
              "profile"
            ],
            "type": "string",
            "description": "What to collect for each username.",
            "default": "posts"
          },
          "includeUserProfile": {
            "title": "Include user profile",
            "type": "boolean",
            "description": "Add one profile row per username (karma, join date, bio, avatar). Turn off to get only their posts or comments.",
            "default": true
          },
          "includeCommunityInfo": {
            "title": "Include subreddit info",
            "type": "boolean",
            "description": "Add one row per subreddit with its description, members, weekly visitors, weekly contributions, creation date and more. Set 'Maximum results per source' to 0 to get only this info.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only results posted on or after this date. Pick a date, or a relative period such as the last 7 days."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only results posted on or before this date. Pick a date, or a relative period such as 30 days ago."
          },
          "minScore": {
            "title": "Minimum score (upvotes)",
            "type": "integer",
            "description": "Only posts and comments with at least this score."
          },
          "includeNsfw": {
            "title": "Include NSFW (18+) content",
            "type": "boolean",
            "description": "Turn off to skip posts marked NSFW.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}