{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Subreddits & Search",
    "description": "Scrape Reddit posts, comments, subreddits, user profiles and Reddit search results. Several keywords per run, date range and NSFW filters. No login or API key. From $1.15 per 1,000 posts and $0.75 per 1,000 comments; empty runs are free. Export JSON, CSV, Excel or AI/RAG.",
    "version": "0.1",
    "x-build-id": "Bvvfd776S6M0tuQyb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-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/automation-lab~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-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/automation-lab~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-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": {
          "urls": {
            "title": "Reddit URLs",
            "description": "Reddit URLs to scrape. Supports subreddit URLs, post URLs, user profile URLs, and search URLs. API callers may pass either an array or a single URL string."
          },
          "url": {
            "title": "Single Reddit URL (alias)",
            "type": "string",
            "description": "Optional compatibility alias for MCP/LLM tools that send a single URL instead of the canonical urls array. Prefer urls for new integrations."
          },
          "comment_url": {
            "title": "Single Reddit comment URL (snake_case alias)",
            "type": "string",
            "description": "Optional compatibility alias for MCP/LLM tools. Use with commentContextMode=true to fetch focused context around a target comment."
          },
          "commentUrl": {
            "title": "Single Reddit comment URL (camelCase alias)",
            "type": "string",
            "description": "Optional compatibility alias for MCP/LLM tools. Use with commentContextMode=true to fetch focused context around a target comment."
          },
          "searchQuery": {
            "title": "Reddit search query",
            "type": "string",
            "description": "Search Reddit for this query. Alternative to providing URLs. Put subreddit/community names in Search subreddit; a subreddit name alone is not treated as a matching search result."
          },
          "searchQueries": {
            "title": "More search queries (one per line)",
            "type": "array",
            "description": "Run several Reddit searches in one run, for example brand names, competitors or keywords to monitor. Each query is searched separately with the same sort, time filter and post limit; duplicate posts are removed when Deduplicate Posts is on. Use together with or instead of Reddit search query.",
            "items": {
              "type": "string"
            }
          },
          "searchSubreddit": {
            "title": "Search subreddit (optional)",
            "type": "string",
            "description": "Limit Reddit search to one subreddit. Enter the name with or without r/ (for example: technology or r/apify). Leave empty to search all Reddit."
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance"
            ],
            "type": "string",
            "description": "Sort order for subreddit listings and search results.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range filter (used with 'top' and 'relevance' sort).",
            "default": "week"
          },
          "maxPostsPerSource": {
            "title": "Max posts per source (posts)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of posts to scrape per subreddit, search, or user profile. Set 0 for unlimited posts.",
            "default": 100
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Scrape available comments for each post using bounded public comment-tree and reply expansion. Increases runtime and proxy cost; complete coverage is not guaranteed.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post (comments)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum distinct available comments returned per post after depth filtering. This is an output cap, not Reddit's total or a coverage guarantee; deadlines and public access can return fewer.",
            "default": 100
          },
          "commentDepth": {
            "title": "Comment reply depth (levels)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum known reply levels returned: 1 includes top-level depth 0; 10 includes known depths 0 through 9. Public subthread expansion is bounded. Comments whose depth cannot be established are retained with depth=-1, not relabeled as top-level.",
            "default": 3
          },
          "commentContextMode": {
            "title": "Targeted comment context mode",
            "type": "boolean",
            "description": "When enabled and a Reddit comment URL is provided, mark the target comment among the post's available public comments instead of treating the URL as a generic post URL. Default behavior stays unchanged when disabled.",
            "default": false
          },
          "commentContextDepth": {
            "title": "Targeted comment context depth",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Kept for compatibility; the available comment tree is returned and the target comment is flagged.",
            "default": 3
          },
          "filterKeywords": {
            "title": "Filter Keywords",
            "type": "array",
            "description": "Only keep posts matching these keywords (case-insensitive). Leave empty to keep all posts. Useful when Reddit search returns loosely related results.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filterKeywordMode": {
            "title": "Keyword Match Mode",
            "enum": [
              "any",
              "titleOnly",
              "all",
              "exactPhrase"
            ],
            "type": "string",
            "description": "How keywords are matched: 'any' = post title or body contains any keyword; 'titleOnly' = only match against post title (strict); 'all' = title or body must contain ALL keywords; 'exactPhrase' = title must contain the exact phrase.",
            "default": "any"
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only return posts created at or after this point: a date (\"2026-11-01\", UTC), a date and time (\"2026-11-01T12:00:00Z\"), or an age (\"24 hours\", \"7 days\", \"2 weeks\"). Applies to subreddit listings, user profiles and searches, not to post URLs. With sort \"new\" the run stops paging once it reaches older posts, which suits scheduled monitoring; for \"top\" and search the time filter is widened to cover this date. Posts outside the range are skipped and not charged."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only return posts created before this point, in the same formats as \"Posted after\". Combine both for a date range."
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Turn off to skip posts Reddit marks NSFW (18+) in listings, profiles and searches. Skipped posts are not charged. Every post also carries an isNSFW field.",
            "default": true
          },
          "deduplicatePosts": {
            "title": "Deduplicate Posts",
            "type": "boolean",
            "description": "Remove duplicate posts that appear in multiple sources or pages. Enabled by default.",
            "default": true
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "default",
              "jsonl-finetune",
              "rag-markdown"
            ],
            "type": "string",
            "description": "Controls the shape of output records. 'default' = standard post/comment objects (backward-compatible). 'jsonl-finetune' = instruction/response pairs for LLM supervised fine-tuning (SFT). 'rag-markdown' = markdown chunks with metadata for vector DB / RAG ingestion.",
            "default": "default"
          },
          "mcpDestinationConnector": {
            "title": "Optional MCP destination connector",
            "type": "string",
            "description": "Batch-run opt-in to send a summary after dataset output is saved. Requires an exact supported mcpDestinationToolName and mcpDestinationTarget. Only explicitly non-destructive messaging tools with the documented string-only schema are supported; compatibility with any particular third-party service is not guaranteed. Failure leaves the full dataset available."
          },
          "mcpDestinationToolName": {
            "title": "Exact MCP messaging tool (required for export)",
            "type": "string",
            "description": "Required when a connector is selected: exactly send_message or post_message. The tool must explicitly annotate destructiveHint=false and must not be read-only. Unknown, unannotated or destructive tools are refused without calls; there is no fallback."
          },
          "mcpDestinationTarget": {
            "title": "Explicit MCP destination target (required for export)",
            "type": "string",
            "description": "Required for export: a nonempty destination identifier, at most 256 UTF-8 bytes with no control characters. The selected tool must require text and exactly one string field named channel, channel_id, destination or target. No page/database/create operations or implicit destinations are supported."
          },
          "mcpExportMaxItems": {
            "title": "Max items in MCP summary",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum sampled dataset records in the batch connector summary (1–25, default 10); the entire summary is also capped at 8192 UTF-8 bytes and may be truncated earlier. Full dataset output and billing are unchanged. Ignored without connector opt-in and by Standby endpoints.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}