{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape Reddit posts, comments, communities, and user profiles without a login or API key. Search any subreddit or keyword to see what people say about a brand or topic, with full comment threads and the scores that show what landed.",
    "version": "0.0",
    "x-build-id": "KUpaa5syiCiOiwZ9t"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apify~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apify-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/apify~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apify-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/apify~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apify-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": [
          "scrapeMode"
        ],
        "properties": {
          "scrapeMode": {
            "title": "Scrape mode",
            "enum": [
              "posts",
              "comments",
              "communities",
              "users"
            ],
            "type": "string",
            "description": "Select what type of data to scrape from Reddit.",
            "default": "posts"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs to scrape - community, post, user, or search URLs depending on the selected scrape mode. In comments mode, a comment permalink scrapes just that single comment.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "includeNsfw": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Include adult (18+) content in results. When disabled, NSFW posts and communities are skipped even when passed directly as start URLs. A skipped post URL, or a skipped community in communities mode, gets an item with the \"nsfw-skipped\" reason; in posts or comments mode a community whose listing holds only NSFW posts gets an \"empty\" item.",
            "default": false
          },
          "communityNames": {
            "title": "Names",
            "type": "array",
            "description": "Community names (e.g. \"python\", \"r/webdev\").",
            "items": {
              "type": "string"
            }
          },
          "communityQueries": {
            "title": "Queries",
            "type": "array",
            "description": "Search queries scoped to the specified communities. Uses Reddit's built-in community search.",
            "items": {
              "type": "string"
            }
          },
          "communitySort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Sort order for community post listings.",
            "default": "hot"
          },
          "communityTimeFilter": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for \"Top\" or \"Controversial\" sort.",
            "default": "all"
          },
          "maxPostsPerCommunity": {
            "title": "Max posts",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum posts to scrape from each community. In comments mode these are the posts whose comments get scraped. Posts skipped as NSFW never use up the limit, and neither do posts with no comments in comments mode. Applies to each community query separately. Leave empty to scrape all available."
          },
          "includeCommunityRules": {
            "title": "Include rules",
            "type": "boolean",
            "description": "Get community rules alongside community details.",
            "default": false
          },
          "commentSort": {
            "title": "Sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Sort order for comments.",
            "default": "confidence"
          },
          "maxCommentDepth": {
            "title": "Max depth",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum nesting depth, counted from the post's top-level comments (0 = top-level only, 1 = one level of replies, etc.). Leave empty to scrape all levels. It's also recommended to leave empty when scraping from comment URL, since a deeply nested comment can fall outside the limit."
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum comments to scrape per post. Only comments that pass your filters count, so comments below \"Max depth\" never use up the limit. Leave empty to scrape all available."
          },
          "includeCommentReplies": {
            "title": "Include replies (comment URLs only)",
            "type": "boolean",
            "description": "Only applies when a start URL points to a specific comment. Enable to also scrape that comment's full reply thread, otherwise only the single comment will be scraped. It has no effect when scraping from post, community, or user (those already include replies - use Max depth to limit how deep).",
            "default": false
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Usernames (e.g. \"spez\", \"u/AutoModerator\").",
            "items": {
              "type": "string"
            }
          },
          "userSort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "controversial"
            ],
            "type": "string",
            "description": "Sort order for user post and comment listings.",
            "default": "new"
          },
          "userTimeFilter": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for \"Top\" or \"Controversial\" sort.",
            "default": "all"
          },
          "maxPostsPerUser": {
            "title": "Max posts",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum posts to scrape per user. Only posts that pass your filters count, so posts skipped as NSFW never use up the limit. Leave empty to scrape all available."
          },
          "maxCommentsPerUser": {
            "title": "Max comments",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum comments to scrape per user. Leave empty to scrape all available."
          },
          "searchQueries": {
            "title": "Queries",
            "type": "array",
            "description": "Search queries to find posts, communities, or users to scrape.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Sort order for search results.",
            "default": "relevance"
          },
          "searchTimeFilter": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for search results.",
            "default": "all"
          },
          "maxSearchResultsPerQuery": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum results to scrape per search query. Leave empty to scrape all available."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}