{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper — Newsletter Posts, Search & Profiles",
    "description": "Scrape Substack newsletters: every post of any newsletter or custom domain (title, date, likes, comments, restacks, paid or free, word count, authors, tags), post search across Substack, top newsletters by category and newsletter profiles. Optional full text.",
    "version": "0.1",
    "x-build-id": "oZ1C0Li1o6q7WzlxK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-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/fabrikit~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-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/fabrikit~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-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 or post URLs",
            "type": "array",
            "description": "One per line: a subdomain (simonw), a Substack address (https://simonw.substack.com), a custom domain (https://www.lennysnewsletter.com) or a post link (https://name.substack.com/p/slug, open.substack.com/pub/name/p/slug). The newsletter's archive is read newest first.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Find newsletters by keyword",
            "type": "array",
            "description": "Keywords for Substack's newsletter search (for example: product management, climate tech). The best matches (up to 'Newsletters per search or category') are added to the list above.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Top newsletters of a category",
            "type": "array",
            "description": "Substack leaderboard categories. The top newsletters of each (up to 'Newsletters per search or category', in leaderboard order) are added to the list.",
            "items": {
              "type": "string",
              "enum": [
                "technology",
                "business",
                "finance",
                "culture",
                "us-politics",
                "world-politics",
                "health-politics",
                "news",
                "science",
                "health",
                "climate",
                "crypto",
                "education",
                "history",
                "philosophy",
                "literature",
                "fiction",
                "food",
                "travel",
                "sports",
                "music",
                "art",
                "design",
                "fashionandbeauty",
                "film-and-tv",
                "games",
                "comics",
                "humor",
                "parenting",
                "faith",
                "home-garden",
                "international"
              ],
              "enumTitles": [
                "Technology",
                "Business",
                "Finance",
                "Culture",
                "U.S. Politics",
                "World Politics",
                "Health Politics",
                "News",
                "Science",
                "Health & Wellness",
                "Climate & Environment",
                "Crypto",
                "Education",
                "History",
                "Philosophy",
                "Literature",
                "Fiction",
                "Food & Drink",
                "Travel",
                "Sports",
                "Music",
                "Art & Illustration",
                "Design",
                "Fashion & Beauty",
                "Film & TV",
                "Games",
                "Comics",
                "Humor",
                "Parenting",
                "Faith & Spirituality",
                "Home & Garden",
                "International"
              ]
            }
          },
          "maxNewslettersPerSearch": {
            "title": "Newsletters per search or category",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many newsletters each keyword search or category contributes.",
            "default": 5
          },
          "postSearchQueries": {
            "title": "Search posts across Substack",
            "type": "array",
            "description": "Keywords searched in Substack's post search; the matching posts from any newsletter become rows (up to 'Posts per source' per keyword). With the newsletters output, the newsletters behind those posts are listed instead.",
            "items": {
              "type": "string"
            }
          },
          "outputType": {
            "title": "Output",
            "enum": [
              "posts",
              "newsletters"
            ],
            "type": "string",
            "description": "posts = one row per post (default). newsletters = one row per newsletter: name, author, description, subscriber count or label, paid plan prices, launch date, podcast, language.",
            "default": "posts"
          },
          "maxPostsPerSource": {
            "title": "Posts per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum posts taken from each newsletter (or each post search). 0 = the whole archive.",
            "default": 20
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows in total. Exact: the run never saves or charges more.",
            "default": 200
          },
          "sort": {
            "title": "Archive order",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "new = newest posts first. top = the newsletter's most popular posts first.",
            "default": "new"
          },
          "archiveSearch": {
            "title": "Only posts matching (inside each newsletter)",
            "type": "string",
            "description": "Keyword passed to each newsletter's own archive search, for example pricing. Leave empty for every post."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Keep posts published on or after this date: 2026-01-31, an ISO timestamp, or a relative period such as 7 days, 2 weeks, 3 months."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Keep posts published before this date (same formats)."
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Keep only these types. Empty = all types.",
            "items": {
              "type": "string",
              "enum": [
                "newsletter",
                "podcast"
              ],
              "enumTitles": [
                "Written posts",
                "Podcast episodes"
              ]
            }
          },
          "audience": {
            "title": "Free or paid posts",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "all = every post. free = only posts open to everyone. paid = only posts for paying subscribers (their content is the free preview).",
            "default": "all"
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts with fewer likes (reactions) than this. 0 = no minimum.",
            "default": 0
          },
          "includeContent": {
            "title": "Include the post body (add-on)",
            "type": "boolean",
            "description": "Fetch each post's body: contentText (plain text) and/or contentHtml, with its word count. Paid posts return only the free preview the author allows (contentIsPreview = true). Charged as 'post-content' per post with a body, on top of the post price; one extra request per post.",
            "default": false
          },
          "contentFormat": {
            "title": "Body format",
            "enum": [
              "text",
              "html",
              "both"
            ],
            "type": "string",
            "description": "Used with the body add-on: text, html or both.",
            "default": "text"
          },
          "maxConcurrency": {
            "title": "Newsletters in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many newsletters are read at the same time. Requests to one host are always paced.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Substack's API is public, so the default is no proxy. If Substack blocks the run, it switches to Apify datacenter and then residential proxies by itself; pick a proxy here to start with one.",
            "default": {
              "useApifyProxy": false
            }
          },
          "autoProxyFallback": {
            "title": "Switch to Apify proxies when blocked",
            "type": "boolean",
            "description": "After repeated blocks, move to Apify datacenter proxies, then residential ones (residential traffic is billed by Apify as usual).",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}