{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments, Search & Subreddits",
    "description": "Export public Reddit posts and comments from subreddit, user, search, post, comment, and short-link URLs for social listening, lead research, AI datasets, and alerts.",
    "version": "0.1",
    "x-build-id": "9k8g92Q0gdW8d3Biq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetch_cat~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetch_cat-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/fetch_cat~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetch_cat-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/fetch_cat~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetch_cat-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",
            "maxItems": 100,
            "type": "array",
            "description": "Subreddit, post, comment, user profile, Reddit search, or Reddit Share /r/community/s/token URLs. Share redirects must resolve to an exact safe public post; unresolved links fail explicitly instead of scraping the community. At most 100 targets.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "url": {
            "title": "Single Reddit URL",
            "maxLength": 4096,
            "type": "string",
            "description": "Convenience alias for urls. If other aliases or urls are also provided, the target must agree; conflicting targets are rejected before extraction."
          },
          "comment_url": {
            "title": "Comment URL alias",
            "maxLength": 4096,
            "type": "string",
            "description": "Compatibility alias for a single Reddit URL. Must agree with url/commentUrl and any nonempty urls batch."
          },
          "commentUrl": {
            "title": "Comment URL alias (camel case)",
            "maxLength": 4096,
            "type": "string",
            "description": "Compatibility alias for comment_url. Conflicting aliases are rejected."
          },
          "filterKeywords": {
            "title": "Filter keywords",
            "maxItems": 100,
            "type": "array",
            "description": "Keep matching records only, before saving or charging. Case-insensitive Unicode NFKC normalization; whitespace is collapsed. Literal substrings, not regular expressions. Empty list keeps all records. Each keyword must contain text.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "filterMode": {
            "title": "Keyword matching mode",
            "enum": [
              "any",
              "all",
              "titleOnly",
              "exactPhrase"
            ],
            "type": "string",
            "description": "any: any keyword in title/body; all: every keyword in title/body; titleOnly: any keyword in the post title (comments have no title and do not match); exactPhrase: keywords joined in order with a single space, in title/body. Filtering is per record. A filtered post is not expanded for comments.",
            "default": "any"
          },
          "outputFormat": {
            "title": "AI export format",
            "enum": [
              "default",
              "jsonl-finetune",
              "rag-markdown"
            ],
            "type": "string",
            "description": "default preserves the dataset only. AI modes additionally export the same saved records to the AI_EXPORT key-value file (strict messages-only training JSONL or RAG Markdown) and EXPORT_INFO. No additional event charges. Exports are bounded to 128 MiB total and 4 MiB per record; split larger inputs. Parent excerpts are available only from the preceding 128 exported records, at most 512 characters each; not a complete thread.",
            "default": "default"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Optional Reddit search query. Used with global Reddit search unless Search subreddit is filled."
          },
          "searchQueries": {
            "title": "Additional search queries",
            "maxItems": 100,
            "type": "array",
            "description": "Up to 100 nonempty queries, each at most 512 characters. Combined with searchQuery; repeated query strings run once. Each uses the same subreddit, sort, time filter and per-source post cap. Total work remains bounded by the run deadline.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "deduplicatePosts": {
            "title": "Deduplicate posts across sources",
            "type": "boolean",
            "description": "Default true preserves existing behavior: save and charge each post once across sources/queries. False retains a separate post row per source occurrence; page repeats within that source and duplicate comments are still removed. Additional saved rows incur existing post event charges."
          },
          "searchSubreddit": {
            "title": "Search subreddit",
            "type": "string",
            "description": "Optional subreddit name for restricting searchQuery and searchQueries, for example technology or webscraping."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance"
            ],
            "type": "string",
            "description": "Sort mode for subreddit listings and public searches.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for top listings and public search where supported.",
            "default": "week"
          },
          "maxPostsPerSource": {
            "title": "Maximum posts per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum requested post records per source, within finite collection limits. Reddit may expose fewer records than requested; incomplete collection is reported explicitly.",
            "default": 20
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Collect available comments for discovered posts, up to maxCommentsPerPost. Useful saved rows remain available if later collection is incomplete; inspect the partial summary.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of comment records to save per post when comments are enabled.",
            "default": 10
          },
          "commentDepth": {
            "title": "Requested comment levels",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Optional 1–10 known reply levels: 1 includes depth 0, 10 includes depths 0–9. Omitted keeps available levels. Unknown depths stay null and are retained with a warning. Does not promise full-thread completeness."
          },
          "commentContextMode": {
            "title": "Comment URL mode",
            "enum": [
              "focused",
              "post"
            ],
            "type": "string",
            "description": "For comment URLs, focused selects the exact target first, bounded known ancestors and available replies. Post collects the ordinary thread. Limits include the target; unknown ancestry is never fabricated.",
            "default": "focused"
          },
          "commentContextDepth": {
            "title": "Comment context depth",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum known ancestors included after the focused comment target, within the comment limit.",
            "default": 3
          },
          "retryCount": {
            "title": "Retry attempts per Reddit request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum recovery attempts after a temporary collection failure, within the original run deadline.",
            "default": 4
          },
          "initialRetryDelayMillis": {
            "title": "Initial retry delay (ms)",
            "minimum": 250,
            "maximum": 30000,
            "type": "integer",
            "description": "Base waiting time in milliseconds after a temporary collection failure.",
            "default": 750
          },
          "requestPacingMillis": {
            "title": "Request pacing delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum collection pacing in milliseconds, within the original run deadline.",
            "default": 750
          },
          "runTimeSecs": {
            "title": "Safe run deadline",
            "minimum": 30,
            "maximum": 270,
            "type": "integer",
            "description": "Stops starting Reddit requests before the platform timeout so partial records and diagnostics can be saved cleanly.",
            "default": 260
          },
          "mcpConnectors": {
            "title": "MCP connectors",
            "minItems": 0,
            "maxItems": 3,
            "uniqueItems": true,
            "type": "array",
            "description": "Connector(s) this Actor may use after scraping, such as Slack, Notion, Supabase, or another MCP-compatible destination. The actor discovers tools at runtime and only calls safe send/post/write/create/insert/append/log-style tools."
          },
          "mcpMode": {
            "title": "MCP delivery mode",
            "enum": [
              "off",
              "sendSummary",
              "sendRecords"
            ],
            "type": "string",
            "description": "Off by default. Choose Summary to send only a compact run digest, or Records to include capped sample records after saving the dataset.",
            "default": "off"
          },
          "mcpInstruction": {
            "title": "MCP delivery instruction",
            "maxLength": 500,
            "type": "string",
            "description": "Short instruction for the selected connector, for example: Send a digest to #social-listening. Do not paste API keys or third-party credentials here."
          },
          "maxMcpRecords": {
            "title": "Maximum MCP records",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of scraped records included when MCP delivery mode sends records. The full dataset remains available separately.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Existing connection preferences are preserved. The form defaults to managed US residential access. Set useApifyProxy to false for direct-only access, or supply your own proxyUrls. Omitted API settings allow managed US access when needed; explicit groups and countries remain supported. Managed connection usage can incur platform costs. No additional connection setting is required for expanded output.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}