{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper — Posts, Comments, Communities & Users",
    "description": "Scrape Reddit posts, full comment threads, communities and user profiles by community, keyword, user or URL. 179 fields per row including score, upvote ratio and flair. Export to JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "DSQnJZ05cFe84978t"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~reddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-reddit-posts-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/nice_dev~reddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-reddit-posts-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/nice_dev~reddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-reddit-posts-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": "Reddit URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Paste any Reddit URL: a community (`https://www.reddit.com/r/programming/`), a sorted feed (`https://www.reddit.com/r/news/top/`), a search results page, a user profile (`https://www.reddit.com/user/spez/`) or a single post. Each URL is scraped with its own sort and time filter when the URL carries them. Max 1 000 URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "ignoreStartUrls": {
            "title": "Ignore the URLs above",
            "type": "boolean",
            "description": "Keep the URLs saved in the form but skip them for this run, so you can try the other sources without deleting them.",
            "default": false
          },
          "subreddits": {
            "title": "Communities",
            "maxItems": 100,
            "type": "array",
            "description": "Community names without the r/ prefix, for example `programming` or `MachineLearning`. Scraped with the sort and time filter chosen below; crossed with the search terms above (max 500 searches per run). Several communities can be merged into a single faster feed with the Merge communities option.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Search term",
            "maxLength": 200,
            "type": "string",
            "description": "Search Reddit for this term. Combined with Communities it searches inside those communities only; on its own it searches the whole site. For example `web scraping` or `rust async`."
          },
          "searchQueries": {
            "title": "Search terms (several)",
            "maxItems": 100,
            "type": "array",
            "description": "Several search terms in one run. They are added to the single Search term above. Every term is crossed with every community, up to 500 searches per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "strictSearch": {
            "title": "Exact phrase only",
            "type": "boolean",
            "description": "Require the whole search term to appear as written, instead of letting Reddit match on separate words.",
            "default": false
          },
          "usernames": {
            "title": "Users",
            "maxItems": 100,
            "type": "array",
            "description": "Reddit usernames without the u/ prefix. Their posts and, when comments are enabled, their comments are collected. For example `spez` — `u/spez` and a full profile URL are accepted too.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "title": "Only these authors",
            "maxItems": 100,
            "type": "array",
            "description": "Keep only items written by these usernames, without the u/ prefix. Leave empty to keep every author. For example `spez`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Direct links to single posts. Useful to re-scrape a known list of threads with their full comment tree. For example `https://www.reddit.com/r/programming/comments/1wjjqc7/`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchPosts": {
            "title": "Return posts",
            "type": "boolean",
            "description": "Include posts in the results.",
            "default": true
          },
          "searchComments": {
            "title": "Return comments",
            "type": "boolean",
            "description": "Include comments as their own rows, with parentId and depth so you can rebuild the thread. Comments of a post are only fetched when Include comments is on.",
            "default": false
          },
          "searchCommunities": {
            "title": "Return communities",
            "type": "boolean",
            "description": "Include one row per community with its subscriber count, description and settings (its rules too with the option below).",
            "default": false
          },
          "searchUsers": {
            "title": "Return user profiles",
            "type": "boolean",
            "description": "Include one row per user profile with karma, account age and verification flags.",
            "default": false
          },
          "includeTrophies": {
            "title": "Include trophies of user profiles",
            "type": "boolean",
            "description": "On each user profile row, add its trophies (name, description, date, icon). One more request per profile.",
            "default": false
          },
          "includeRules": {
            "title": "Include rules of communities",
            "type": "boolean",
            "description": "On each community row, add its rules: the title of each (rules) and, in ruleDetails, its full text, its place in the order, what it applies to (posts, comments or all) and the reason shown when reporting it. One more request per community, charged on its own (rules-read, see Pricing).",
            "default": false
          },
          "includeStickiedPosts": {
            "title": "Include pinned posts of communities",
            "type": "boolean",
            "description": "On each community row, add the posts its moderators pinned at the top (title, id, link, author, date, score, comments). One more request per community, charged on its own (stickied-posts-read, see Pricing).",
            "default": false
          },
          "includeWiki": {
            "title": "Include wiki of communities",
            "type": "boolean",
            "description": "On each community row, add its wiki: the name of every page, and the text of up to \"Maximum wiki pages\" of them (index first). One request for the list, plus one per page read, each charged on its own (wiki-page-read, see Pricing).",
            "default": false
          },
          "maxWikiPages": {
            "title": "Maximum wiki pages per community",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "With \"Include wiki\": wiki pages whose text is read for each community, one request each. 0 = the page names only. Settings pages (sidebar, stylesheet, bots) are never read.",
            "default": 10
          },
          "maxWikiPageChars": {
            "title": "Maximum characters per wiki page",
            "minimum": 500,
            "maximum": 50000,
            "type": "integer",
            "description": "With \"Include wiki\": longest text kept for a wiki page; a longer page is cut and marked \"truncated\".",
            "default": 20000
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Order of the feed. Relevance, comments and top apply to searches; hot, new, top, rising and controversial apply to communities. A sort carried by a pasted URL wins over this setting.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only used by the Top and Controversial sorts and by searches. For any other sort, use the Posted after / Posted before filters below.",
            "default": "all"
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop the run after this many rows in total, counting posts, comments, communities and profiles. 0 means no limit.",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Maximum results per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap applied to each source separately — a community, a search term in each community, a user's posts, a user's comments, a pasted URL — so one busy source cannot eat the whole run. 0 means no per-source cap. Reddit itself stops any single feed at about 1000 posts; to go past that, split the run by sort, by time window or by search term.",
            "default": 0
          },
          "maxPosts": {
            "title": "Maximum posts",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on post rows alone, on top of Maximum results. 0 means no separate cap.",
            "default": 0
          },
          "maxComments": {
            "title": "Maximum comments",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap on comment rows for the whole run, on top of the per-post cap. 0 means no separate cap.",
            "default": 0
          },
          "maxCommunities": {
            "title": "Maximum communities",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on community rows. 0 means no separate cap.",
            "default": 0
          },
          "maxUsers": {
            "title": "Maximum user profiles",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on user profile rows. 0 means no separate cap.",
            "default": 0
          },
          "mergeSubreddits": {
            "title": "Merge communities into one feed",
            "type": "boolean",
            "description": "Ask Reddit for all the communities at once instead of one after another, when no search term is given (with one, each community is searched on its own). Much faster, with far fewer requests, but the 1000-post ceiling then applies to the merged feed as a whole, and Maximum results per source no longer separates them.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch the comment tree of every post. This costs one extra request per post and is billed as comment results.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Highest number of comments collected from a single post, replies included: 50 by default. 0 means no limit.",
            "default": 50
          },
          "maxCommentDepth": {
            "title": "Maximum reply depth",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How deep into the reply chains to go. 1 keeps only top-level comments; 10, the default, follows almost every thread to the end.",
            "default": 10
          },
          "expandMoreComments": {
            "title": "Unfold hidden comments",
            "type": "boolean",
            "description": "Also read the comments Reddit folds behind « load more comments » (one more request per 100 of them, up to 10 per post), within the comments per post above.",
            "default": false
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Order in which a post's comments are read. This decides which comments you get when Maximum comments per post cuts the tree short.",
            "default": "top"
          },
          "includeNsfw": {
            "title": "Include adult content",
            "type": "boolean",
            "description": "Keep posts and communities marked NSFW. Off by default.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "maxLength": 40,
            "type": "string",
            "description": "Keep only items published after this moment, read from the post or comment creation date. Absolute (2026-09-01 or a full ISO timestamp) or relative (7 days, 24 hours, 2 weeks). A date such as `2026-09-01`, or a period before now such as `7 days` or `24 hours`."
          },
          "postedBefore": {
            "title": "Posted before",
            "maxLength": 40,
            "type": "string",
            "description": "Keep only items published before this moment, read from the post or comment creation date. Same formats as Posted after. A date such as `2026-09-30`, or a period before now such as `2 days`."
          },
          "commentedAfter": {
            "title": "Commented after",
            "maxLength": 40,
            "type": "string",
            "description": "Applies to comment rows only, read from the comment date. Same formats as Posted after. Leave empty to date-filter posts and comments alike. A date such as `2026-09-01`, or a period before now such as `24 hours`."
          },
          "commentedBefore": {
            "title": "Commented before",
            "maxLength": 40,
            "type": "string",
            "description": "Applies to comment rows only, read from the comment date. Same formats as Posted before. A date such as `2026-09-30`, or a period before now such as `1 hour`."
          },
          "includeKeywords": {
            "title": "Must contain",
            "maxItems": 50,
            "type": "array",
            "description": "Keep an item only if its title or text contains at least one of these words. Case is ignored. For example `benchmark`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Must not contain",
            "maxItems": 50,
            "type": "array",
            "description": "Drop an item when its title or text contains any of these words. Case is ignored. For example `giveaway` or `upvote this`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "flairs": {
            "title": "Flairs",
            "maxItems": 50,
            "type": "array",
            "description": "Keep only posts carrying one of these flairs. Leave empty to keep every post. For example `Discussion` or `Show & Tell`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyWithFlair": {
            "title": "Only posts that have a flair",
            "type": "boolean",
            "description": "Drop posts with no flair at all. Independent from the Flairs list above.",
            "default": false
          },
          "onlyWithMedia": {
            "title": "Only posts with media",
            "type": "boolean",
            "description": "Keep only posts carrying an image, a gallery or a video.",
            "default": false
          },
          "excludeAuthors": {
            "title": "Exclude authors",
            "maxItems": 100,
            "type": "array",
            "description": "Usernames to skip, without the u/ prefix. Useful to drop bots and moderators. For example `AutoModerator`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeStickied": {
            "title": "Skip pinned posts",
            "type": "boolean",
            "description": "Drop the announcement posts moderators pin at the top of a community.",
            "default": false
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -1000000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only items whose score reaches this number. 0, the default, turns the filter off: comments scored below 0 are kept too. Set 1 to keep only what scores 1 or more; scores can be negative.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only posts with at least this many comments.",
            "default": 0
          },
          "minAwards": {
            "title": "Minimum awards",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Keep only items that received at least this many awards.",
            "default": 0
          },
          "skipRemoved": {
            "title": "Skip deleted and removed items",
            "type": "boolean",
            "description": "Drop posts and comments whose body is [deleted] or [removed]. Their metadata is still readable, which is why they are kept by default.",
            "default": false
          },
          "onlyNew": {
            "title": "New items only",
            "type": "boolean",
            "description": "Return only items this Actor has never returned before under the same state key. Ideal for a scheduled run that should not repeat yesterday's posts. In the order New (the default), a search stops early once it meets a long run of items already returned.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "maxLength": 64,
            "type": "string",
            "description": "Name of the memory used by New items only. Use a different key for each monitoring job so they do not share their history. For example `rust-daily`.",
            "default": "default"
          },
          "resetState": {
            "title": "Forget what was already seen",
            "type": "boolean",
            "description": "Wipe the memory of this state key before starting, so everything counts as new again.",
            "default": false
          },
          "customLabels": {
            "title": "Custom labels",
            "type": "object",
            "description": "Free key/value pairs copied onto every row, for example {\"campaign\": \"q4-launch\"}. Handy to tell several scheduled runs apart in one dataset.",
            "default": {}
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave as is. The Actor picks the right network itself and falls back automatically when a request is refused. The residential proxy is not available in this Actor: a run that asks for it stops at once.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests run at the same time. Raising it makes a run finish sooner but increases the chance of being throttled.",
            "default": 2
          },
          "maxRequestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Overall speed limit. The default is a comfortable pace; lower it if you run several jobs against Reddit at once.",
            "default": 24
          },
          "minRequestIntervalMs": {
            "title": "Min delay between requests",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Smallest gap between two requests, in milliseconds. Unlike the per-minute rate, this spreads the requests evenly instead of letting them go out in a burst. 2500 = Reddit's sustained quota of 24 requests a minute; 0 = no gap.",
            "default": 2500
          },
          "maxRequestRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "How many times a failed request is tried again before the Actor gives up on it. A request Reddit turns away is first tried again on a new IP without using up these retries, up to 10 times, as long as the run has an IP left (8 in all with the default proxy, 10 with your own).",
            "default": 5
          },
          "debugLog": {
            "title": "Verbose log",
            "type": "boolean",
            "description": "Write every request and every filtered item to the log. Turn on only when something looks wrong.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}