{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper: Newsletter Posts, Likes & Comments",
    "description": "Scrape posts from any Substack newsletter (subdomain or custom domain): title, subtitle, date, authors, likes, comments, wordcount, paid/free and full text of free posts. Date range, category discovery and a new-posts monitor mode.",
    "version": "1.0",
    "x-build-id": "OfKDxJHUCNVT79oCF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sysco32~substack-newsletter-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sysco32-substack-newsletter-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/sysco32~substack-newsletter-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sysco32-substack-newsletter-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/sysco32~substack-newsletter-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sysco32-substack-newsletter-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",
        "required": [
          "publications"
        ],
        "properties": {
          "publications": {
            "title": "Substack publications or post URLs",
            "type": "array",
            "description": "One per line. Accepted forms:<br>• A subdomain: <code>noahpinion</code><br>• A Substack URL: <code>https://astralcodexten.substack.com</code><br>• A custom domain: <code>https://www.lennysnewsletter.com</code><br>• A single post URL: <code>https://www.lennysnewsletter.com/p/some-post</code> or <code>https://open.substack.com/pub/name/p/some-post</code><br>• An author profile: <code>@lenny</code> or <code>https://substack.com/@lenny</code> (uses the author's main publication)<br>Only public data is read; no login is used.",
            "default": [
              "https://www.lennysnewsletter.com",
              "astralcodexten.substack.com",
              "noahpinion"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 0,
            "type": "integer",
            "description": "Newest-first. Set 0 to get the whole archive (respects the date range).",
            "default": 10
          },
          "dateFrom": {
            "title": "Published on or after",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}.*$|^\\d+\\s*(day|week|month|year)s?(\\s+ago)?$",
            "type": "string",
            "description": "Absolute date <code>2026-01-01</code> or relative like <code>30 days</code>, <code>2 weeks</code>, <code>6 months</code>. Leave empty for no lower limit."
          },
          "dateTo": {
            "title": "Published on or before",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}.*$|^\\d+\\s*(day|week|month|year)s?(\\s+ago)?$",
            "type": "string",
            "description": "Absolute date <code>2026-06-30</code> or relative like <code>7 days</code>. Leave empty for no upper limit."
          },
          "audience": {
            "title": "Post access",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Filter by audience. For paid posts only the public preview text is returned.",
            "default": "all"
          },
          "includeContent": {
            "title": "Include post content",
            "type": "boolean",
            "description": "Fetch each post's body as plain text (and HTML). Free posts: full text. Paywalled posts: only the public preview that Substack shows to logged-out readers. Turn off for faster metadata-only runs (title, date, likes, comments, wordcount, …).",
            "default": true
          },
          "includeHtml": {
            "title": "Include HTML body",
            "type": "boolean",
            "description": "Also store <code>content_html</code> (only when content is included).",
            "default": true
          },
          "onlyNewPosts": {
            "title": "Only new posts (monitor mode)",
            "type": "boolean",
            "description": "Output only posts that previous runs have not output yet. Each run checks the latest posts (up to <b>Max posts per publication</b>) and remembers what it has seen in a named key-value store. Schedule the Actor to get a feed of new posts; you only pay for new ones.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that remembers seen posts. Use different names for independent monitors.",
            "default": "substack-scraper-seen"
          },
          "discoverCategory": {
            "title": "Discover publications by category",
            "enum": [
              "none",
              "technology",
              "business",
              "finance",
              "culture",
              "us-politics",
              "world-politics",
              "news",
              "science",
              "health",
              "crypto",
              "food",
              "sports",
              "music",
              "art",
              "fiction",
              "literature",
              "history",
              "philosophy",
              "education",
              "design",
              "climate",
              "faith",
              "parenting",
              "travel",
              "humor",
              "comics",
              "fashionandbeauty",
              "film-and-tv",
              "games",
              "home-garden",
              "international",
              "health-politics",
              "podcast"
            ],
            "type": "string",
            "description": "Optionally add the top publications of a Substack category (from Substack's public directory) to the list above.",
            "default": "none"
          },
          "maxDiscoveredPublications": {
            "title": "Max publications to discover",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many top publications to take from the chosen category.",
            "default": 10
          },
          "maxConcurrency": {
            "title": "Publications in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many publications are scraped at the same time. Requests to any single site are still throttled.",
            "default": 4
          },
          "requestIntervalSecs": {
            "title": "Min seconds between requests to one site",
            "minimum": 0.2,
            "maximum": 10,
            "type": "number",
            "description": "Politeness delay per host. Requests are also retried with backoff on HTTP 429/5xx.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}