{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper — Posts, Comments, Search & Communities",
    "description": "Collect public Reddit posts, comments, subreddit details, and optional user profiles. Search by keyword or URL. Export JSON, CSV, or Excel.",
    "version": "1.0",
    "x-build-id": "UH3gTU0cBdWURYRBp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cocoa_kit~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cocoa_kit-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/cocoa_kit~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cocoa_kit-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/cocoa_kit~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cocoa_kit-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": "Enter subreddit, post, search, or public user URLs. User URLs require Include authors.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searches": {
            "title": "Search keywords",
            "type": "array",
            "description": "Each keyword starts a separate Reddit search.",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Enter community names or URLs.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Public usernames",
            "type": "array",
            "description": "Enter usernames or profile URLs. Requires Include authors.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "posts",
              "communities"
            ],
            "type": "string",
            "description": "Choose posts or communities for keyword searches.",
            "default": "posts"
          },
          "sort": {
            "title": "Post and search order",
            "enum": [
              "new",
              "hot",
              "top",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Select the result order. Relevance and Comments apply to search; subreddit lists use New for those choices.",
            "default": "new"
          },
          "time": {
            "title": "Time window",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Applies to keyword search and Top or Controversial lists.",
            "default": "all"
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "confidence",
              "new",
              "top",
              "old",
              "controversial"
            ],
            "type": "string",
            "description": "Choose the order for comments in a post.",
            "default": "confidence"
          },
          "maxItems": {
            "title": "Total result limit",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum dataset rows across all result types and targets.",
            "default": 100
          },
          "maxPosts": {
            "title": "Post limit",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum results of this type for the entire run. Zero disables this type.",
            "default": 100
          },
          "maxComments": {
            "title": "Comment limit",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum results of this type for the entire run. Zero disables this type.",
            "default": 500
          },
          "maxCommunities": {
            "title": "Community limit",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum results of this type for the entire run. Zero disables this type.",
            "default": 20
          },
          "maxUsers": {
            "title": "User limit",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum results of this type for the entire run. Zero disables this type.",
            "default": 20
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum stored comments for each post. Includes replies.",
            "default": 50
          },
          "includeComments": {
            "title": "Include post comments",
            "type": "boolean",
            "description": "Collect comments and available replies for each selected post.",
            "default": false
          },
          "includeCommunity": {
            "title": "Include community details",
            "type": "boolean",
            "description": "Add community details for subreddit targets.",
            "default": false
          },
          "includeUserPosts": {
            "title": "Include user posts",
            "type": "boolean",
            "description": "Add submitted posts for profile targets.",
            "default": true
          },
          "includeAuthors": {
            "title": "Include authors and public profiles",
            "type": "boolean",
            "description": "Explicitly enable public usernames, author IDs, and requested profile data.",
            "default": false
          },
          "includeNSFW": {
            "title": "Include adult content",
            "type": "boolean",
            "description": "Include results marked as adult content. Unknown flags remain null and do not prove that a result is safe for work.",
            "default": false
          },
          "dateFrom": {
            "title": "Created on or after",
            "type": "string",
            "description": "Optional ISO 8601 date or timestamp. Applies to posts and comments. Dates without a time mean midnight UTC.",
            "default": ""
          },
          "dateTo": {
            "title": "Created on or before",
            "type": "string",
            "description": "Optional ISO 8601 date or timestamp. Applies to posts and comments. Dates without a time mean midnight UTC.",
            "default": ""
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Exclude posts and comments below this score. A value above zero also excludes RSS rows because their scores are unavailable.",
            "default": 0
          },
          "dataMode": {
            "title": "Data mode",
            "enum": [
              "auto",
              "html",
              "json",
              "rss"
            ],
            "type": "string",
            "description": "Auto reads public web pages and can use RSS when a post or listing is restricted. Web pages include scores and comments. JSON is a legacy option and can be blocked. RSS has partial fields.",
            "default": "auto"
          },
          "proxy": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential proxies are recommended for Reddit. You can use your own proxy URLs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxConcurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum requests in progress at one time.",
            "default": 3
          },
          "requestDelayMillis": {
            "title": "Delay between requests (ms)",
            "minimum": 250,
            "maximum": 60000,
            "type": "integer",
            "description": "Minimum delay between all request starts.",
            "default": 1000
          },
          "maxRequests": {
            "title": "Request job limit",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum crawl jobs. A search job can read several post pages. Retries and fallback requests are additional network requests.",
            "default": 1000
          },
          "maxRetries": {
            "title": "Retries per job",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retry failed requests up to this many times.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for each network request.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}