{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper ⚡ Advanced Data, Best Value",
    "description": "Scrape Reddit posts, comments, subreddits and user profiles from any Reddit link or keyword search. No login, no browser, flat spreadsheet-ready rows, low cost per result.",
    "version": "1.0",
    "x-build-id": "d604ah3RKLacHzpvN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/claygenius~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-claygenius-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/claygenius~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-claygenius-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/claygenius~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-claygenius-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": "Reddit URLs",
            "type": "array",
            "description": "Any Reddit link, one per line:<br>• <b>Post</b> → the post and its comments<br>• <b>Subreddit</b> (reddit.com/r/pasta, r/pasta, reddit.com/r/pasta/top/?t=week) → its posts, in the order the URL says<br>• <b>User</b> (reddit.com/user/spez) → profile, posts and comments; add /submitted or /comments for just one<br>• <b>Search page</b> copied from Reddit (reddit.com/search/?q=…) → the search results<br>• <b>Community profile</b> (reddit.com/r/pasta/about) → subscribers, description, icon<br>Short links (redd.it/…), share links (/r/…/s/…), old.reddit.com and new.reddit.com all work. Duplicates are fetched once.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search Reddit for these terms, one per line. Each term is its own search. Reddit search syntax works (\"exact phrase\", title:carbonara, author:name, -excluded). Leave empty to only use URLs.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "posts",
              "communities",
              "users"
            ],
            "type": "string",
            "description": "What the keywords should find. Posts can also have their comments scraped (section 3).",
            "default": "posts"
          },
          "searchInSubreddits": {
            "title": "Only search in these subreddits",
            "type": "array",
            "description": "Restrict the keyword search to these subreddits, e.g. pasta or r/pasta, one per line. Each keyword is searched in each subreddit separately. Empty = all of Reddit. Ignored for community and user searches.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "hot",
              "new",
              "top",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "Order for keyword searches and for subreddit URLs that don't name a sort themselves (reddit.com/r/pasta/ uses this setting; reddit.com/r/pasta/new/ always uses New). Subreddits fall back to Hot for the search-only options.",
            "default": "relevance"
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Used with the Top, Relevance and Most comments sorts, the same as the time menu on Reddit.",
            "default": "all"
          },
          "postedAfter": {
            "title": "Posted on or after",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only keep posts created on or after this date (YYYY-MM-DD, UTC). On New-sorted listings the scraper also stops paging once it reaches older posts, so this saves requests too."
          },
          "postedBefore": {
            "title": "Posted on or before",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only keep posts created on or before this date (YYYY-MM-DD, UTC)."
          },
          "minScore": {
            "title": "Minimum upvotes",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with at least this score (upvotes minus downvotes). 0 = keep everything.",
            "default": 0
          },
          "includeNsfw": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "Off = posts and communities marked 18+ are skipped.",
            "default": true
          },
          "includeComments": {
            "title": "Scrape comments",
            "type": "boolean",
            "description": "For a post URL: that post's comments. For posts found through subreddits, searches and user pages: one extra request per post. Turn off for the fastest post-only run.",
            "default": true
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Comments saved per post, in the order of the sort below (replies count too). 0 = every comment, including ones behind \"load more\" — big threads can have thousands.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "best",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Same options as the comment sort menu on Reddit. Top gives you the highest-scored comments first.",
            "default": "top"
          },
          "commentsOutput": {
            "title": "Comment layout",
            "enum": [
              "rows",
              "nested"
            ],
            "type": "string",
            "description": "Separate rows are best for spreadsheets, Clay and filtering by comment. Nested keeps one row per post with its comments inside, best for JSON and AI pipelines.",
            "default": "rows"
          },
          "maxResultsPerSource": {
            "title": "Max results per URL or search",
            "minimum": 0,
            "type": "integer",
            "description": "Posts per subreddit, search or user page (and separately, comments per user page). 0 = everything Reddit exposes, which is about 1,000 per listing.",
            "default": 50
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop once this many rows (posts + comments + communities + users) are saved across all sources. 0 = no limit. Useful as a cost cap.",
            "default": 0
          },
          "proxyConfig": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential proxies are recommended: Reddit rate-limits and blocks datacenter IPs quickly.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}