{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Search & Users",
    "description": "Scrape Reddit posts, comments, users and subreddits from any URL, search, subreddit or username. Score, upvote ratio, comment count, full text, flair, images and video, comment threads with depth and reply counts. First results in seconds, no login, no browser.",
    "version": "0.1",
    "x-build-id": "R1mKr4KQQChvOEwDh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepmine~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepmine-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/deepmine~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-deepmine-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/deepmine~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-deepmine-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": {
          "startUrls": {
            "title": "🔗 Reddit URLs",
            "type": "array",
            "description": "Any Reddit link, one per row: a subreddit (r/Python, r/Python/top/?t=week), a post, a user (u/spez), a search (reddit.com/search/?q=...) or the front page. Leave empty if you use Search terms or the sections below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searches": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "Words to search all of Reddit for, one per line, e.g. best crm for startups. 'Search for' picks posts, comments, communities or users.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "🔎 Search for",
            "enum": [
              "posts",
              "comments",
              "communities",
              "users"
            ],
            "type": "string",
            "description": "What the search terms look for. Comments finds comments that use your words anywhere on Reddit (Search sort: relevance, new or top; Search period and Search only in this subreddit apply), each with its post and community.",
            "default": "posts"
          },
          "includeComments": {
            "title": "💬 Include comments",
            "type": "boolean",
            "description": "Add each post's comments, replies included, right after the post. Each comment is one result.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "💬 Max comments per post",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Most comments to read per post, replies included, in Reddit's thread order (e.g. 4 for a quick look, 500 for whole threads).",
            "default": 100
          },
          "maxItemsPerSource": {
            "title": "📊 Max posts per source",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Most posts (or communities or users) per URL, search term, subreddit or user. Reddit lists about 1,000 posts per subreddit sort and about 250 per search sort; 'Maximize coverage' gets more from a search.",
            "default": 100
          },
          "maxResults": {
            "title": "🧮 Max results (total)",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Most rows for the whole run: every source, post, comment, user and community counted together. Empty = no total cap (Max posts per source and your spending limit still apply)."
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names (Python or r/Python), one per line. Their posts are read in the order set by 'Subreddit sort'.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Subreddit sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Order of subreddit posts, as on Reddit.",
            "default": "hot"
          },
          "time": {
            "title": "Subreddit period",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Period for the Top and Controversial sorts.",
            "default": "day"
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Reddit usernames (spez or u/spez), one per line.",
            "items": {
              "type": "string"
            }
          },
          "userContent": {
            "title": "For each user, get",
            "type": "array",
            "description": "The profile (karma, account age, verification), the user's posts, the user's comments, or any mix.",
            "items": {
              "type": "string",
              "enum": [
                "profile",
                "posts",
                "comments"
              ],
              "enumTitles": [
                "Profile",
                "Posts",
                "Comments"
              ]
            },
            "default": [
              "profile",
              "posts",
              "comments"
            ]
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments",
              "hot"
            ],
            "type": "string",
            "description": "Order of search results.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search period",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "How far back a search looks. Comments older than this are skipped (Reddit's comment search has no period of its own, so it is applied here; skipped comments are free).",
            "default": "all"
          },
          "withinSubreddit": {
            "title": "Search only in this subreddit",
            "type": "string",
            "description": "Optional subreddit name (e.g. CRM) to limit search terms to. With Comments, other communities' comments are skipped (free)."
          },
          "matchMode": {
            "title": "Match",
            "enum": [
              "any",
              "all",
              "phrase"
            ],
            "type": "string",
            "description": "How closely a post or comment must match your search terms.\n\n• Reddit's match: whatever Reddit's search finds (it also matches word stems and other fields, so some results only touch your words).\n• Every word: the post's title and text (or the comment) must hold every word of the search term, in any order.\n• Exact phrase: the words in a row, as typed (case, punctuation and line breaks don't matter).\n\nResults that don't match aren't delivered and aren't charged. A post's own comments (Include comments) always come with it.",
            "default": "any"
          },
          "maximizeCoverage": {
            "title": "Maximize coverage",
            "type": "boolean",
            "description": "Reddit stops a search at about 250 posts per sort. On: each search is also read in other sorts and periods (new, top by year, month, week...) and merged without duplicates.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only posts and comments from after this date: 2026-09-01, 2026-09-01T12:00:00Z, or a period like '7 days' or '12 hours'."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only posts and comments from before this date (same formats)."
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -100000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Skip posts with a lower score (upvotes minus downvotes), e.g. 10. Empty = no minimum."
          },
          "includeNSFW": {
            "title": "Include NSFW (18+)",
            "type": "boolean",
            "description": "Keep posts and communities marked 18+.",
            "default": true
          },
          "commentDepth": {
            "title": "Comment depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How deep in reply chains to go: 1 = top-level comments only, 10 = Reddit's maximum.",
            "default": 10
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Order of comments, as on Reddit.",
            "default": "confidence"
          },
          "includeCommunityRules": {
            "title": "Community rules",
            "type": "boolean",
            "description": "For community search results, also read each community's rules (one extra Reddit call per community; free).",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave as is: Reddit answers Apify's datacenter proxy, the cheapest option. If you pick Residential, the run still reads through datacenter and uses your residential IPs only to retry a call Reddit refuses there.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}