{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper — Newsletters, Posts, Authors & Subscribers",
    "description": "Discover Substack newsletters by category & leaderboard rank, then pull every post, author and publication. 30+ categories or direct subdomain. Per post: title, audience (free/paid), reactions, restacks. Per pub: subdomain, custom domain, author, subscription tiers. Public Substack API — no auth.",
    "version": "1.0",
    "x-build-id": "5FycbOg5Y4R6yJ9RG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/logiover~substack-newsletter-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-logiover-substack-newsletter-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/logiover~substack-newsletter-scraper/runs": {
      "post": {
        "operationId": "runs-sync-logiover-substack-newsletter-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/logiover~substack-newsletter-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-logiover-substack-newsletter-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": {
          "categorySlugs": {
            "title": "Category Slugs to Discover",
            "type": "array",
            "description": "Substack categories to enumerate. Slugs: 'technology', 'business', 'finance', 'crypto', 'news', 'us-politics', 'world-politics', 'culture', 'science', 'health', 'design', 'travel', 'parenting', 'literature', 'fiction', 'philosophy', 'history', 'climate', 'art', 'music', 'sports', 'food', 'film-and-tv', 'comics', 'humor', 'fashionandbeauty', 'education', 'faith', 'international', 'home-garden'. Leave empty if you supply newsletter URLs directly.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categoryRanking": {
            "title": "Category Ranking Mode",
            "enum": [
              "leaderboard",
              "paid",
              "all"
            ],
            "type": "string",
            "description": "How to sort publications within each category. 'leaderboard' = top newsletters (most subscribers + engagement), 'paid' = top paid newsletters, 'all' = all publications sorted by Substack's default ranking.",
            "default": "leaderboard"
          },
          "newsletterUrls": {
            "title": "Direct Newsletter URLs",
            "type": "array",
            "description": "Specific Substack publications to scrape, regardless of category. Accepts subdomains ('lennysnewsletter.substack.com'), bare names ('lennysnewsletter'), or custom domains ('www.lennysnewsletter.com').",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPublicationsPerCategory": {
            "title": "Max Publications Per Category",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on publications enumerated per category. Substack returns 25 per page, the actor paginates automatically up to this cap.",
            "default": 25
          },
          "maxPostsPerPublication": {
            "title": "Max Posts Per Publication",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on posts pulled per publication via the archive API (paginates 12 per page). Set to 0 to skip post fetching entirely (publication-only mode).",
            "default": 50
          },
          "audienceFilter": {
            "title": "Audience Filter",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Filter posts by audience. 'all' = both free and paid, 'free' = free-only posts (the type any subscriber can read), 'paid' = paid-only posts (premium).",
            "default": "all"
          },
          "minPostDate": {
            "title": "Minimum Post Date (ISO)",
            "type": "string",
            "description": "Filter posts to those published on or after this date (YYYY-MM-DD). Leave empty for no lower bound.",
            "default": null
          },
          "maxPostDate": {
            "title": "Maximum Post Date (ISO)",
            "type": "string",
            "description": "Filter posts to those published on or before this date (YYYY-MM-DD). Leave empty for no upper bound.",
            "default": null
          },
          "keywordFilter": {
            "title": "Keyword Filter (post title / subtitle)",
            "type": "array",
            "description": "Only save posts whose title or subtitle contains any of these terms (case-insensitive substring match, applied client-side after fetch). Examples: ['ai', 'gpt'], ['layoffs'], ['startup']. Leave empty for no filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includePublicationMetadata": {
            "title": "Include Publication Metadata in Each Record",
            "type": "boolean",
            "description": "When enabled, every post record is enriched with parent-publication fields (subdomain, custom domain, author name, hero description, category, language, free / paid subscription benefits, founded date). Disable for smaller per-row records.",
            "default": true
          },
          "alsoPushPublicationRecord": {
            "title": "Also Push Publication-Level Records",
            "type": "boolean",
            "description": "When enabled, the actor also pushes one record per discovered publication (with `recordType: 'publication'`) in addition to per-post records. Useful when you want a denormalized list of newsletters in the same dataset.",
            "default": false
          },
          "language": {
            "title": "Publication Language Filter",
            "type": "string",
            "description": "Restrict to publications in a specific language (ISO 639-1). 'en' for English-only. Leave empty for all languages.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}