{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments & Subreddits",
    "description": "Scrape Reddit posts, comments, media, subreddits & users by keyword, subreddit or Reddit page URL. Filter by score and comments. No account or API key.",
    "version": "0.1",
    "x-build-id": "mNBjIhN4MKe06VV2d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/watcharin~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-watcharin-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/watcharin~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-watcharin-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/watcharin~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-watcharin-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": {
          "contentType": {
            "title": "Content type",
            "enum": [
              "posts",
              "media",
              "comments",
              "communities",
              "people"
            ],
            "type": "string",
            "description": "What to search for. \"posts\" (default) = text, link, image and video posts. \"media\" = posts that contain an image, video, GIF or gallery. \"comments\" = all comments from the posts that match your search; this uses one extra request per post, so set \"Max pages (total)\" to limit the number of posts. \"communities\" = subreddits that match the keywords (name, members, description, rules for posting...). \"people\" = profiles/redditors that match the keywords (karma, account age...). Only keywords, Sort by, NSFW (not safe for work), Max results per page and Max pages apply to Communities and People (for People, Sort by is applied by this Actor: hot = link karma, top = total karma, new = account creation date, comments = comment karma); all other filters apply to Posts, Media and Comments. Direct mode (Reddit page URLs / Subreddit feeds) works with Posts, Media and Comments only.",
            "default": "posts"
          },
          "includeRaw": {
            "title": "Include raw JSON",
            "type": "boolean",
            "description": "When enabled, each row gets an extra \"raw\" field containing the original Reddit JSON of that one item (a post, community, person or comment), so you can pick any field that is not in the default output. For Comments, \"raw\" is the comment without its replies (each reply is its own row). Works for every content type. Makes the output much larger."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Required for Communities and People. Optional for Posts, Media and Comments: you can search with other filters instead (Subreddits, Authors, Title contains, ...), or read feeds. In direct mode (Reddit page URLs / Subreddit feeds) it only keeps the posts whose title or text contains the keyword (several words must all appear; use double quotes for an exact phrase). Words or phrases to search for. Posts, Media and Comments: the keyword is sent to Reddit as plain text (q=<keyword>). A keyword can be searched in two ways. (1) All words, any order: type the words without quotes, for example portable grill. Reddit returns posts that contain all the words, anywhere in the title or text and in any order (in a test of 100 posts, 91 contained both words and 34 had them side by side). (2) Exact phrase: put the phrase in double quotes and type the quotes as part of the keyword, for example \"portable grill\". Reddit then returns posts where the words appear together in that order (in the same test, 98 of 100). Each item in the list is a separate search and the results are added together, so [\"portable grill\", \"camping stove\"] finds posts about either one; it does not require both in the same post. Comments: the keyword finds the posts whose comments are collected. For Posts, Media and Comments, if you fill in \"Title contains\" or \"Post text contains\" under Advanced filters, those replace the keyword search: the keywords are not used in the query (not in direct mode, where all filters are applied together). Communities and People: the keyword is sent to Reddit as plain text. Communities: Reddit matches the keyword, ignoring upper/lower case, against the subreddit name, title, short description and sidebar description. Names that contain the keyword inside a longer word can match too (for example \"camping\" finds r/OhioCamping). Results arrive in Reddit's own order (not sorted by size), and the first page can also contain large, loosely related communities whose returned fields do not contain the keyword; this comes from Reddit's search, not from a filter of this Actor. Double quotes make the match much stricter (in a test with outdoor camping, the first page had 100 communities without quotes and 9 with quotes). People: the keyword is matched mainly against the public profile description (for example outdoor camping finds a profile that says \"I film outdoor fishing and camping trips\"). Double quotes make the match stricter and return fewer results (in the same test 19 people without quotes and 3 with quotes). A user name that contains the keyword inside one longer word (for example u/Outdoorcampingshop) is usually NOT found. The People results of this Actor come from Reddit's search API and can differ from the Profiles tab on reddit.com, which uses a different search; this is a limit of Reddit's API, not a filter of this Actor.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddits to search in, written without the \"r/\" prefix (for example \"camping\"). All subreddits are searched together in a single query per keyword. Optional: leave empty to search all of Reddit (this can return a very large number of posts, so use specific keywords or filters). Applies to Posts, Media and Comments searches only; ignored for Communities and People and in direct mode (use \"Subreddit feeds\" there).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "How the results are ordered before your filter settings are applied. Choose one sort. This is the sort of the search; it is ignored in direct mode (use \"Feed sort\"). Posts, Media and Comments (Reddit orders the posts found): \"relevance\" (default) = closest match to the keywords; \"hot\" = trending now; \"top\" = highest score; \"new\" = most recent first; \"comments\" = most discussed (every sort respects the time range). People (redditors): Reddit ignores the sort for people, so this Actor sorts the rows itself: \"relevance\" (default) = Reddit's own order (best name match first); \"hot\" = link karma, highest first; \"top\" = total karma (link + comment), highest first; \"new\" = account creation date, newest account first; \"comments\" = comment karma, highest first. For People with hot, top, new or comments the Actor fetches every page allowed by \"Max pages (total)\" and sorts all the rows it collected. Accounts without a value (for example suspended or deleted accounts) are always listed last, and ties keep Reddit's relevance order. Only the accounts Reddit returns for your keyword are sorted, so the order is not a ranking of all of Reddit. Communities: Reddit may ignore the sort and mostly return relevance order.",
            "default": "relevance"
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day",
              "hour"
            ],
            "type": "string",
            "description": "Only include posts published within this period: \"hour\", \"day\", \"week\", \"month\", \"year\" (default) or \"all\". Applies to Posts, Media and Comments only; ignored for Communities and People. In direct mode it is used only when \"Feed sort\" is top or controversial (a time in a Start URL, for example ?t=week, wins).",
            "default": "year"
          },
          "startUrls": {
            "title": "Reddit page URLs",
            "type": "array",
            "description": "Optional. Reddit pages to read directly instead of searching. Accepted: a subreddit (https://www.reddit.com/r/camping/), a subreddit with a sort and time (https://www.reddit.com/r/camping/top/?t=week), a user page (https://www.reddit.com/user/PlentyDirection5691/) and a single post (https://www.reddit.com/r/camping/comments/abc123/title/). A sort or time written in the URL wins over \"Feed sort\" and \"Time range\". old.reddit.com and r/all also work. A user page returns that user's own posts only (not the comments they wrote). Search, wiki and multireddit pages are not supported and are skipped with a warning; short redd.it links are skipped too. For a post URL, Posts and Media return the post and Comments returns its comments (up to about 500 per post; the keyword and Advanced filters are not applied to a post URL you give explicitly). Applies to Posts, Media and Comments only. API / JSON input: an array of objects, e.g. [{\"url\": \"https://www.reddit.com/r/camping/\"}]. A plain string or an array of strings is rejected.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "listingSubreddits": {
            "title": "Subreddit feeds",
            "type": "array",
            "description": "Optional. Subreddits to read as a feed, written without the \"r/\" prefix (for example \"camping\"). Each subreddit is read in the order chosen in \"Feed sort\"; this does not search, so it is not limited to about 250 results like a search. Reddit gives about 1,000 posts per feed for hot and new, about 440-500 for top and controversial of all time, and about 25 for rising. Pages of 100 posts are read until Reddit has no more. Different from \"Subreddits\" above, which only narrows a keyword search. Applies to Posts, Media and Comments only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "listingSort": {
            "title": "Feed sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Order of the posts in a feed (Subreddit feeds, and Reddit page URLs that do not state a sort): hot, new, top, rising or controversial. \"top\" and \"controversial\" use \"Time range\". \"rising\" returns only a few posts (about 25) and does not exist for user pages (new is used instead).",
            "default": "new"
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only posts whose score (upvotes minus downvotes) is at least this value. Leave empty for no score filter. For Comments it filters the parent posts, not the individual comments. Applies to Posts, Media and Comments only; ignored for Communities and People."
          },
          "minUpvoteRatio": {
            "title": "Minimum upvote ratio",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Optional. Keep only posts where the share of upvotes is at least this value, from 0 to 1 (for example 0.5 means at least 50% upvoted). Leave empty for no upvote-ratio filter. For Comments it filters the parent posts. Applies to Posts, Media and Comments only; ignored for Communities and People."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only posts that have at least this many comments (Reddit's comment count of the post). Useful for finding posts people actually discussed and for dropping posts nobody answered, which saves time when you want real opinions. Leave empty for no comment filter. For Comments it filters the parent posts, so posts below the value are not opened. Applies to Posts, Media and Comments only; ignored for Communities and People."
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "description": "Reddit usernames without the \"u/\" prefix. Only posts written by these users are kept. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "titles": {
            "title": "Title contains",
            "type": "array",
            "description": "Words or phrases that must appear in the post title (for example \"camp stove\"). Multi-word phrases are matched exactly. If set, it replaces the keyword search: the keywords are then not used at all in the search, neither in the title nor in the post text. In direct mode they do not replace the keywords: all filters are applied together. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "selftexts": {
            "title": "Post text contains",
            "type": "array",
            "description": "Words or phrases that must appear in the post body text. Multi-word phrases are matched exactly. If set, it replaces the keyword search: the keywords are then not used at all in the search, neither in the title nor in the post text. In direct mode they do not replace the keywords: all filters are applied together. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "flairs": {
            "title": "Post flairs",
            "type": "array",
            "description": "Post flair labels to match (for example \"Gear Review\"). Multi-word flairs are matched exactly. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Linked domains",
            "type": "array",
            "description": "Domain names that the post links to (for example \"youtube.com\"), written without \"https://\". Only link posts can match. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Linked URL contains",
            "type": "array",
            "description": "Text that must appear in the URL the post links to. Use values without spaces. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "textPosts": {
            "title": "Text (self) posts",
            "enum": [
              "any",
              "only",
              "exclude"
            ],
            "type": "string",
            "description": "Filter by post type. \"any\" applies no filter, \"only\" keeps text-only posts, \"exclude\" keeps only posts that link elsewhere. Applies to Posts, Media and Comments only; ignored for Communities and People.",
            "default": "any"
          },
          "nsfw": {
            "title": "Adult (NSFW) content",
            "enum": [
              "any",
              "only",
              "exclude"
            ],
            "type": "string",
            "description": "Filter by adult (18+) content. \"any\" (default) applies no filter, \"only\" keeps NSFW (not safe for work) items, \"exclude\" keeps only items not marked NSFW. Applies to every content type (for Communities and People it uses the adult flag of the subreddit or profile). For Communities and People, \"any\" returns both regular and adult results, \"exclude\" drops the adult ones, and \"only\" keeps only items flagged 18+, so an ordinary keyword such as \"camping\" can return no results at all; leave it on \"any\" unless you want only adult communities or profiles.",
            "default": "any"
          },
          "maxResultsPerPage": {
            "title": "Max results per page",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Number of items requested from Reddit per page (the \"limit\" parameter of the search URL). Reddit allows at most 100. A lower value means more pages and more API requests for the same number of results, so the default 100 is best for most runs. Optional: leave empty or enter 0 to use the default (100); the maximum is 100.",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages",
            "type": "integer",
            "description": "Optional. Maximum number of result pages to fetch in TOTAL for the whole run, counted over all keywords and feeds together (not per keyword). One page holds up to \"Max results per page\" items and costs one API request. Leave empty for no page limit (paging then stops when Reddit returns no more results). Otherwise pages are fetched one after another until this total is reached; keywords that come after the limit is used up are skipped, so the first keywords can use up all pages. Reddit cuts the results off by itself (in a test with the keyword \"camping\" it returned only about 230-250 items, 3 pages). Set to 1 (or 0, which is treated as 1) to fetch only the first page of the first keyword. For People with sort hot, top, new or comments, the Actor always fetches every page up to this limit (it cannot stop early) because the best accounts can be on any page; a higher value gives a more complete sorted list but uses more requests."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}