{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Subreddits & Search with AI",
    "description": "Scrape Reddit posts, nested comments, subreddits & user profiles with AI sentiment, intent & lead flags. No login or API keys needed. Just $1.40 / 1,000 results. Export clean JSON/CSV with live streaming to Make, n8n, Zapier, MCP & AI agents.",
    "version": "0.0",
    "x-build-id": "KmCDQ1reabf8Ginwe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikolabs~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikolabs-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/mikolabs~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mikolabs-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/mikolabs~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mikolabs-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": {
          "searchTerms": {
            "title": "Search Keywords / Phrases",
            "type": "array",
            "description": "Enter one or more keywords to search Reddit (e.g. \"AI agents\", \"Notion alternative\"). Each keyword runs as a separate search. Leave empty to scrape Direct URLs or Subreddits.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchPosts": {
            "title": "Search for Posts",
            "type": "boolean",
            "description": "Include posts in keyword search results.",
            "default": true
          },
          "searchComments": {
            "title": "Search for Comments",
            "type": "boolean",
            "description": "Search and return individual comments matching the keyword across Reddit.",
            "default": false
          },
          "searchCommunities": {
            "title": "Search for Communities (Subreddits)",
            "type": "boolean",
            "description": "Find and extract subreddit public profiles and community rules matching the search query.",
            "default": false
          },
          "withinCommunity": {
            "title": "Limit Search to ONE Community (Optional)",
            "type": "string",
            "description": "Restrict keyword search to a single subreddit. Accepts bare name (technology), r/technology, or full subreddit URL."
          },
          "searchSort": {
            "title": "Sort Search Results By",
            "enum": [
              "new",
              "relevance",
              "hot",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Controls how keyword search results are ranked.",
            "default": "new"
          },
          "searchTime": {
            "title": "Time Range Filter",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit keyword search results to a specific time window.",
            "default": "all"
          },
          "startUrls": {
            "title": "Reddit Direct URLs",
            "type": "array",
            "description": "Add one or more Reddit URLs to scrape directly. Supports post permalinks, subreddit feeds, user profiles, or search page URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "glob"
              ],
              "properties": {
                "glob": {
                  "type": "string",
                  "title": "Glob of a web page"
                }
              }
            }
          },
          "fastMode": {
            "title": "Fast Mode for Search Page URLs",
            "type": "boolean",
            "description": "Speeds up scraping of search page URLs using direct API endpoints without browser overhead.",
            "default": true
          },
          "subredditUrls": {
            "title": "Subreddits to Scrape (Names or URLs)",
            "type": "array",
            "description": "Enter subreddit names or links — e.g. `AskReddit`, `r/AskReddit`, or `https://www.reddit.com/r/AskReddit/`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subredditSort": {
            "title": "Subreddit Feed Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Ranking order for subreddit feeds.",
            "default": "hot"
          },
          "fullSubredditMode": {
            "title": "Full Subreddit Deep Scrape (Bypass 1,000 Post Cap)",
            "type": "boolean",
            "description": "Exhaustively paginates across multi-sort indices to retrieve maximum historical archive data.",
            "default": false
          },
          "crawlCommentsPerPost": {
            "title": "Scrape Comments for Each Post",
            "type": "boolean",
            "description": "When enabled, collects comments and nested discussion threads for each post found.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max Comments per Post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum comments to scrape per individual post thread.",
            "default": 50
          },
          "commentsSort": {
            "title": "Sort Comments By",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Ranking order for comments inside posts.",
            "default": "confidence"
          },
          "flattenComments": {
            "title": "Flatten Comments into Separate Dataset Records",
            "type": "boolean",
            "description": "When true, saves each comment as an independent record (dataType: 'comment') in the dataset.",
            "default": false
          },
          "postedAfter": {
            "title": "Posts Created On or After (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or after this UTC date. Automatically enables chronological collection."
          },
          "postedBefore": {
            "title": "Posts Created On or Before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or before this UTC date."
          },
          "commentedAfter": {
            "title": "Comments Created On or After (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep comments created on or after this UTC date."
          },
          "commentedBefore": {
            "title": "Comments Created On or Before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep comments created on or before this UTC date."
          },
          "onlyWithFlair": {
            "title": "Only Posts That Have a Flair Tag",
            "type": "boolean",
            "description": "When enabled, drops posts with no flair and keeps only categorized posts.",
            "default": false
          },
          "flairContains": {
            "title": "Post Flair Contains Keyword",
            "type": "string",
            "description": "Only keep posts whose flair matches this keyword."
          },
          "postType": {
            "title": "Filter by Media Format",
            "enum": [
              "all",
              "text",
              "image",
              "video",
              "gallery",
              "link"
            ],
            "type": "string",
            "description": "Only extract posts matching this format.",
            "default": "all"
          },
          "minScore": {
            "title": "Minimum Score (Upvotes)",
            "type": "integer",
            "description": "Only keep posts with at least this score."
          },
          "minComments": {
            "title": "Minimum Number of Comments",
            "type": "integer",
            "description": "Only keep posts with at least this many comments."
          },
          "minUpvoteRatio": {
            "title": "Minimum Upvote Ratio (0.0 to 1.0)",
            "type": "number",
            "description": "e.g. 0.85 for 85%+ positive reception."
          },
          "includeNSFW": {
            "title": "Include NSFW (18+) Content",
            "type": "boolean",
            "description": "Include posts marked as 18+ or Not Safe For Work.",
            "default": true
          },
          "excludeStickied": {
            "title": "Exclude Stickied / Pinned Posts",
            "type": "boolean",
            "description": "Exclude moderator announcements and pinned posts.",
            "default": false
          },
          "excludeKeywords": {
            "title": "Exclude Keywords",
            "type": "array",
            "description": "Exclude posts containing any of these keywords in title or text.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsCount": {
            "title": "Max Posts (Total Across All Inputs)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of posts to save. Set to 0 if you only want community metadata.",
            "default": 50
          },
          "maxCommentsCount": {
            "title": "Max Search Comments",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum comments returned from keyword comment search.",
            "default": 400
          },
          "maxCommunitiesCount": {
            "title": "Max Communities",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum communities returned from keyword search.",
            "default": 5
          },
          "aiAnalysis": {
            "title": "Enable AI Analysis & Topic Classification",
            "type": "boolean",
            "description": "Adds sentimentLabel, sentimentScore, intent, emotion, entities, relevanceScore, and contentCategory to posts and comments.",
            "default": false
          },
          "wantsHelp": {
            "title": "Lead Signal: Asking for a Tool, Solution or Help (wantsHelp)",
            "type": "boolean",
            "description": "Adds aiFlags.wantsHelp: true when the author is looking for a product, service, or solution to their problem.",
            "default": false
          },
          "isOwner": {
            "title": "Lead Signal: Author Owns or Operates a Business (isOwner)",
            "type": "boolean",
            "description": "Adds aiFlags.isOwner: true when author founded, owns, or operates a business.",
            "default": false
          },
          "isVendor": {
            "title": "Author is Promoting Their Product (isVendor)",
            "type": "boolean",
            "description": "Adds aiFlags.isVendor: true when the author is self-promoting or recruiting beta testers.",
            "default": false
          },
          "hasPain": {
            "title": "Churn & Problem Signal: Describes a Pain / Failure (hasPain)",
            "type": "boolean",
            "description": "Adds aiFlags.hasPain: true when author describes a problem, tool failure, or frustration.",
            "default": false
          },
          "mentionsPrice": {
            "title": "Commercial Signal: Mentions Price or Budget (mentionsPrice)",
            "type": "boolean",
            "description": "Adds aiFlags.mentionsPrice: true when text mentions pricing, fees, or subscription costs.",
            "default": false
          },
          "featureRequest": {
            "title": "Product Discovery: Wishes for Missing Feature (featureRequest)",
            "type": "boolean",
            "description": "Adds aiFlags.featureRequest: true when the author wishes for a tool or feature that does not exist.",
            "default": false
          },
          "willingToPay": {
            "title": "High-Intent Buyer: Mentions Willingness to Pay (willingToPay)",
            "type": "boolean",
            "description": "Adds aiFlags.willingToPay: true when author states they have a budget or would pay for a solution.",
            "default": false
          },
          "painPoint": {
            "title": "Extract Specific Frustration Phrase (painPoint)",
            "type": "boolean",
            "description": "Extracts the exact problem phrase in under 15 words under aiFlags.painPoint.",
            "default": false
          },
          "competitor": {
            "title": "Extract Competing Brand or Product Named (competitor)",
            "type": "boolean",
            "description": "Extracts the primary competitor product or brand named under aiFlags.competitor.",
            "default": false
          },
          "customLabels": {
            "title": "Custom AI Labels (JSON instructions, up to 5)",
            "type": "object",
            "description": "Define custom labels as {\"label_name\": \"plain-language instruction\"} evaluated on every result.",
            "default": {}
          },
          "mcpConnector": {
            "title": "MCP Connector URL or Endpoint",
            "type": "string",
            "description": "Enter your MCP Connector URL or webhook endpoint to receive scraped posts automatically."
          },
          "mcpMode": {
            "title": "MCP Delivery Mode",
            "enum": [
              "perPost",
              "summary"
            ],
            "type": "string",
            "description": "perPost: stream each scraped post. summary: send a single final digest of the whole run.",
            "default": "perPost"
          },
          "mcpTarget": {
            "title": "Target Destination (Channel, Database ID, Sheet)",
            "type": "string",
            "description": "The destination channel, Notion database ID, or Google Sheet ID."
          },
          "mcpMessage": {
            "title": "Message Template",
            "type": "string",
            "description": "Template using {{field}} placeholders (e.g. {{title}}, {{postUrl}}, {{score}}, {{communityName}}).",
            "default": "**{{title}}**\n{{postUrl}}"
          },
          "mcpComments": {
            "title": "Deliver Comments to App",
            "enum": [
              "ignore",
              "bundle",
              "separate"
            ],
            "type": "string",
            "description": "How comments should be forwarded to your connected app.",
            "default": "ignore"
          },
          "mcpMaxItems": {
            "title": "Max Items to Deliver via MCP",
            "type": "integer",
            "description": "Safety cap on the number of records piped to the connector.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Select Apify Proxy with Residential groups (recommended) or provide custom proxies.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "cookies": {
            "title": "Reddit Cookies (JSON Array)",
            "type": "array",
            "description": "Optional exported cookies array from Reddit to authenticate requests or scrape custom feeds."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}