{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Reddit scraper with no API key or login: scrape posts, full comment threads, users and subreddits from any Reddit URL, keyword search, subreddit or username. Text, score, upvote ratio, flair, media and reply depth. Export CSV or JSON, or call it from code. Pay per result, no start fee.",
    "version": "0.4",
    "x-build-id": "hBzCdyjCQWkHvGAjN"
  },
  "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=..., &type=media for images and videos), a community leaderboard (reddit.com/explore/, /best/communities/, /subreddits/leaderboard/crypto/) or the front page. Leave empty if you use Search terms or the sections below.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "A Reddit link.",
                  "pattern": "\\S"
                }
              }
            }
          },
          "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",
              "pattern": "\\S"
            }
          },
          "searchType": {
            "title": "🔎 Search for",
            "enum": [
              "posts",
              "comments",
              "communities",
              "users",
              "media"
            ],
            "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. Media reads Reddit's Media tab: image, gallery and video posts, each a full post row.",
            "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,
            "type": "integer",
            "description": "Most rows for the whole run: every source, post, comment, user and community counted together. Leave blank for no total cap. One run delivers at most 500,000 rows; a higher number runs to that limit, so split bigger jobs across runs."
          },
          "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",
              "pattern": "\\S"
            }
          },
          "sort": {
            "title": "Subreddit sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Order of subreddit posts, as on Reddit. Empty means Hot. Relevance and Most comments are search orders (trudax's sort): they set Search sort instead."
          },
          "time": {
            "title": "Subreddit period",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Period for the Top and Controversial sorts. Empty means Past 24 hours."
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Reddit usernames (spez or u/spez), one per line.",
            "items": {
              "type": "string",
              "pattern": "\\S"
            }
          },
          "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"
          },
          "filterKeywords": {
            "title": "Include keywords",
            "type": "array",
            "description": "Optional words or phrases to match, ignoring case, in the post title or text or in the comment body. Only matching posts and comments are saved and charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip posts and comments containing any of these words or phrases, even if they match the include list. Skipped results are not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filterKeywordMode": {
            "title": "Keyword match mode",
            "enum": [
              "any",
              "all",
              "titleOnly",
              "exactPhrase"
            ],
            "type": "string",
            "description": "Choose how include keywords match. Comments always match against the comment body.",
            "default": "any"
          },
          "commentContextMode": {
            "title": "Include parent post context",
            "type": "boolean",
            "description": "Add a postContext object to each comment with the available parent post details. On a comment URL, isTargetComment marks the requested comment.",
            "default": false
          },
          "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
            }
          },
          "onlyCommentsNewerThan": {
            "title": "Only comments newer than",
            "type": "string",
            "description": "Only keep comments after this UTC date or relative period (for example, 7 days)."
          },
          "flair": {
            "title": "Flair filter",
            "type": "string",
            "description": "One flair label to keep, e.g. Discussion. With comments on, it matches each comment's author flair; with comments off, each post's flair. Matching ignores case."
          },
          "nestedComments": {
            "title": "Include nested replies",
            "type": "boolean",
            "description": "Also turns on comments: each post gets a replies tree with its comments, and every comment is still delivered as its own row. Each comment row is a charged result, like a post. Up to 1,000 comments per post."
          },
          "includeCommunityInfo": {
            "title": "Include community details",
            "type": "boolean",
            "description": "Also return the community record for each named subreddit."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}