{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments, Subreddits, Users & Search",
    "description": "Reddit scraper for subreddit posts, comments, user profiles and keyword search: full post text, every comment and reply, votes, authors, dates and media. Export JSON, CSV or Excel, or use the API. No login, no API key. $0.50 per 1,000 posts, $0.25 per 1,000 comments.",
    "version": "0.1",
    "x-build-id": "PbyqTM53GEL9jGSfx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialscrapers~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialscrapers-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/socialscrapers~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-socialscrapers-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/socialscrapers~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-socialscrapers-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs to scrape, in any mix. Subreddits: https://www.reddit.com/r/AskReddit/ or r/AskReddit. User profiles: https://www.reddit.com/user/NAME/ or u/NAME (end in /submitted/ for posts only, /comments/ for comments only). Posts: a post's link or a redd.it short link. Share links from the Reddit app (reddit.com/r/NAME/s/…) and v.redd.it links work too: each is followed to the page it opens. Search pages: https://www.reddit.com/search/?q=coffee or https://www.reddit.com/r/Coffee/search/?q=grinder. A subreddit URL that names a sort, like /top/?t=week, keeps that sort.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search Reddit posts for, for example \"standing desk\" or \"best budget headphones\". Each keyword is its own search and returns up to \"Max items per source\" posts.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerSource": {
            "title": "Max items per source",
            "minimum": 0,
            "type": "integer",
            "description": "Most posts to take from each subreddit and each search keyword, and most posts and comments from each user profile. 0 = no limit: the scraper keeps going while Reddit has more (it reads other sort orders and time ranges once one listing ends). Comments collected with \"Include comments\" do not count here (see \"Max comments per post\"). Example: 500.",
            "default": 100
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "For subreddit posts, post URLs and search results, also collect each post's comments: one result per comment, right after its post, with its depth and parent. User profiles always include the user's own comments.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Most comments to collect for each post when \"Include comments\" is on. 0 = every comment of the post, including the replies Reddit folds behind \"more replies\". Example: 200.",
            "default": 50
          },
          "commentSort": {
            "title": "Sort comments by",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "The order comments are collected in, as on Reddit: Best (Reddit's default), Top, New, Controversial, Old or Q&A. With a comment limit, it decides which comments you get.",
            "default": "best"
          },
          "searchSort": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of search results. When you ask for more posts than one search returns (about 250), the scraper also reads the other orders within your time range and removes duplicates.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time range",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day"
            ],
            "type": "string",
            "description": "Only find posts from this period, for example the past week.",
            "default": "all"
          },
          "searchIncludePostDetails": {
            "title": "Full post text for search results",
            "type": "boolean",
            "description": "Off by default: each search result comes with its title, votes, comment count, author, subreddit and date. Turn on to also read each result's post page, so every result has its full text, link, flair, upvote ratio, images and video, like subreddit posts do. A result read this way is priced as \"Search result with full text\" ($1.45 per 1,000) instead of a post ($0.50 per 1,000).",
            "default": false
          },
          "searchMatchAllWords": {
            "title": "Only posts that mention every keyword word",
            "type": "boolean",
            "description": "Keep only posts whose title or text mentions every word of the keyword (plurals and accents count). Reddit's search also returns posts that match only in their comments. Turn off to keep every post the search returns.",
            "default": true
          },
          "subredditSort": {
            "title": "Sort subreddit posts by",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Which listing to read for subreddit URLs that do not name one: Hot (Reddit's default), New, Top or Rising.",
            "default": "hot"
          },
          "subredditTime": {
            "title": "Time range for Top",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day"
            ],
            "type": "string",
            "description": "The period the Top listing covers, for example the past month. Used only when sorting by Top.",
            "default": "all"
          },
          "maxItems": {
            "title": "Max items in total",
            "minimum": 0,
            "type": "integer",
            "description": "Overall cap on results (posts plus comments) for the whole run. The run stops once it is reached. Leave empty (or 0) for no cap. Example: 10000."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Keep the default: Apify Proxy with the RESIDENTIAL group. Reddit refuses most datacenter IPs: with another Apify Proxy group, sessions Reddit refuses are retried on RESIDENTIAL (same country).",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}