{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Historical Archive Scraper",
    "description": "Access 10+ years of archived Reddit posts and comments via PullPush. Full-text comment search (Reddit can't do this). No login, no proxy. $0.001/item.",
    "version": "0.0",
    "x-build-id": "8eVODXMqjrgJchNYp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/logiover~reddit-historical-archive-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-logiover-reddit-historical-archive-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/logiover~reddit-historical-archive-scraper/runs": {
      "post": {
        "operationId": "runs-sync-logiover-reddit-historical-archive-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/logiover~reddit-historical-archive-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-logiover-reddit-historical-archive-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "List of subreddit names to scrape (no /r/ prefix needed). Each runs as a listing scrape using the global `sort` setting. Example: ['programming', 'webdev', 'startups']",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postIds": {
            "title": "Post IDs",
            "type": "array",
            "description": "Reddit post IDs (the alphanumeric piece in /comments/XXXX/). Each post is fetched along with its full comment tree. Example: ['1abc234', '5xyz678']",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames to scrape (no /u/ prefix needed). Returns the user's profile plus their submitted posts and/or comments based on `userContent`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Post Search Queries",
            "type": "array",
            "description": "Free-text search queries. Searches across all of Reddit unless `restrictToSubreddit` is set. Returns posts, subreddits, or users based on `searchType`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subredditSearch": {
            "title": "Subreddit Discovery Queries",
            "type": "array",
            "description": "Find subreddits by keyword. Returns metadata for all matching subreddits (name, subscribers, description, NSFW flag, etc). Different from `searchQueries` — this is specifically for finding communities, not posts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs (auto-detected)",
            "type": "array",
            "description": "Any Reddit URL — subreddit, post, user, or search. The scraper auto-detects the type and scrapes accordingly. Most flexible way to add targets. Mix and match URL types in one input.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Subreddit Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "best"
            ],
            "type": "string",
            "description": "How to sort subreddit listings.",
            "default": "hot"
          },
          "timeframe": {
            "title": "Timeframe (for top/controversial)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window when sorting by `top` or `controversial`.",
            "default": "all"
          },
          "userContent": {
            "title": "User Content Type",
            "enum": [
              "overview",
              "submitted",
              "comments",
              "about"
            ],
            "type": "string",
            "description": "When scraping users, choose what to return after the profile: their posts, their comments, both, or just profile metadata.",
            "default": "overview"
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "link",
              "sr",
              "user"
            ],
            "type": "string",
            "description": "What to return from a search query.",
            "default": "link"
          },
          "searchSort": {
            "title": "Search Sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "How to rank search results.",
            "default": "relevance"
          },
          "restrictToSubreddit": {
            "title": "Restrict Search to Subreddit",
            "type": "string",
            "description": "Limit `searchQueries` to a single subreddit. Leave blank for global Reddit-wide search.",
            "default": null
          },
          "maxItems": {
            "title": "Max Items (Global)",
            "minimum": 0,
            "type": "integer",
            "description": "Total cap across ALL targets in this run. Hard ceiling — run stops when reached. `0` = unlimited.",
            "default": 1000
          },
          "maxItemsPerTarget": {
            "title": "Max Items Per Target",
            "minimum": 0,
            "type": "integer",
            "description": "Cap per subreddit / post / user / search. Prevents one big target from consuming the entire budget.",
            "default": 200
          },
          "expandComments": {
            "title": "Expand 'More Comments' Placeholders",
            "type": "boolean",
            "description": "When scraping posts, automatically call Reddit's /api/morechildren endpoint to fetch comments hidden behind 'load more' links. Doubles the data on heavily-commented posts.",
            "default": true
          },
          "maxCommentDepth": {
            "title": "Max Comment Depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How deep to follow nested reply chains. Reddit's natural max is ~10. Lower this if you only care about top-level discussion.",
            "default": 10
          },
          "includeComments": {
            "title": "Include Comments in Subreddit Runs",
            "type": "boolean",
            "description": "When scraping subreddit listings, ALSO fetch the full comment tree for each post. Massively increases data volume — use only when you genuinely need comments alongside posts.",
            "default": false
          },
          "requestDelayMs": {
            "title": "Request Delay (ms)",
            "minimum": 100,
            "type": "integer",
            "description": "Milliseconds between requests. Reddit's anonymous limit is ~60/min — 1500ms (default) is safe. Lower at your own risk.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Max Retries on 429/5xx",
            "minimum": 0,
            "type": "integer",
            "description": "How many times to retry a rate-limited or failed request with exponential backoff.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}