{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper Pro: Posts, Comments, Subreddits & Search",
    "description": "Scrape Reddit posts, comment threads, subreddits, user posts, and keyword search results in one run. No Reddit API key or login needed. From $1.00 per 1,000 posts and $0.50 per 1,000 comments with $0 start fee. Export clean JSON, CSV, Excel, or Markdown for AI/RAG.",
    "version": "1.0",
    "x-build-id": "NR7de4aKx9zf7ZZOw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leado~reddit-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leado-reddit-scraper-pro",
        "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/leado~reddit-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-leado-reddit-scraper-pro",
        "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/leado~reddit-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-leado-reddit-scraper-pro",
        "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": {
          "urls": {
            "title": "Reddit URLs (Subreddits, Posts, or Users)",
            "type": "array",
            "description": "List of Reddit URLs to scrape: subreddit URLs (https://www.reddit.com/r/SaaS/), direct post URLs (https://www.reddit.com/r/SaaS/comments/...), or user profile URLs (https://www.reddit.com/user/spez/).",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names to scrape (with or without 'r/' prefix, for example 'SaaS' or 'startups'). Can be used alone or combined with Search Queries.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search Queries (Keywords)",
            "type": "array",
            "description": "Search Reddit posts by keyword or phrase. If Subreddits are also specified, each query runs inside those subreddits; otherwise it searches across all of Reddit.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Reddit Usernames",
            "type": "array",
            "description": "Scrape posts submitted by specific Reddit users (without 'u/' prefix).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "new",
              "top",
              "hot"
            ],
            "type": "string",
            "description": "Sort order for posts ('new' returns latest posts first; 'top' and 'hot' sort fetched results by score).",
            "default": "new"
          },
          "maxPostsPerSource": {
            "title": "Max Posts per Subreddit / Query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of posts to extract per subreddit, search query, or user profile (1 to 500).",
            "default": 25
          },
          "timeWindow": {
            "title": "Time Filter",
            "enum": [
              "all",
              "1h",
              "4h",
              "24h",
              "7d",
              "30d"
            ],
            "type": "string",
            "description": "Only return posts newer than the selected time range.",
            "default": "all"
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Extract top comments for each scraped post. Automatically enabled when scraping direct post URLs.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max Comments per Post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of comments to extract per post when Include Comments is enabled (1 to 100).",
            "default": 10
          },
          "filterKeywords": {
            "title": "Filter Keywords (Post-scrape filter)",
            "type": "array",
            "description": "Optional list of keywords to filter scraped posts (case-insensitive). Leave empty to keep all posts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filterKeywordMode": {
            "title": "Keyword Match Mode",
            "enum": [
              "any",
              "all",
              "titleOnly"
            ],
            "type": "string",
            "description": "How Filter Keywords are matched against posts.",
            "default": "any"
          },
          "minScore": {
            "title": "Minimum Post Score",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with a score greater than or equal to this value.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum Comment Count",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts that have at least this many comments.",
            "default": 0
          },
          "excludeRemoved": {
            "title": "Exclude [removed] and [deleted] Posts",
            "type": "boolean",
            "description": "Skip posts and comments that were removed by moderators or AutoMod or deleted by the author.",
            "default": true
          },
          "includeNSFW": {
            "title": "Include NSFW (18+) Posts",
            "type": "boolean",
            "description": "Whether to include NSFW posts in the dataset.",
            "default": false
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "default",
              "rag-markdown",
              "jsonl-finetune"
            ],
            "type": "string",
            "description": "Choose standard JSON records or AI-ready formats for RAG vector databases and LLM fine-tuning.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}