{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments, Search, Users (no login)",
    "description": "Scrape Reddit subreddit posts, search results, full comment trees, and user history. Cookie-free, reliable (>95% success), and cheaper than incumbents. Built-in monitor mode for new-post alerts.",
    "version": "0.1",
    "x-build-id": "HAmqS70XPPfrwMNht"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/constructive_calm~reddit-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-constructive_calm-reddit-scraper-pro",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/constructive_calm~reddit-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-constructive_calm-reddit-scraper-pro",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/constructive_calm~reddit-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-constructive_calm-reddit-scraper-pro",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "subreddit_posts",
              "search",
              "comments_thread",
              "user_profile",
              "monitor"
            ],
            "type": "string",
            "description": "Pick the scrape mode. 'Subreddit posts' is the most common starting point.",
            "default": "subreddit_posts"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names without the r/ prefix (e.g. 'programming'). Used by subreddit_posts and monitor modes.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance"
            ],
            "type": "string",
            "description": "Sort order. For SEARCH, choose 'Relevance' or 'Top' for the most precise results — 'Hot' is recency-weighted and matches loosely. (In subreddit feeds, which have no relevance sort, 'Relevance' falls back to 'Hot'.)",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time window (for Top / Controversial)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only applies when sort is 'top' or 'controversial'.",
            "default": "all"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword to search (search mode). TIP: wrap a multi-word query in double quotes for exact-phrase matching — e.g. \"offshore recruiting\" — otherwise Reddit matches the words loosely and returns tangential posts. Pair with sort=Relevance or Top for best precision. Combine with 'Restrict search to subreddit' to scope it."
          },
          "restrictToSubreddit": {
            "title": "Restrict search to first subreddit",
            "type": "boolean",
            "description": "When on, search mode searches only within the first subreddit listed above (restrict_sr). Off = sitewide search.",
            "default": false
          },
          "postUrls": {
            "title": "Post URLs or permalinks",
            "type": "array",
            "description": "Full Reddit post URLs or permalinks. Used by comments_thread mode. Example: https://www.reddit.com/r/programming/comments/abc123/title/",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames without the u/ prefix. Used by user_profile mode.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include comments (comments_thread mode only)",
            "type": "boolean",
            "description": "comments_thread mode ONLY. When on, emits the full comment tree; when off, only the post. IGNORED by search / subreddit_posts / user_profile / monitor (those return posts only). To get comments for search results, run comments_thread on the result URLs.",
            "default": true
          },
          "maxCommentDepth": {
            "title": "Max comment depth (comments_thread mode only)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "comments_thread mode ONLY. How deep to follow nested comment chains. 0 = post only. Ignored by other modes.",
            "default": 10
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on dataset rows for this run (across all targets).",
            "default": 200
          },
          "maxPagesPerTarget": {
            "title": "Max pages per target",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Pagination cap per subreddit/search/user (each page = ~25 items). Guards runaway runs.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Datacenter (default) is cheapest and works for most runs. For very large or heavily rate-limited runs, switch to Residential. Reddit rate-limits by IP, so the scraper rotates IPs + retries automatically regardless of choice.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Auto residential fallback",
            "type": "boolean",
            "description": "When a datacenter request keeps getting blocked/rate-limited after retries, automatically retry that page once through a residential IP. Keeps success rate high while staying cheap by default. (No effect if you already selected residential.)",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}