{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper – Posts, Comments, Leaderboards, Search",
    "description": "All-in-one Substack scraper: full archive of any newsletter with full text, all comments with replies, top newsletters by category with subscriber counts and prices, newsletter & post search, author profiles. No login. $1.50 per 1,000 results.",
    "version": "0.1",
    "x-build-id": "QrgcfjL7jZx1zEGoQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rt-solutions~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rt-solutions-substack-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/rt-solutions~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rt-solutions-substack-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/rt-solutions~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rt-solutions-substack-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "newsletter_posts",
              "post_comments",
              "leaderboard",
              "search_newsletters",
              "search_posts",
              "profiles"
            ],
            "type": "string",
            "description": "Choose one mode, then fill the matching field below.",
            "default": "newsletter_posts"
          },
          "newsletters": {
            "title": "Newsletters",
            "type": "array",
            "description": "Newsletter URLs or names: lennysnewsletter.com, astralcodexten, https://www.platformer.news, substack.com/@handle",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Order of the archive.",
            "default": "new"
          },
          "searchInNewsletter": {
            "title": "Only posts matching",
            "type": "string",
            "description": "Optional word to search inside each newsletter's archive (e.g. pricing).",
            "default": ""
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Optional. Only posts published after this date.",
            "default": ""
          },
          "includeContent": {
            "title": "Include full text of posts",
            "type": "boolean",
            "description": "Full text + HTML of free posts. Paid posts only have a public preview.",
            "default": true
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "e.g. https://www.astralcodexten.com/p/your-book-review-storm-of-steel",
            "items": {
              "type": "string"
            }
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "best",
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Order of comments.",
            "default": "best"
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "type": "integer",
            "description": "Replies included.",
            "default": 500
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Substack leaderboard categories.",
            "items": {
              "type": "string",
              "enum": [
                "technology",
                "business",
                "finance",
                "culture",
                "us-politics",
                "world-politics",
                "health-politics",
                "news",
                "science",
                "health",
                "crypto",
                "education",
                "history",
                "philosophy",
                "literature",
                "fiction",
                "music",
                "film-and-tv",
                "art",
                "design",
                "food",
                "travel",
                "sports",
                "games",
                "fashionandbeauty",
                "parenting",
                "faith",
                "climate",
                "comics",
                "humor",
                "international",
                "home-garden",
                "podcast"
              ],
              "enumTitles": [
                "Technology",
                "Business",
                "Finance",
                "Culture",
                "U.S. Politics",
                "World Politics",
                "Health Politics",
                "News",
                "Science",
                "Health & Wellness",
                "Crypto",
                "Education",
                "History",
                "Philosophy",
                "Literature",
                "Fiction",
                "Music",
                "Film & TV",
                "Art & Illustration",
                "Design",
                "Food & Drink",
                "Travel",
                "Sports",
                "Games",
                "Fashion & Beauty",
                "Parenting",
                "Faith & Spirituality",
                "Climate & Environment",
                "Comics",
                "Humor",
                "International",
                "Home & Garden",
                "Podcasts"
              ]
            },
            "default": [
              "technology"
            ]
          },
          "ranking": {
            "title": "Leaderboard",
            "enum": [
              "trending",
              "bestseller"
            ],
            "type": "string",
            "description": "Which Substack leaderboard.",
            "default": "trending"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "For 'Search newsletters' and 'Search posts', e.g. artificial intelligence, personal finance.",
            "items": {
              "type": "string"
            }
          },
          "profiles": {
            "title": "Profile handles",
            "type": "array",
            "description": "Handles or URLs: scottalexander, substack.com/@handle",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per newsletter / category / keyword",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many results for each item of your list.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy is used by default.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}