{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper: Newsletters, Subscribers & Posts",
    "description": "Scrape Substack without login: keyword search across Substack, newsletters with subscriber counts, prices and contact emails, posts with full text as Markdown, comments, Notes and subscriber growth between runs.",
    "version": "0.1",
    "x-build-id": "b255ZA7boaWw5JSbO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smoldesk~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smoldesk-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/smoldesk~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-smoldesk-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/smoldesk~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-smoldesk-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": {
          "publications": {
            "title": "Newsletters",
            "type": "array",
            "description": "Substack subdomains or newsletter URLs, e.g. lenny, pomp.substack.com or https://www.lennysnewsletter.com (custom domains work). Leave empty when you only want categories.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Discover by category",
            "type": "array",
            "description": "Find newsletters from Substack's category leaderboards.",
            "items": {
              "type": "string",
              "enum": [
                "culture",
                "technology",
                "business",
                "us-politics",
                "finance",
                "food-drink",
                "sports",
                "art-illustration",
                "world-politics",
                "health-politics",
                "news",
                "fashion-beauty",
                "music",
                "faith-spirituality",
                "climate-environment",
                "science",
                "literature",
                "fiction",
                "health-wellness",
                "design",
                "travel",
                "parenting",
                "philosophy",
                "comics",
                "international",
                "crypto",
                "history",
                "humor",
                "education",
                "film-tv",
                "home-garden",
                "games"
              ],
              "enumTitles": [
                "Culture",
                "Technology",
                "Business",
                "U.S. Politics",
                "Finance",
                "Food & Drink",
                "Sports",
                "Art & Illustration",
                "World Politics",
                "Health Politics",
                "News",
                "Fashion & Beauty",
                "Music",
                "Faith & Spirituality",
                "Climate & Environment",
                "Science",
                "Literature",
                "Fiction",
                "Health & Wellness",
                "Design",
                "Travel",
                "Parenting",
                "Philosophy",
                "Comics",
                "International",
                "Crypto",
                "History",
                "Humor",
                "Education",
                "Film & TV",
                "Home & Garden",
                "Games"
              ]
            }
          },
          "maxPublicationsPerCategory": {
            "title": "Max newsletters per category",
            "minimum": 1,
            "type": "integer",
            "description": "How many newsletters to take from each category.",
            "default": 50
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search all of Substack like the search box on substack.com. Matching posts come back as rows (type 'post', with 'searchQuery'). Example: 'artificial intelligence', 'newsletter growth'.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Max results per keyword",
            "minimum": 0,
            "type": "integer",
            "description": "Posts per keyword (and the same number of Notes when Notes are on). 0 = as many as Substack returns.",
            "default": 20
          },
          "searchNotes": {
            "title": "Include Notes in search",
            "type": "boolean",
            "description": "Also save the Substack Notes that match each keyword (type 'note').",
            "default": false
          },
          "scrapeFoundPublications": {
            "title": "Scrape the newsletters found by search",
            "type": "boolean",
            "description": "Also return a newsletter row (subscribers, prices, contacts, stats) for every newsletter the search turns up, plus its posts if 'Include posts' is on. Can add many rows: check your Max cost per run.",
            "default": false
          },
          "notesFrom": {
            "title": "Notes from profiles",
            "type": "array",
            "description": "Substack handles or profile links (e.g. 'lenny' or 'https://substack.com/@lenny'). Returns their latest Notes (type 'note').",
            "items": {
              "type": "string"
            }
          },
          "maxNotesPerProfile": {
            "title": "Max Notes per profile",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all.",
            "default": 20
          },
          "enrichPublications": {
            "title": "Get subscriber counts & prices",
            "type": "boolean",
            "description": "Visit each newsletter's homepage for subscriber count, paid tier label, plan prices and author socials.",
            "default": true
          },
          "includePosts": {
            "title": "Include posts",
            "type": "boolean",
            "description": "Return posts with likes, comments, restacks, word count and authors. Charged per post.",
            "default": true
          },
          "maxPostsPerPublication": {
            "title": "Max posts per newsletter",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. 0 = all posts.",
            "default": 20
          },
          "postsSince": {
            "title": "Posts published after",
            "type": "string",
            "description": "Stop at posts older than this date (YYYY-MM-DD)."
          },
          "includePostContent": {
            "title": "Include full post text",
            "type": "boolean",
            "description": "Add full HTML and clean text of each post (paid posts return the free preview only).",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Save the comments and replies under each post as separate rows (type 'comment'), with author, likes, reactions and thread position. Paid-only comment sections are skipped.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Comments and replies counted together. 0 = all.",
            "default": 50
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "best",
              "newest"
            ],
            "type": "string",
            "description": "Which comments come first when Max comments per post cuts the list.",
            "default": "best"
          },
          "includeLikers": {
            "title": "Add who liked each post",
            "type": "boolean",
            "description": "Add a 'likers' list to each post: name, their own newsletter and bestseller tier. One extra request per post, no extra charge.",
            "default": false
          },
          "trackSubscribers": {
            "title": "Track subscriber changes between runs",
            "type": "boolean",
            "description": "Remember each newsletter's subscriber numbers and add the previous values and the change since your last run. Schedule the Actor to build a growth history.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Newsletters in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many newsletters to scrape at the same time.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed. Enable for very large runs.",
            "default": {
              "useApifyProxy": false
            }
          },
          "compact": {
            "title": "Compact output (for AI agents)",
            "type": "boolean",
            "description": "Return smaller rows: only the main fields from the dataset views, without image links or empty values. Good for AI agents, MCP tools and LLM pipelines with limited context.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}