{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper By Multiple Subreddits & Keyword Search",
    "description": "Reddit Scraper by Multiple Subreddits & Keyword Search extracts posts, comments, authors, scores, timestamps, and engagement data across multiple subreddits and keywords. Ideal for market research, sentiment analysis, trend discovery, and competitor research.",
    "version": "0.1",
    "x-build-id": "vx9nRLVXLJwFmn6eI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-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/api-empire~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-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/api-empire~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-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": {
          "keywords": {
            "title": "🔎 Keywords to search",
            "type": "array",
            "description": "One or more search phrases, run across every subreddit listed below in ONE job. A multi-word phrase matches posts containing ALL of its words (in any order), e.g. \"AI chip\" matches posts mentioning both \"AI\" and \"chip\". Each keyword is queried separately and every result row is tagged with the exact query AND the exact source subreddit. Also accepts the base actor's legacy \"searchTerms\" key (see Legacy Inputs section) when this field is left empty.",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "🏘️ Subreddits to search (multi-subreddit fan-out)",
            "type": "array",
            "description": "One or more subreddit names, WITHOUT the \"r/\" prefix (e.g. technology, MachineLearning, artificial). Each keyword above is searched against EVERY subreddit in this list in the same run, and each result is tagged with its real \"sourceSubreddit\" so you can tell them apart. Leave empty to search unscoped across all of Reddit (uses the fallback archive only — see the Legacy Inputs note on staleness). Also accepts the base actor's legacy single-subreddit \"searchCommunity\" key when this field is left empty.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 Start URLs (post / subreddit / user)",
            "minItems": 0,
            "type": "array",
            "description": "Optional. One or more Reddit URLs to scrape directly, on top of the keyword search above. Supports bulk input: use \"+ Add\", \"Bulk edit\", or \"Text file\". Accepted URL types: (1) Post URLs containing /comments/ and a post ID; (2) Subreddit URLs (e.g. https://www.reddit.com/r/python/); (3) User profile URLs (e.g. https://www.reddit.com/user/username/). The actor detects each URL's type and runs the matching mode (post + comments, subreddit listing, or user profile) alongside the keyword search.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Exclude keywords",
            "type": "array",
            "description": "Terms to EXCLUDE from search results (e.g. \"crypto\", \"NFT\"). Any post whose title or body contains an excluded term (case-insensitive) is dropped before it is saved, and does not count toward your item budget.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "📅 Date from (posts on or after)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$|^$",
            "type": "string",
            "description": "Only include posts created ON OR AFTER this date. Absolute date (e.g. 2026-06-01) or relative (e.g. \"7 days\", \"2 weeks\", \"3 months\"). This is a REAL, working filter — it narrows what the archive actually returns, not a cosmetic option. Leave empty for no lower bound. Also accepts the base actor's legacy \"filterByDate\" key when this field is left empty."
          },
          "dateTo": {
            "title": "📅 Date to (posts on or before)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$|^$",
            "type": "string",
            "description": "Only include posts created ON OR BEFORE this date. Absolute date (e.g. 2026-07-01) or relative (e.g. \"1 day\", \"1 week\" = on or before that many units ago). Combine with \"Date from\" above for a real bounded date RANGE. Leave empty for no upper bound."
          },
          "minScore": {
            "title": "⬆️ Minimum score (upvotes)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many upvotes (score). 0 = no minimum. Genuinely applied against each post's real score before it is saved.",
            "default": 0
          },
          "minComments": {
            "title": "💬 Minimum comment count",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many comments. 0 = no minimum. Genuinely applied against each post's real comment count before it is saved.",
            "default": 0
          },
          "flairFilter": {
            "title": "🏷️ Flair contains",
            "type": "string",
            "description": "Only include posts whose link flair text contains this substring (case-insensitive), e.g. \"Discussion\" or \"News\". Leave empty for no flair filter.",
            "default": ""
          },
          "sortSearch": {
            "title": "📊 Sort search results",
            "enum": [
              "relevance",
              "new",
              "hot",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Controls how search results are ordered after they are collected. relevance/hot/top rank by score (highest first — no live \"trending\" signal exists on a no-login source), new = newest first, comments = most comments first.",
            "default": "new"
          },
          "timeFilter": {
            "title": "⏱️ Relative time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Restricts search results to a relative time window: hour, day, week, month, year, or all. If both this and \"Date from\" are set, the more restrictive (more recent) lower bound wins.",
            "default": "all"
          },
          "enableSearch": {
            "title": "🔍 Enable keyword search",
            "type": "boolean",
            "description": "When on, the multi-subreddit keyword search above runs whenever Keywords are set and there are no Start URLs (or \"Ignore start URLs\" is on). When off, keyword search is skipped entirely.",
            "default": true
          },
          "ignoreStartUrls": {
            "title": "⏭️ Ignore start URLs",
            "type": "boolean",
            "description": "When enabled, Start URLs are not scraped — only the keyword search runs. Useful for a search-only job.",
            "default": false
          },
          "searchForPosts": {
            "title": "📝 Search for posts",
            "type": "boolean",
            "description": "Include posts in search results. This is the only search scope this actor supports; turn off to skip search entirely even when keywords are set.",
            "default": true
          },
          "enableSubreddit": {
            "title": "📰 Enable subreddit listing (from Start URLs)",
            "type": "boolean",
            "description": "When on, any subreddit URLs in Start URLs are scraped for their post listing, ordered by \"Subreddit listing sort\" below. When off, subreddit Start URLs are ignored.",
            "default": true
          },
          "sortSubreddit": {
            "title": "📊 Subreddit listing sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "How to order posts fetched from a Start-URL subreddit listing. \"new\"/\"top\" are real orderings; \"hot\"/\"rising\" are a disclosed approximation (score decayed by post age); \"controversial\" is a real signal (upvote ratio closest to 50/50).",
            "default": "new"
          },
          "enablePost": {
            "title": "📝 Enable post + comments (from Start URLs)",
            "type": "boolean",
            "description": "When on, any post URLs in Start URLs are scraped for the full post and its comment tree (unless \"Skip comments\" is enabled).",
            "default": true
          },
          "skipComments": {
            "title": "💬 Skip comments",
            "type": "boolean",
            "description": "If enabled, comments are not fetched for post URLs — only post-level data.",
            "default": false
          },
          "enableUser": {
            "title": "👤 Enable user scraper (from Start URLs)",
            "type": "boolean",
            "description": "When on, any user profile URLs in Start URLs are scraped for profile info, submitted posts, and comments.",
            "default": true
          },
          "skipUserPosts": {
            "title": "👤 Skip user profile URLs",
            "type": "boolean",
            "description": "If enabled, user profile URLs in Start URLs are ignored entirely.",
            "default": false
          },
          "fetchUserProfile": {
            "title": "👤 Fetch user profile",
            "type": "boolean",
            "description": "When on, fetch each user's profile/karma summary.",
            "default": true
          },
          "fetchUserSubmitted": {
            "title": "📝 Fetch user submitted posts",
            "type": "boolean",
            "description": "When on, fetch posts submitted by each user.",
            "default": true
          },
          "fetchUserComments": {
            "title": "💬 Fetch user comments",
            "type": "boolean",
            "description": "When on, fetch comments made by each user.",
            "default": true
          },
          "enableSubredditInfo": {
            "title": "🏘️ Enable subreddit info (from Start URLs)",
            "type": "boolean",
            "description": "When on, fetches metadata (title, description, subscribers, creation date) for subreddits found in Start URLs, plus the optional top-subreddits ranking below.",
            "default": true
          },
          "skipCommunity": {
            "title": "🏘️ Skip community metadata",
            "type": "boolean",
            "description": "If enabled, subreddit/community metadata is not fetched for Start-URL subreddits.",
            "default": false
          },
          "fetchTopSubreddits": {
            "title": "🔝 Fetch top subreddits by subscriber count",
            "type": "boolean",
            "description": "When on, adds a real ranking of large subreddits by subscriber count as \"top_subreddit\" rows. Not Reddit's own live trending algorithm.",
            "default": false
          },
          "searchTerms": {
            "title": "🔎 [Legacy] Search Term",
            "type": "array",
            "description": "Base actor's original search-term field. Used only when \"Keywords to search\" above is empty.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunity": {
            "title": "🏘️ [Legacy] Community (single, optional)",
            "type": "string",
            "description": "Base actor's original single-subreddit field. Used only when \"Subreddits to search\" above is empty."
          },
          "filterByDate": {
            "title": "📅 [Legacy] Filter by date (posts on or after)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$|^$",
            "type": "string",
            "description": "Base actor's original date field. Used only when \"Date from\" above is empty."
          },
          "maxItemsToSave": {
            "title": "📦 Maximum number of items to save",
            "minimum": 1,
            "type": "integer",
            "description": "Global maximum number of rows (search results, posts, comments, user items, subreddit info — everything combined) saved across the ENTIRE run. The run stops collecting once this cap is reached.",
            "default": 50
          },
          "limitPostsPerPage": {
            "title": "📄 Target posts per keyword × subreddit",
            "minimum": 1,
            "type": "integer",
            "description": "Target number of posts to fetch per keyword, PER subreddit (subject to the global \"Maximum number of items to save\" cap above). With 2 keywords × 3 subreddits, up to 6 separate searches run.",
            "default": 10
          },
          "limitCommunityPages": {
            "title": "🏘️ Pages per keyword × subreddit",
            "minimum": 1,
            "type": "integer",
            "description": "For each keyword/subreddit combination (or Start-URL subreddit listing), the maximum number of result pages to paginate through (each page returns up to 100 posts).",
            "default": 2
          },
          "limitCommentsPerPage": {
            "title": "💬 Max comments per post",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of comments to fetch for a single post (also subject to \"Max comment tree depth\" below).",
            "default": 50
          },
          "maxCommentDepth": {
            "title": "🌳 Max comment tree depth",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum depth of nested comment replies to parse. Depth 1 = top-level only (1–20).",
            "default": 5
          },
          "limitUserPages": {
            "title": "👤 Pages per user",
            "minimum": 1,
            "type": "integer",
            "description": "For each user profile URL, the maximum number of pages to fetch for submitted posts and comments (each page returns up to 100 items).",
            "default": 2
          },
          "maxItemsPerUser": {
            "title": "👤 Max items per user (posts/comments)",
            "minimum": 1,
            "type": "integer",
            "description": "Per user, the maximum number of submitted posts and the maximum number of comments to fetch.",
            "default": 20
          },
          "maxSubredditsInfo": {
            "title": "🔢 Max subreddits to rank",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When \"Fetch top subreddits by subscriber count\" is enabled, the maximum number of subreddits to return.",
            "default": 25
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Configure Apify Proxy for this run. By default the actor connects directly. If a request is rate-limited or fails, the actor automatically retries through a datacenter proxy, then a residential proxy, and keeps using the first tier that works. You can also enable Apify Proxy here from the start."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}