{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper — Posts, Comments, Subreddits & Search",
    "description": "Fast, reliable no-browser Reddit scraper for posts, nested comment trees, keyword monitoring, subreddit feeds, and user profiles. Includes automatic residential proxy fallback, deduplication, and upvote/keyword filters at flat pay-per-item pricing.",
    "version": "0.1",
    "x-build-id": "GfswOfT5KH8kAz5E7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leopoldsaint~reddit-scraper-fast/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leopoldsaint-reddit-scraper-fast",
        "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/leopoldsaint~reddit-scraper-fast/runs": {
      "post": {
        "operationId": "runs-sync-leopoldsaint-reddit-scraper-fast",
        "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/leopoldsaint~reddit-scraper-fast/run-sync": {
      "post": {
        "operationId": "run-sync-leopoldsaint-reddit-scraper-fast",
        "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": {
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Keywords or phrases to search across Reddit (or restricted to the Subreddits listed below when Restrict Search to Subreddits is enabled).",
            "items": {
              "type": "string"
            },
            "default": [
              "shopify app recommendation"
            ]
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names (e.g. 'SaaS', 'r/shopify', 'entrepreneur') to fetch feeds from, or to scope Search Queries.",
            "items": {
              "type": "string"
            },
            "default": [
              "SaaS"
            ]
          },
          "postUrls": {
            "title": "Direct Post URLs",
            "type": "array",
            "description": "Direct Reddit post URLs to scrape along with their full nested comment trees.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames (with or without u/) to extract recent public posts and comments.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "restrictSearchToSubreddits": {
            "title": "Restrict Search to Subreddits",
            "type": "boolean",
            "description": "When both Search Queries and Subreddits are provided, search inside each listed subreddit instead of site-wide.",
            "default": false
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "hot",
              "new",
              "top",
              "relevance",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "Sort order for search results and subreddit listings.",
            "default": "hot"
          },
          "timeRange": {
            "title": "Time Range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window applied to Top and Search sorts.",
            "default": "month"
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Also extract nested comments for each scraped post (always enabled for direct Post URLs).",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max Comments per Post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum comments extracted per post when Include Comments is enabled or Post URLs are provided.",
            "default": 20
          },
          "minUpvotes": {
            "title": "Minimum Upvotes (Score)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts or comments with net upvotes below this threshold (0 = no filter).",
            "default": 0
          },
          "excludeNsfw": {
            "title": "Exclude NSFW Posts",
            "type": "boolean",
            "description": "Filter out posts marked over_18 / NSFW.",
            "default": true
          },
          "containsKeywords": {
            "title": "Must Contain Keywords (Optional)",
            "type": "array",
            "description": "Optional case-insensitive keywords; only emit posts/comments matching at least one keyword.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxItemsPerSource": {
            "title": "Max Items per Source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum posts fetched per search query, subreddit, or username.",
            "default": 20
          },
          "maxTotalItems": {
            "title": "Max Total Items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on total unique posts + comments emitted across the entire run.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify Proxy settings. Residential proxy fallback is automatically used if datacenter IPs are blocked by Reddit.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "demoMode": {
            "title": "Demo Mode",
            "type": "boolean",
            "description": "Run offline on bundled sample Reddit posts & comments without network calls or charges.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}