{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments, Communities & Users",
    "description": "Scrape Reddit posts, comments, subreddits and users from subreddit, post or profile URLs or keyword search. Filter by date, sort and NSFW. No login, API key or proxy needed. Export JSON, CSV or Excel.",
    "version": "2.0",
    "x-build-id": "ViZwJA08QxMb7SnAe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/whoareyouanas~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-whoareyouanas-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/whoareyouanas~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-whoareyouanas-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/whoareyouanas~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-whoareyouanas-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",
        "required": [
          "proxy"
        ],
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs to scrape — posts, subreddits, users, or search-result pages. When provided, all Search options below are ignored.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "ignoreStartUrls": {
            "title": "Ignore Start URLs",
            "type": "boolean",
            "description": "Set to true to bypass the Start URLs field (used as a fix for tools like Zapier).",
            "default": false
          },
          "searches": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords used to search Reddit. Used only when Start URLs is empty.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunityName": {
            "title": "Restrict search to community",
            "type": "string",
            "description": "If provided, search is performed only inside this community (e.g. 'programming'). Leave empty to search all of Reddit."
          },
          "searchPosts": {
            "title": "Search posts",
            "type": "boolean",
            "description": "Include matching posts in search results.",
            "default": true
          },
          "searchComments": {
            "title": "Search comments",
            "type": "boolean",
            "description": "Include matching comments in search results (best-effort; Reddit's comment search is limited).",
            "default": false
          },
          "searchCommunities": {
            "title": "Search communities",
            "type": "boolean",
            "description": "Include matching communities (subreddits) in search results.",
            "default": false
          },
          "searchUsers": {
            "title": "Search users",
            "type": "boolean",
            "description": "Include matching user profiles in search results.",
            "default": false
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "",
              "relevance",
              "hot",
              "top",
              "new",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "Sort order for posts and search results.",
            "default": "new"
          },
          "time": {
            "title": "Time filter",
            "enum": [
              "",
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit results to a recent time window (most useful with sort = top or controversial).",
            "default": ""
          },
          "includeNSFW": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "Include adult-rated posts and subreddits in results.",
            "default": true
          },
          "skipComments": {
            "title": "Skip comments",
            "type": "boolean",
            "description": "Skip scraping comments when going through posts.",
            "default": false
          },
          "skipUserPosts": {
            "title": "Skip user posts",
            "type": "boolean",
            "description": "Skip scraping a user's submitted posts when going through their profile.",
            "default": false
          },
          "skipCommunity": {
            "title": "Skip community info",
            "type": "boolean",
            "description": "Skip scraping community (subreddit) metadata, but still scrape its posts.",
            "default": false
          },
          "postDateLimit": {
            "title": "Posts after date (ISO)",
            "type": "string",
            "description": "Only retrieve posts published after this date (ISO 8601, e.g. 2024-01-01)."
          },
          "commentDateLimit": {
            "title": "Comments after date (ISO)",
            "type": "string",
            "description": "Only retrieve comments published after this date (ISO 8601)."
          },
          "maxItems": {
            "title": "Max items (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on the total number of items saved to the dataset across all categories.",
            "default": 10
          },
          "maxPostCount": {
            "title": "Max posts per page",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of posts scraped from each subreddit / search / user submissions page.",
            "default": 10
          },
          "maxComments": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of comments scraped per post.",
            "default": 10
          },
          "maxCommunitiesCount": {
            "title": "Max communities",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of communities returned from search or leaderboard.",
            "default": 2
          },
          "maxUserCount": {
            "title": "Max users",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of user profiles returned from search.",
            "default": 2
          },
          "scrollTimeout": {
            "title": "Browser scroll timeout (s)",
            "minimum": 5,
            "type": "integer",
            "description": "Timeout (seconds) for page scrolling in the browser fallback path. Ignored on the JSON API path.",
            "default": 40
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Use Apify proxy or your own proxy servers. Residential is strongly recommended.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable verbose request and extraction logs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}