{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper – Posts, Notes, Authors & Rankings",
    "description": "Scrape Substack newsletters, search posts across Substack, get the top newsletters of any category, and writer profiles with their Notes: reactions, comments, full text, audience size, paid tier, followers and leaderboard rank. No login or API key needed.",
    "version": "1.0",
    "x-build-id": "A4WXXUNae6A7uhT2x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sheshinmcfly~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sheshinmcfly-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/sheshinmcfly~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sheshinmcfly-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/sheshinmcfly~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sheshinmcfly-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": "Mode",
            "enum": [
              "publications",
              "search",
              "rankings",
              "authors"
            ],
            "type": "string",
            "description": "Publications: posts (and optionally comments, full text and recommendations) from the newsletters you list. Search: posts matching keywords across all of Substack. Rankings: the top newsletters of any Substack category. Authors: writer profiles and their Substack Notes.",
            "default": "publications"
          },
          "publications": {
            "title": "Publications",
            "type": "array",
            "description": "Newsletters to scrape: a subdomain ('noahpinion'), a domain ('noahpinion.substack.com', 'www.lennysnewsletter.com') or any URL from the newsletter. Used in Publications mode.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search across all of Substack (e.g. 'artificial intelligence', 'venture capital'). Used in Search mode.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Substack categories to rank, by name or slug: technology, business, finance, culture, us-politics, world-politics, news, science, health, sports, music, food, art, fashion, crypto, education, history, philosophy, fiction, literature, travel, parenting, design, faith, climate, comics, humor, international, film-and-tv, games, home-garden, beauty, photography, podcast… Used in Rankings mode.",
            "items": {
              "type": "string"
            }
          },
          "rankingType": {
            "title": "Ranking",
            "enum": [
              "all",
              "paid"
            ],
            "type": "string",
            "description": "Substack's top list of each category, or its top paid list. Used in Rankings mode.",
            "default": "all"
          },
          "maxPublicationsPerCategory": {
            "title": "Max newsletters per category",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "How far down each ranking to go (Substack ranks up to about 525 newsletters per category). Used in Rankings mode.",
            "default": 100
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "description": "Substack writers by handle or profile link (e.g. 'garymarcus', '@noahpinion', 'https://substack.com/@garymarcus'). Returns their profile — followers, audience, leaderboard rank, X account, publications — and their latest Notes. Used in Authors mode.",
            "items": {
              "type": "string"
            }
          },
          "maxNotesPerAuthor": {
            "title": "Max notes per author",
            "minimum": 0,
            "type": "integer",
            "description": "Latest Substack Notes per author, newest first (0 = profile only). Used in Authors mode.",
            "default": 50
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "new",
              "top",
              "pinned"
            ],
            "type": "string",
            "description": "How to sort each publication's post archive.",
            "default": "new"
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication / keyword",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum posts per publication (Publications mode) or per keyword (Search mode).",
            "default": 50
          },
          "includePublicationMetadata": {
            "title": "Include publication profile",
            "type": "boolean",
            "description": "One record per publication with its name, author, language, creation date and audience as Substack shows it (e.g. 'Over 461,000 subscribers', 'Tens of thousands of paid subscribers').",
            "default": true
          },
          "includeFullContent": {
            "title": "Include full post content (HTML)",
            "type": "boolean",
            "description": "Adds the full HTML body of each post (free posts; paid posts return what Substack shows publicly). Slower.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Adds every comment, nested replies included, as separate records. Slower.",
            "default": false
          },
          "includeRecommendations": {
            "title": "Include recommended publications",
            "type": "boolean",
            "description": "Adds one record per newsletter each publication recommends (name, URL, author, language, paid or free) — useful to map a niche or find prospects.",
            "default": false
          },
          "includeTrendingTopics": {
            "title": "Include trending topics",
            "type": "boolean",
            "description": "Also returns the topics Substack features as trending right now (a featured topic and a few suggested searches), with a link to the results. Works in any mode.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}