{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper — Posts & Comments for AI and Market Research",
    "description": "Collect public Reddit posts, comments and reply threads for AI datasets, market research and brand monitoring. Search subreddits, keywords, post links and user profiles. Get reply relationships and optional AI sentiment analysis. No Reddit account, API key or session token required.",
    "version": "0.6",
    "x-build-id": "k5dkB7bhr5VJPsSRQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aitorsm~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aitorsm-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/aitorsm~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-aitorsm-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/aitorsm~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-aitorsm-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": {
          "subreddits": {
            "title": "Subreddits to research",
            "type": "array",
            "description": "Community names with or without r/, for example SaaS or r/Python (2–21 letters, digits or underscores). With searchQueries, search each community; without them, collect its posts. Leave blank for Reddit-wide search only when searchQueries is supplied, or to collect only post links or user history.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Keywords or phrases to search",
            "type": "array",
            "description": "Discover mentions of brands, products or problems, for example Acme or pricing software. Each query searches every supplied subreddit, or Reddit-wide when subreddits is blank. This is discovery, not a whole-word text filter: use keywords to require words in collected title/text. Queries are trimmed, 1–256 characters, without control characters; case-insensitive duplicates count once.",
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "postUrls": {
            "title": "Reddit post links",
            "type": "array",
            "description": "Read individual discussions, for example https://www.reddit.com/r/Python/comments/1xtcexq/pydantic_in_100_lines/. HTTPS on www., old. or bare reddit.com, at most 2048 characters; no short links, credentials, nonstandard ports, encoded subreddit names/post IDs or individual-comment links. These posts bypass post filters; availability, deduplication and budgets still apply. Their comments remain filtered.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "usernames": {
            "title": "Reddit user profiles and history",
            "type": "array",
            "description": "Collect each public profile plus recent posts and comments as separate results. Use spez, u/spez or https://www.reddit.com/user/spez/. Names are 3–20 letters, digits, underscores or hyphens; entries at most 2048 characters. Result limits apply separately to history posts and comments. includeComments does not add replies to user-history posts.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "searchIn": {
            "title": "Discover posts, comments or both",
            "enum": [
              "posts",
              "comments",
              "both"
            ],
            "type": "string",
            "description": "Choose what searchQueries discovers: posts (default), matching comments, or both. Comment discovery returns each matching comment with available post context, not the parent post text or a reply tree. Use includeComments on collected posts or postUrls to read discussion replies. No effect without searchQueries.",
            "default": "posts"
          },
          "findSubreddits": {
            "title": "Broaden research to matching subreddits",
            "minimum": 0,
            "maximum": 9007199254740991,
            "type": "integer",
            "description": "Number of extra matching communities to search for each query; 0 (default) is off. Requires searchQueries to have an effect. Does not repeat communities you entered. Each added community/query search has an independent result limit and can increase the total charge. Non-negative safe integer.",
            "default": 0
          },
          "maxResultsPerSource": {
            "title": "Maximum results per source",
            "minimum": 1,
            "maximum": 9007199254740991,
            "type": "integer",
            "description": "Maximum posts per subreddit/query search, matches per comment search, and history results per user (posts and comments limited separately). Each source has its own limit; this is not a global result or spending cap. Discussion replies use maxCommentsPerPost separately. Form starts at 5; omitted or cleared API input is unbounded. Positive safe integer, or empty."
          },
          "includeComments": {
            "title": "Include discussion comments and replies",
            "type": "boolean",
            "description": "Also collect available comments and reply relationships on posts from subreddits, post searches and individual post links. Off by default. Does not add replies to archived or user-history posts, or turn comment-search matches into whole discussions. Coverage is reported per post; unavailable replies cannot be recovered.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum discussion comments per post",
            "minimum": 1,
            "maximum": 9007199254740991,
            "type": "integer",
            "description": "Applies only when includeComments is on. Maximum comments saved per post, separate from maxResultsPerSource and the minComments filter. Omitted or empty means no per-post comment-count cap; available replies and run budgets still limit results. Positive safe integer, or empty."
          },
          "sort": {
            "title": "Result order",
            "enum": [
              "new",
              "hot",
              "top",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Default new. Subreddit listings support new, hot or top; relevance and comments fall back to new. Post searches support new, top, relevance or comments (most comments); hot falls back to relevance. Comment searches support new, top or relevance; hot and comments fall back to relevance.",
            "default": "new"
          },
          "time": {
            "title": "Ranking window for Top",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Applies only with sort=top; default week. This is the period Reddit ranks over, not a publication-date filter. Use dateFrom/dateTo for publication dates. Reddit may ignore this window in comment search.",
            "default": "week"
          },
          "dateFrom": {
            "title": "Published on or after",
            "maxLength": 40,
            "type": "string",
            "description": "Inclusive publication-date filter, for example 2024-01-01 (start of day UTC) or 2024-01-01T12:00:00Z. Use dateTo for the end. Unknown dates are kept; explicit post links bypass post filters. Older posts from explicitly supplied subreddits may come from Arctic Shift, a third-party archive receiving subreddit names, dates and search queries. Archive coverage can be incomplete; no archived replies or media, Reddit-wide/discovered-community history, monitoring or comments-only search."
          },
          "dateTo": {
            "title": "Published on or before",
            "maxLength": 40,
            "type": "string",
            "description": "Inclusive publication-date filter, for example 2024-01-31 (whole day UTC) or 2024-01-31T18:00:00Z. Must not precede dateFrom; timestamps require a time zone. Unknown dates are kept; explicit post links bypass post filters. This does not set the Top ranking window."
          },
          "keywords": {
            "title": "Text filter: must contain any",
            "type": "array",
            "description": "Filter collected titles and text; does not discover results or start a search. Require any listed whole word or phrase, case-insensitively. Missing text cannot satisfy this include filter unless a post title matches. Explicit post links bypass post filters; their comments remain filtered. Each trimmed entry is 1–256 characters without control characters.",
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "excludeKeywords": {
            "title": "Text filter: exclude any",
            "type": "array",
            "description": "Exclude posts and comments whose collected title/text contains any listed whole word or phrase, case-insensitively. Exclusions win over required words. Explicit post links bypass post filters; their comments remain filtered. Each trimmed entry is 1–256 characters without control characters.",
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "excludeAuthors": {
            "title": "Exclude authors",
            "type": "array",
            "description": "Exclude posts and comments by these usernames, with or without u/, for example AutoModerator. Case-insensitive; deleted or unknown authors are kept. Names are 1–64 letters, digits, underscores or hyphens. Explicit post links bypass post filters; their comments remain filtered.",
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "minScore": {
            "title": "Minimum post score",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "type": "integer",
            "description": "Keep posts with at least this score; unknown scores are kept, and zero is a real value. Does not filter archived posts, user-history posts or comment-search matches. Explicit post links bypass this filter. Safe integer (negative values allowed), or empty."
          },
          "minComments": {
            "title": "Minimum comments on a post",
            "minimum": 0,
            "maximum": 9007199254740991,
            "type": "integer",
            "description": "Keep posts reporting at least this many comments; unknown counts are kept. This selects posts, not the number of replies to collect (use maxCommentsPerPost). Does not filter archived posts, user-history posts or comment-search matches. Explicit post links bypass this filter. Non-negative safe integer, or empty."
          },
          "includeMedia": {
            "title": "Include image and video links",
            "type": "boolean",
            "description": "Add available image, gallery and video links and details to supported posts. Off by default. Availability varies; archived posts do not gain media, and user-history media can be limited. Files are not downloaded.",
            "default": false
          },
          "includeCommunityInfo": {
            "title": "Include subreddit details and rules",
            "type": "boolean",
            "description": "Add a separate community result for each explicitly supplied subreddit, with available descriptions, rules, dates, subscribers and public moderators. Off by default; no effect without subreddits. Does not add details for automatically discovered communities. Missing or incomplete details are indicated; moderator lists may be incomplete.",
            "default": false
          },
          "aiEnrichment": {
            "title": "AI sentiment and intent analysis (optional)",
            "type": "boolean",
            "description": "Off by default. Analyse post/comment text for intent, sentiment, products, brands, problems and topic labels, with supporting quotes. Adds $1 per 1,000 successful analyses to normal result charges; failed or skipped analyses have no AI surcharge and keep the collected result. Enabling shares post title/text or comment text and any custom topic labels with an external AI provider; text may contain names or links. Separate author, URL, score, media and profile fields are not sent. Profiles and communities are not analysed.",
            "default": false
          },
          "enrichmentLabels": {
            "title": "Custom AI topic labels",
            "uniqueItems": true,
            "type": "array",
            "description": "Used only with aiEnrichment enabled. Supply labels such as pricing, bug report or feature request; empty lets the AI choose up to five topics. Up to 50 distinct labels, each 1–60 characters after whitespace normalization, without non-whitespace control characters; duplicates are removed case-insensitively.",
            "items": {
              "type": "string",
              "maxLength": 60
            }
          },
          "monitorKey": {
            "title": "Monitoring label",
            "pattern": "^\\s*[A-Za-z0-9._-]{0,64}\\s*$",
            "type": "string",
            "description": "Reuse a label, for example brand-daily, to skip posts/comments delivered within the last 30 days. A new label starts fresh; edited results are not repeated. This does not schedule runs: add an Apify Schedule separately. Search/subreddit monitoring finds new posts or matches, not new replies on previously delivered posts; supply postUrls with includeComments to follow those replies. Concurrent runs sharing a label can return duplicates. Trimmed label: 1–64 letters, digits, dots, underscores or hyphens; empty turns monitoring off."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}