{
  "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": "U2XVKVgCq3mpPiFU4"
  },
  "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": "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": "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 name",
            "type": "string",
            "description": "Subreddit name (without the r/ prefix), e.g. java. Required by subreddit* and postDetail endpoints."
          },
          "username": {
            "title": "Reddit username",
            "type": "string",
            "description": "Reddit username (without the u/ prefix), e.g. elonmusk. Required by user* endpoints."
          },
          "article": {
            "title": "Post ID",
            "type": "string",
            "description": "Post ID (required by the postDetail endpoint; the ID in the comments path), e.g. 1b7abcd."
          },
          "after": {
            "title": "Starting cursor",
            "type": "string",
            "description": "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": "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": "month / year / all. Leave empty for the server default."
          },
          "targets": {
            "title": "Target list (optional)",
            "type": "array",
            "description": "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": "Proxy URL (optional)",
            "type": "string",
            "description": "The proxy address used by the Dataclawd server when requesting Reddit."
          },
          "httpMethod": {
            "title": "HTTP method",
            "enum": [
              "POST",
              "GET"
            ],
            "type": "string",
            "description": "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": "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": "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": "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": "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": "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": "Required by search* endpoints, e.g. spring boot."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "controversial / old / random / qa / live (comments)."
          },
          "country": {
            "title": "Country code",
            "type": "string",
            "description": "Country/region filter for popular/country endpoints (ISO country code), e.g. US / GB / DE."
          },
          "restrictSr": {
            "title": "Restrict subreddit search",
            "type": "string",
            "description": "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}