{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Posts Scraper · Full comment trees · $0.3/1K",
    "description": "Collect Reddit posts and full comment threads from post links or keyword searches for sentiment analysis, community research and LLM datasets. Returns text, scores, timestamps, reply depth and parent IDs. $0.3/1K rows.",
    "version": "0.1",
    "x-build-id": "zYGdj9kKaNIDhZEwy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mlg14~reddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mlg14-reddit-posts-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/mlg14~reddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mlg14-reddit-posts-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/mlg14~reddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mlg14-reddit-posts-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": {
          "postUrl": {
            "title": "Post URL or ID",
            "type": "string",
            "description": "One public Reddit post URL, redd.it short link or bare post ID. Example: 1k2vnz0 or https://www.reddit.com/comments/1k2vnz0. Use for a single thread.",
            "default": "1k2vnz0"
          },
          "postUrls": {
            "title": "Post URLs or IDs",
            "type": "array",
            "description": "Several Reddit post URLs or IDs to collect in one run. Example: [\"1k2vnz0\"]. Use for batches; leave empty when using postUrl or queries.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "postUrlsFile": {
            "title": "Post URL file",
            "type": "string",
            "description": "HTTPS URL of a TXT file with one post per line, or a CSV with a url or permalink column, up to 5 MB. Example: https://example.com/posts.txt. Leave empty to use postUrls."
          },
          "queries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to find archived public Reddit posts when no URLs are given. Not a search of all Reddit: only the 3 subreddits whose names best match the words (by subscribers) are searched, so use post URLs for exact results. Example: [\"best budget laptop\"]. Use for topic research; leave empty when providing post URLs.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxPostsPerQuery": {
            "title": "Posts per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum matching posts per keyword in queries, an integer. Example: 25. Use a small value for quick runs.",
            "default": 25
          },
          "sort": {
            "title": "Comment order",
            "enum": [
              "best",
              "top",
              "new",
              "old",
              "controversial",
              "qa"
            ],
            "type": "string",
            "description": "Comment order. Allowed values: best, top, new, old, controversial, qa. Example: top. Use top for the most upvoted comments. Best approximates by score; qa puts original-poster comments first.",
            "default": "best"
          },
          "filter": {
            "title": "Q&A filter",
            "enum": [
              "",
              "answered",
              "unanswered"
            ],
            "type": "string",
            "description": "Keep only threads answered or unanswered by the original poster. Allowed values: answered, unanswered, or empty for all threads. Example: unanswered. Use it to find open questions.",
            "default": ""
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum comment rows per post, an integer. Example: 100. Set 0 to keep all scanned comments.",
            "default": 200
          },
          "expandAllComments": {
            "title": "Scan extended archive",
            "type": "boolean",
            "description": "Scan up to 10,000 archived comments per post before sorting and filtering, true or false. Example: true for very large threads. Leave false for fast runs.",
            "default": false
          },
          "maxScanPerPost": {
            "title": "Archive scan limit",
            "minimum": 100,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum comments scanned per post before sorting, an integer. Example: 1000. Raise it for big threads; extended scan lifts it to at least 10,000. Leave the default otherwise.",
            "default": 1000
          },
          "maxItems": {
            "title": "Total result limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum combined post and comment rows for the run, an integer. Example: 100. Set 0 for no output cap.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}