{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & Users",
    "description": "Scrape Reddit posts, comments, subreddits, users, activity, and search through 32 API endpoints with automatic pagination and structured Dataset output. Powered by Titan Network.",
    "version": "0.1",
    "x-build-id": "pnxRx1n1f4OeVY1Js"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/titan_network~dataclawd-reddit-data-collector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-titan_network-dataclawd-reddit-data-collector",
        "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/titan_network~dataclawd-reddit-data-collector/runs": {
      "post": {
        "operationId": "runs-sync-titan_network-dataclawd-reddit-data-collector",
        "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/titan_network~dataclawd-reddit-data-collector/run-sync": {
      "post": {
        "operationId": "run-sync-titan_network-dataclawd-reddit-data-collector",
        "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": {
          "task": {
            "title": "采集任务 / Collection task",
            "enum": [
              "popular",
              "subredditHot",
              "subredditNew",
              "subredditTop",
              "postDetail",
              "postComments",
              "search",
              "searchSubreddits",
              "searchUsers",
              "userProfile",
              "userPosts",
              "userComments"
            ],
            "type": "string",
            "description": "要采集的 Reddit 数据场景。选一个即可，Actor 会自动映射到对应端点；参数填在下方对应字段（subreddit/username/article/q 等）。留空则须在「高级选项」里手动指定 endpoint。 / The Reddit data scenario to collect. Pick one and the Actor maps it to the corresponding endpoint; fill in the related fields below (subreddit/username/article/q, etc.). Leave empty to manually specify the endpoint under Advanced options."
          },
          "endpoint": {
            "title": "采集端点 / Collection endpoint",
            "enum": [
              "auto",
              "postDetail",
              "postComments",
              "postDuplicates",
              "popular",
              "popularBest",
              "popularCountry",
              "popularRising",
              "popularTop",
              "search",
              "searchSubreddits",
              "searchUsers",
              "subredditHot",
              "subredditNew",
              "subredditTop",
              "subredditAbout",
              "subredditComments",
              "subredditControversial",
              "subredditPosts",
              "subredditRules",
              "subredditSimilar",
              "subredditsNew",
              "subredditsPopular",
              "userAbout",
              "userActivity",
              "userComments",
              "userCommentsTop",
              "userOverview",
              "userPosts",
              "userPostsHot",
              "userPostsNew",
              "userPostsTop",
              "userProfile"
            ],
            "type": "string",
            "description": "高级选项：默认 auto（按「采集任务 task」自动选择端点）；也可手动指定具体端点覆盖 task。 / Advanced options: default auto (selects the endpoint automatically based on the collection task); you can also manually specify an endpoint to override task.",
            "default": "auto"
          },
          "subreddit": {
            "title": "Subreddit 名称 / Subreddit name",
            "type": "string",
            "description": "subreddit 名称（不要带 r/ 前缀），例如 java。subreddit* 与 postDetail 端点需要。 / Subreddit name (without the r/ prefix), e.g. java. Required by subreddit* and postDetail endpoints."
          },
          "username": {
            "title": "Reddit 用户名 / Reddit username",
            "type": "string",
            "description": "Reddit 用户名（不要带 u/ 前缀），例如 elonmusk。user* 端点需要。 / Reddit username (without the u/ prefix), e.g. elonmusk. Required by user* endpoints."
          },
          "article": {
            "title": "帖子 ID / Post ID",
            "type": "string",
            "description": "帖子 ID（postDetail 端点必填，评论区路径中的 ID），例如 1b7abcd。 / Post ID (required by the postDetail endpoint; the ID in the comments path), e.g. 1b7abcd."
          },
          "after": {
            "title": "起始游标 / Starting cursor",
            "type": "string",
            "description": "Reddit 分页游标（如 t3_1b7abcd），从指定位置开始。留空从第一页开始。 / Reddit pagination cursor (e.g. t3_1b7abcd) to start from that position. Leave empty to start from the first page."
          },
          "limit": {
            "title": "每页条数 / Items per page",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "每页返回条数，最大 100。 / Number of items returned per page, up to 100.",
            "default": 25
          },
          "t": {
            "title": "时间范围 / Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "top 端点的时间过滤：hour / day / week / month / year / all。留空使用服务端默认。 / Time filter for top endpoints: hour / day / week / month / year / all. Leave empty for the server default."
          },
          "targets": {
            "title": "目标列表（可选） / Target list (optional)",
            "type": "array",
            "description": "批量采集：每个元素是一组参数（覆盖上面各字段），Actor 会逐个目标采集。例如 [{\"subreddit\":\"java\"},{\"subreddit\":\"python\"}]。 / Batch collection: each element is a set of parameters (overriding the fields above); the Actor collects each target one by one. For example [{\"subreddit\":\"java\"},{\"subreddit\":\"python\"}].",
            "items": {
              "type": "object"
            }
          },
          "proxyUrl": {
            "title": "代理 URL（可选） / Proxy URL (optional)",
            "type": "string",
            "description": "Dataclawd 服务端请求 Reddit 时使用的代理地址。 / The proxy address used by the Dataclawd server when requesting Reddit."
          },
          "httpMethod": {
            "title": "请求方法 / HTTP method",
            "enum": [
              "POST",
              "GET"
            ],
            "type": "string",
            "description": "调用 Dataclawd 端点使用的 HTTP 方法（Reddit 端点在 Dataclawd 后端仅支持 GET，POST 会返回 501）。 / HTTP method used to call the Dataclawd endpoint (the Dataclawd backend only supports GET for Reddit endpoints; POST returns 501).",
            "default": "GET"
          },
          "maxItems": {
            "title": "最多采集条数 / Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "整个运行最多写入 Dataset 的条目数，达到即停止。 / Maximum number of items written to the Dataset for the whole run; stop once reached.",
            "default": 100
          },
          "maxPages": {
            "title": "每目标最多页数 / Max pages per target",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "每个目标最多翻页次数（防止无限翻页）。 / Maximum number of pages per target (to prevent infinite pagination).",
            "default": 10
          },
          "startCursor": {
            "title": "起始游标（可选，等价 after） / Starting cursor (optional, same as after)",
            "type": "string",
            "description": "从指定游标开始翻页（续采上次未完成的数据）。留空从第一页开始。 / Start pagination from the given cursor (to continue previously unfinished data). Leave empty to start from the first page."
          },
          "itemsPath": {
            "title": "条目提取路径（可选） / Items path (optional)",
            "type": "string",
            "description": "点号路径，指定响应中条目列表的位置，例如 data.children。留空则自动探测（Reddit Listing 的 children 会被自动解包）。 / Dot-separated path to the item list in the response, e.g. data.children. Leave empty to auto-detect (the children of a Reddit Listing are unwrapped automatically)."
          },
          "nextCursorPath": {
            "title": "下一页游标路径（可选） / Next page cursor path (optional)",
            "type": "string",
            "description": "点号路径，指定响应中下一页游标的位置。留空自动探测（优先 data.after）。 / Dot-separated path to the next-page cursor in the response. Leave empty to auto-detect (data.after is preferred)."
          },
          "paginationParam": {
            "title": "分页参数 / Pagination parameter",
            "enum": [
              "auto",
              "after",
              "cursor",
              "none"
            ],
            "type": "string",
            "description": "翻页时使用的查询参数：auto 按端点自动选择（默认 after）；cursor 用于 X 风格分页；none 不翻页。 / Query parameter used for pagination: auto selects by endpoint (default after); cursor is for X-style pagination; none disables pagination.",
            "default": "auto"
          },
          "q": {
            "title": "搜索关键词 / Search keyword",
            "type": "string",
            "description": "search 系列端点必填，例如 spring boot。 / Required by search* endpoints, e.g. spring boot."
          },
          "sort": {
            "title": "排序 / Sort",
            "type": "string",
            "description": "popular/post 评论的排序：hot / new / top / rising / best（popular）；confidence / top / new / controversial / old / random / qa / live（评论）。 / Sorting for popular/post comments: hot / new / top / rising / best (popular); confidence / top / new / controversial / old / random / qa / live (comments)."
          },
          "country": {
            "title": "国家代码 / Country code",
            "type": "string",
            "description": "popular/country 端点的国家/地区过滤（ISO 国家代码），例如 US / GB / DE。 / Country/region filter for popular/country endpoints (ISO country code), e.g. US / GB / DE."
          },
          "restrictSr": {
            "title": "限定 Subreddit 搜索 / Restrict subreddit search",
            "type": "string",
            "description": "search 端点：restrictSr=true 时只在 subreddit 内搜索。 / For search endpoints: when restrictSr=true, search only within the subreddit."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}