{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Comments Scraper",
    "description": "Scrape Reddit comments: full threads, keyword search inside comments, community feeds and user history. Export to JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "Te08eD9cO1hOJxwua"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~reddit-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-reddit-comments-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-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-reddit-comments-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-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-reddit-comments-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": {
          "postUrls": {
            "title": "Post and comment links",
            "maxItems": 1000,
            "type": "array",
            "description": "Reddit posts whose comments you want, one per line: a post link (`https://www.reddit.com/r/AskReddit/comments/1wrj0s2/`), a short `redd.it` link, a bare post id (`t3_1wrj0s2` or `1wrj0s2`), or the link of a single comment (that comment and its replies). Each post is read as a full thread, replies included. Max 1 000 links.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Any Reddit URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Paste any Reddit URL, or upload a text file with one link per line to load a long list at once: a post (its comments), a community (`https://www.reddit.com/r/programming/`), a user profile (`https://www.reddit.com/user/spez/`) or a search page (its search term is searched in the comments). Max 1 000 URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "query": {
            "title": "Search term",
            "maxLength": 200,
            "type": "string",
            "description": "Search INSIDE the comments of all Reddit for this word or phrase, for example `web scraping` or `rust async`. Combined with Communities, it searches inside those communities only."
          },
          "searchQueries": {
            "title": "Search terms (several)",
            "maxItems": 100,
            "type": "array",
            "description": "Several search terms in one run, added to the single Search term above. Every term is crossed with every community, up to 500 searches per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchSorts": {
            "title": "Search orders",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Reddit stops one comment search after about 250 results for each term and order. Tick several orders to get more: their results are added together and each comment is kept once, which gives up to about 750 comments per term with the three orders (578 comments on a very active term: the orders share many).",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "relevance",
                "top"
              ],
              "enumTitles": [
                "New",
                "Relevance",
                "Top"
              ]
            },
            "default": [
              "new",
              "relevance",
              "top"
            ]
          },
          "strictSearch": {
            "title": "Exact phrase only",
            "type": "boolean",
            "description": "Require the whole search term to appear in the comment as written, instead of letting Reddit match on separate words.",
            "default": false
          },
          "subreddits": {
            "title": "Communities",
            "maxItems": 100,
            "type": "array",
            "description": "Community names without the r/ prefix, for example `programming` or `MachineLearning`. With a search term, each community is searched on its own (max 500 searches per run). Without one, the comments are read the way \"Comments of a community\" below says.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subredditSource": {
            "title": "Comments of a community",
            "enum": [
              "latestComments",
              "postThreads"
            ],
            "type": "string",
            "description": "Only used for Communities given without a search term. Latest comments reads the live comment feed of each community (Reddit keeps about the last 1 000). Comments of its posts opens the threads of the posts picked by Sort and Time window and reads them in full.",
            "default": "latestComments"
          },
          "sort": {
            "title": "Post sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Only used with \"Comments of its posts\": which posts of each community have their thread read. A sort carried by a pasted community URL wins over this setting.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Post time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only used with \"Comments of its posts\" and the Top or Controversial post sort. To keep comments of a given period, use the Posted after / Posted before filters below.",
            "default": "all"
          },
          "maxThreadsPerSubreddit": {
            "title": "Threads per community",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Only used with \"Comments of its posts\": how many posts of each community have their thread read.",
            "default": 25
          },
          "minComments": {
            "title": "Minimum comments of a post",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only used with \"Comments of its posts\": skip posts with fewer comments than this. 0 keeps every post.",
            "default": 0
          },
          "usernames": {
            "title": "Users",
            "maxItems": 100,
            "type": "array",
            "description": "Reddit usernames without the u/ prefix: the comment history of each account, newest first (Reddit keeps about the last 1 000). For example `spez` — `u/spez` and a full profile URL are accepted too.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop the run after this many rows in total, comments and post rows together. 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 post, a search term in each community, a community, a user, a pasted URL — so one busy source cannot eat the whole run. 0 means no per-source cap.",
            "default": 0
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Highest number of comments collected from a single post, replies included. 0, the default, reads the whole thread.",
            "default": 0
          },
          "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 », so a big thread comes out complete (one more request per group of about 10 of them, up to 200 per post, within the comments per post above). Turn off for a faster run that skips the folded part.",
            "default": true
          },
          "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 or Maximum results cuts the thread short. Q&A suits AMAs.",
            "default": "top"
          },
          "includePosts": {
            "title": "Include posts",
            "type": "boolean",
            "description": "Add one row for each post whose thread is read, next to its comments (dataType post). Every comment already carries its post's title, author, score and link, so leave this off unless you want the post rows themselves. Post rows count in Maximum results and are charged on their own (post-scraped, see Pricing).",
            "default": false
          },
          "includeNsfw": {
            "title": "Include adult content",
            "type": "boolean",
            "description": "Keep comments from communities and posts marked NSFW. Off by default.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "maxLength": 40,
            "type": "string",
            "description": "Keep only comments written after this moment, read from the comment's own 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 comments written before this moment, read from the comment's own creation date. Same formats as Posted after; a date alone keeps that whole day (UTC): `2026-09-30` keeps what was written on the 30th. A period before now such as `2 days` counts back from the start of the run."
          },
          "includeKeywords": {
            "title": "Must contain",
            "maxItems": 50,
            "type": "array",
            "description": "Keep a comment only if its 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 a comment when its text contains any of these words. Case is ignored. For example `giveaway` or `upvote this`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -1000000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only comments 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
          },
          "authors": {
            "title": "Only these authors",
            "maxItems": 100,
            "type": "array",
            "description": "Keep only comments written by these usernames, without the u/ prefix. Leave empty to keep every author. For example `spez`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "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"
            }
          },
          "onlySubmitter": {
            "title": "Only the post's author",
            "type": "boolean",
            "description": "Keep only the comments written by the author of the post they belong to, for example the answers of an AMA host.",
            "default": false
          },
          "opReplyFilter": {
            "title": "Replies from the post's author",
            "enum": [
              "any",
              "answered",
              "unanswered"
            ],
            "type": "string",
            "description": "Judged on top-level comments, from the replies of the thread: Answered keeps the top-level comments the author of the post replied to, Not answered keeps those that got no reply from them. Useful to find questions that stayed open.",
            "default": "any"
          },
          "skipRemoved": {
            "title": "Skip deleted and removed comments",
            "type": "boolean",
            "description": "Drop comments whose text is [deleted] or [removed]: they carry no text, so they are not saved and not charged (a free filter, no extra charge). Turn off to keep them with their metadata.",
            "default": true
          },
          "onlyNew": {
            "title": "New comments only",
            "type": "boolean",
            "description": "Return only comments this Actor has never returned before under the same state key, whatever the source. Ideal for a scheduled run that should not repeat yesterday's comments. For a feed or a search read newest first, the run stops early once it meets a long run of comments 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 comments 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. The pace of a run is set by \"Min delay between requests\" (2500 ms by default, one request every 2.5 seconds whatever this number is): raising this one alone does not make a run finish sooner, lower the delay too. More requests at the same time increase 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 comment 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}