{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper: Posts, Full Text, Comments & Newsletters",
    "description": "Scrape Substack posts with full text as clean Markdown, comments, search across all of Substack, and top newsletters per category with subscriber counts and prices. No login.",
    "version": "0.1",
    "x-build-id": "JMediUqNxjo4NddUR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leanpilar~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leanpilar-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/leanpilar~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-leanpilar-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/leanpilar~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-leanpilar-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": {
          "newsletters": {
            "title": "Newsletters",
            "type": "array",
            "description": "Newsletters to read posts from. Any form works: \"lenny\", \"lenny.substack.com\", a custom domain like \"www.lennysnewsletter.com\", or a profile link \"substack.com/@lenny\". Each post is one charged result.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post links",
            "type": "array",
            "description": "Single posts, e.g. https://name.substack.com/p/post-title.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search all of Substack",
            "type": "array",
            "description": "Keywords to search across every Substack newsletter. Finds matching posts and (if enabled below) matching newsletters.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Newsletter leaderboards",
            "type": "array",
            "description": "Substack's top newsletters per category, with subscriber counts and subscription prices. Each newsletter is one charged result.",
            "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"
              ]
            }
          },
          "sort": {
            "title": "Order of newsletter posts",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Newest posts first, or the newsletter's most liked posts first.",
            "default": "new"
          },
          "maxPostsPerNewsletter": {
            "title": "Max posts per newsletter",
            "minimum": 0,
            "type": "integer",
            "description": "0 = the whole archive.",
            "default": 20
          },
          "searchInNewsletter": {
            "title": "Only posts about",
            "type": "string",
            "description": "Optional keyword. Uses each newsletter's own archive search."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Date like 2026-01-31, or relative like \"30 days\", \"2 weeks\", \"6 months\"."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Date like 2026-06-30, or relative like \"7 days\"."
          },
          "audience": {
            "title": "Free or paid posts",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Paid posts only include the free preview text.",
            "default": "all"
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "newsletter",
                "podcast",
                "thread",
                "video"
              ],
              "enumTitles": [
                "Articles",
                "Podcasts",
                "Threads",
                "Videos"
              ]
            }
          },
          "minLikes": {
            "title": "Min likes",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts with fewer likes.",
            "default": 0
          },
          "includeFullText": {
            "title": "Include full text (Markdown + plain text)",
            "type": "boolean",
            "description": "Full article as clean Markdown, ready for AI tools. Paid posts only include the free preview. No extra charge.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Adds comment rows (with replies) for each post. Each comment is one charged result.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "type": "integer",
            "description": "Best comments first, replies included.",
            "default": 100
          },
          "maxPostsPerSearch": {
            "title": "Max posts per search term",
            "minimum": 0,
            "type": "integer",
            "description": "Matching posts from all of Substack. 0 = newsletters only.",
            "default": 20
          },
          "findNewsletters": {
            "title": "Also return matching newsletters for search terms",
            "type": "boolean",
            "description": "Newsletters whose name or author matches, with subscriber counts.",
            "default": true
          },
          "maxNewslettersPerSearch": {
            "title": "Max newsletters per search term",
            "minimum": 1,
            "type": "integer",
            "description": "Substack search usually returns up to about 10-30 newsletters per term.",
            "default": 10
          },
          "leaderboard": {
            "title": "Leaderboard",
            "enum": [
              "all",
              "paid"
            ],
            "type": "string",
            "description": "Substack's Top overall list, or the bestseller list ranked by paid subscribers.",
            "default": "all"
          },
          "maxNewslettersPerCategory": {
            "title": "Max newsletters per category",
            "minimum": 1,
            "type": "integer",
            "description": "Ranked from the top of the leaderboard.",
            "default": 50
          },
          "minSubscribers": {
            "title": "Min subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Skip newsletters with fewer subscribers (Substack shows rounded numbers like 271K+).",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests run at the same time.",
            "default": 4
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Not needed normally. Turn on only if Substack starts refusing requests.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}