{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper: Posts, Notes and Profiles",
    "description": "Scrape Substack without a login: posts with full article HTML and word count, nested comment threads, Notes from keyword search or an author's feed, author and publication profiles, and category leaderboards. JSON, CSV, Excel, API. Paywalled posts are flagged and never billed as full content.",
    "version": "1.0",
    "x-build-id": "mG2Bm8bD3LmWNJ8jG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_craft~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_craft-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/automation_craft~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation_craft-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/automation_craft~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation_craft-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": "Publications (posts mode)",
            "type": "array",
            "description": "Substack publications to pull posts from. Accepts any form: `astralcodexten`, `astralcodexten.substack.com`, `https://www.astralcodexten.com`, or a custom domain. A pasted post URL is routed to single-post mode automatically.",
            "items": {
              "type": "string"
            }
          },
          "includeContent": {
            "title": "Include full article content",
            "type": "boolean",
            "description": "Fetch each post's full body (HTML + plain text + word count). Paywalled posts are delivered as metadata with `paywalled: true` and are NEVER charged at the content price - this Actor does not bypass paywalls."
          },
          "includeComments": {
            "title": "Include comment threads",
            "type": "boolean",
            "description": "Fetch the full nested comment tree for every delivered post (flattened records with parentId + depth)."
          },
          "includePublicationProfile": {
            "title": "Include publication profile",
            "type": "boolean",
            "description": "Emit one publication-profile record per publication: name, tagline, author, founded date, payments enabled, subscriber signals where public."
          },
          "sort": {
            "title": "Post order",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Archive order: `new` (latest first) or `top` (most popular first)."
          },
          "searchInPublication": {
            "title": "Search within publications",
            "type": "string",
            "description": "Keyword search inside each publication's archive (server-side). Note: Substack has no public global post search - this searches per publication."
          },
          "publishedAfter": {
            "title": "Published after (YYYY-MM-DD)",
            "type": "string",
            "description": "Only posts published on/after this date."
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on charged post records per publication. Honored exactly."
          },
          "postUrls": {
            "title": "Single post URLs",
            "type": "array",
            "description": "Direct Substack post URLs (`https://…/p/slug`) to fetch individually - with content and (optionally) comments.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on charged comment records per post."
          },
          "authorHandles": {
            "title": "Author handles (profile mode)",
            "type": "array",
            "description": "Substack author handles - `@handle`, `handle`, or `https://substack.com/@handle`. Each returns a rich author-profile record: follower count, subscriber signals, bestseller tier, social links, primary publication.",
            "items": {
              "type": "string"
            }
          },
          "includeAuthorNotes": {
            "title": "Include authors' recent Notes",
            "type": "boolean",
            "description": "Also pull each author's recent public Notes (their short-form feed posts)."
          },
          "maxNotesPerAuthor": {
            "title": "Max Notes per author",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on charged note records per author."
          },
          "noteSearchQueries": {
            "title": "Notes search queries",
            "type": "array",
            "description": "Keyword queries against Substack Notes (the platform-wide short-form feed). Each query returns matching notes with author, engagement, and links.",
            "items": {
              "type": "string"
            }
          },
          "maxNotesPerQuery": {
            "title": "Max Notes per search query",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on charged note records per search query."
          },
          "leaderboardCategories": {
            "title": "Leaderboard categories",
            "type": "array",
            "description": "Substack category leaderboards to rank, by slug or name: e.g. `technology`, `business`, `culture`, `finance`, `politics`, `health-politics`, `food`, `sports`, `music`, `climate`. Each returns ranked publications with subscriber signals.",
            "items": {
              "type": "string"
            }
          },
          "maxPublicationsPerCategory": {
            "title": "Max publications per category",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on charged leaderboard entries per category."
          },
          "maxItemsTotal": {
            "title": "Max items total",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Overall cap on charged records for the run. Honored exactly."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}