{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper — Newsletter Posts, Likes, Comments & Text",
    "description": "Scrape posts from any Substack newsletter, custom domains included, or find the top newsletters in a category: title, date, likes, comments, restacks, word count, free or paid, tags, and optionally the text. Only new posts since your last run. No login.",
    "version": "0.1",
    "x-build-id": "BWb45wOVkbsais4K4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/northbell~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-northbell-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/northbell~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-northbell-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/northbell~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-northbell-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": "The newsletter address — \"name.substack.com\", just \"name\", or its own domain (e.g. \"www.lennysnewsletter.com\"). A post URL works too. Leave empty if you pick categories below.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Or: find newsletters by category",
            "type": "array",
            "description": "Substack's own category lists (the same newsletters it ranks on its category pages). Finding them is free; you pay only for the posts. A subcategory name such as \"AI\" also works via the API input.",
            "items": {
              "type": "string",
              "enum": [
                "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": "Newsletters per category",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Top N newsletters from each category, in Substack's order. Each post row shows the category and the newsletter's rank in it.",
            "default": 10
          },
          "maxPostsPerPublication": {
            "title": "Max posts per newsletter",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Newest first. Caps what you pay for.",
            "default": 50
          },
          "postedWithinDays": {
            "title": "Posted within the last N days (optional)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop at posts older than this."
          },
          "audience": {
            "title": "Free or paid",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Keep all posts, only free posts, or only posts for paying subscribers (paid posts come with the preview only).",
            "default": "all"
          },
          "keywords": {
            "title": "Keywords (optional)",
            "type": "array",
            "description": "Keep posts whose title, subtitle, description or tags contain any of these.",
            "items": {
              "type": "string"
            }
          },
          "includeContent": {
            "title": "Include the post text",
            "type": "boolean",
            "description": "Adds the text of each post (one extra request per post). For paid posts this is the free preview Substack shows to everyone.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new posts since the last run",
            "type": "boolean",
            "description": "From the second run on, return only posts this Actor has not returned before for that newsletter. Schedule it for a feed.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}