{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape Reddit posts, comments, communities & users without authentication. Search or use direct URLs. Includes residential proxies. $15/month unlimited access.",
    "version": "0.0",
    "x-build-id": "4UO5Y0yBhLR2lWBaI"
  },
  "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",
        "required": [
          "proxy"
        ],
        "properties": {
          "startUrls": {
            "title": "🔗 Start URLs",
            "type": "array",
            "description": "Add one or more Reddit URLs to scrape directly. Supports subreddit pages, individual posts, user profiles, and search result URLs.\n\n⚠️ When Start URLs are provided, all Search parameters below are ignored. Remove all URLs here if you want to use the Search Term field instead.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searches": {
            "title": "🔍 Search Term",
            "type": "array",
            "description": "Enter one or more keywords to search Reddit. The scraper will search across posts, comments, communities, and users based on the toggles below.\n\n💡 Leave empty if using Start URLs above.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunityName": {
            "title": "🏘️ Limit search to community (optional)",
            "type": "string",
            "description": "Restrict the search to a specific subreddit. Enter the community name without 'r/' — e.g. 'programming', 'news', 'AskReddit'."
          },
          "searchPosts": {
            "title": "📝 Search for posts",
            "type": "boolean",
            "description": "Search for posts matching your keyword. Returns post titles, body text, author, votes, and timestamps.",
            "default": true
          },
          "searchComments": {
            "title": "💬 Search for comments",
            "type": "boolean",
            "description": "Search for comments matching your keyword. Returns comment text, author, score, and timestamps.",
            "default": false
          },
          "searchCommunities": {
            "title": "👥 Search for communities",
            "type": "boolean",
            "description": "Search for subreddits matching your keyword. Returns community name, description, member count, and creation date.",
            "default": false
          },
          "searchUsers": {
            "title": "👤 Search for users",
            "type": "boolean",
            "description": "Search for Reddit users matching your keyword. Returns username, karma, account age, and profile details.",
            "default": false
          },
          "searchMedia": {
            "title": "🖼️ Search for media only",
            "type": "boolean",
            "description": "Filter search results to only include posts containing images or videos.",
            "default": false
          },
          "sort": {
            "title": "📊 Sort search results",
            "enum": [
              "",
              "relevance",
              "hot",
              "top",
              "new",
              "rising",
              "controversial",
              "comments"
            ],
            "type": "string",
            "description": "Choose how results are sorted:\n• New — most recent first\n• Top — highest-voted\n• Hot — currently trending\n• Relevance — best keyword matches\n• Rising — gaining momentum\n• Controversial — most debated",
            "default": "new"
          },
          "time": {
            "title": "📅 Filter by time period",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Filter search results by time window. Only applies to post searches.\n• Use 'Last 24 hours' for fresh content\n• Use 'Last week' for weekly roundups\n• Use 'All time' for comprehensive results"
          },
          "includeNSFW": {
            "title": "🔞 Include NSFW content",
            "type": "boolean",
            "description": "Include or exclude NSFW (Not Safe For Work / 18+) content from search results and scraped pages.",
            "default": true
          },
          "includeMediaLinks": {
            "title": "📷 Include media links, upvotes & comment count",
            "type": "boolean",
            "description": "Extract additional details for each post: upVotes, upVoteRatio, imageUrls, videoUrls, and numberOfComments.\n\n⚠️ Uses a more detailed extraction method — may slightly increase run time.",
            "default": false
          },
          "skipComments": {
            "title": "🚫 Skip comments",
            "type": "boolean",
            "description": "Don't extract comments from posts. Enable this to speed up scraping when you only need post data.",
            "default": false
          },
          "skipUserPosts": {
            "title": "🚫 Skip user posts",
            "type": "boolean",
            "description": "Don't extract posts from user profiles. Enable this if you only need user metadata (karma, account age, etc.).",
            "default": false
          },
          "skipCommunity": {
            "title": "🚫 Skip community details",
            "type": "boolean",
            "description": "Skip extracting community/subreddit metadata (description, member count, etc.) — posts within the community will still be scraped.",
            "default": false
          },
          "maxItems": {
            "title": "📦 Maximum total items",
            "minimum": 1,
            "type": "integer",
            "description": "Total number of items (posts + comments + communities + users) to save. The scraper stops once this limit is reached.\n\n💡 Set higher for comprehensive scraping, lower for quick samples.",
            "default": 10
          },
          "maxPostCount": {
            "title": "📝 Max posts per page",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of posts to scrape from each subreddit or search result page.",
            "default": 10
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of comments to extract from each post. Set to 0 to skip comments entirely.\n\n⚠️ Higher values increase run time.",
            "default": 10
          },
          "maxCommunitiesCount": {
            "title": "👥 Max community result pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of community search result pages to scrape.",
            "default": 2
          },
          "maxUserCount": {
            "title": "👤 Max user result pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of user search result pages to scrape.",
            "default": 2
          },
          "postDateLimit": {
            "title": "📅 Post date limit",
            "type": "string",
            "description": "Only scrape posts published after this date. Sort is automatically set to 'New' for chronological consistency.\n\n💡 Great for incremental daily scraping runs."
          },
          "commentDateLimit": {
            "title": "📅 Comment date limit",
            "type": "string",
            "description": "Only scrape comments published after this date. Useful for filtering out old comments in active threads."
          },
          "scrollTimeout": {
            "title": "⏱️ Scroll timeout (seconds)",
            "minimum": 5,
            "type": "integer",
            "description": "Max time in seconds to wait for new content to load when scrolling. Increase if pages load slowly on your proxy.",
            "default": 40
          },
          "maxRequestRetries": {
            "title": "🔄 Max request retries",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many times to retry a failed request before giving up. Higher = more reliable but slower if Reddit is blocking.",
            "default": 6
          },
          "ignoreStartUrls": {
            "title": "⏭️ Ignore Start URLs",
            "type": "boolean",
            "description": "Ignore the Start URLs field and only use Search Terms. Mainly a fix for integrations like Zapier where URLs can't be cleared.",
            "default": false
          },
          "debugMode": {
            "title": "🐛 Debug mode",
            "type": "boolean",
            "description": "Show detailed logs for troubleshooting — full request/response details and internal processing steps. Only enable when debugging.",
            "default": false
          },
          "proxy": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Configure proxy settings. Residential proxies are recommended for Reddit to avoid blocks and rate limits. Use Apify's built-in proxy or provide your own.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}