{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Posts Scraper: Likes, Comments, Full Text ($1/1K)",
    "description": "Substack posts scraper: title, subtitle, author, publish date, free or paid, word count, likes, comments, restacks and full text of free posts. Takes Substack newsletter URLs, custom domains included. Use it to analyze a newsletter's archive and engagement.",
    "version": "1.0",
    "x-build-id": "2q8IMseJsRiCC6Zse"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamnt67~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamnt67-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/tamnt67~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tamnt67-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/tamnt67~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tamnt67-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",
            "type": "array",
            "description": "Substack names (lenny), Substack addresses or custom domains (https://www.lennysnewsletter.com), one per line. Leave empty when you use Search keywords or Post URLs.",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Find newsletters by keyword (optional)",
            "type": "array",
            "description": "Optional. Topics such as AI marketing or climate. Each keyword is searched with Substack's public search and the newsletters behind the matching posts are scraped like the ones above. Rows get discoveredByKeyword. Via the API, send \"newsletters\": [] if you want only the discovered newsletters (otherwise the default newsletter is added).",
            "items": {
              "type": "string"
            }
          },
          "maxNewslettersPerKeyword": {
            "title": "Max newsletters per keyword",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many newsletters to take from the search for each keyword.",
            "default": 10
          },
          "postUrls": {
            "title": "Single post URLs (optional)",
            "type": "array",
            "description": "Optional. Links to individual posts, such as https://www.lennysnewsletter.com/p/some-post. Each one returns that post only. Newsletter links in Newsletters still return the archive.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerNewsletter": {
            "title": "Maximum posts per newsletter",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop after this many posts for each newsletter.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Newest first or the publication's top posts.",
            "default": "new"
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Only posts matching this search term, using Substack's own archive search. Leave empty for all posts."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only posts published on or after this date, for example 2026-01-31. Leave empty for all dates."
          },
          "includeContent": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Fetch the full article text and HTML of free posts. One extra request per post, so runs are slower.",
            "default": false
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Optional. Only posts published on or before this date, for example 2026-06-30 (the whole day counts). Leave empty for all dates."
          },
          "audience": {
            "title": "Free or paid",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Optional. Keep all posts, only free posts or only paid (subscriber-only) posts."
          },
          "postType": {
            "title": "Post type",
            "enum": [
              "newsletter",
              "podcast",
              "thread",
              "video"
            ],
            "type": "string",
            "description": "Optional. Keep only one post type. Leave empty for all types."
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only posts with at least this many likes (reactions)."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only posts with at least this many comments."
          },
          "minWordCount": {
            "title": "Minimum word count",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only posts with at least this many words."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Adds a comments list to every post (comment text, date, likes, replies and the commenter display name and handle). One extra request per post with comments.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit of comments (replies included) per post when Include comments is on.",
            "default": 50
          },
          "includePublicationInfo": {
            "title": "Include publication info",
            "type": "boolean",
            "description": "Adds newsletter name, description, logo, language, whether paid subscriptions are on, and Substack's rounded subscriber count. One extra request per newsletter.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy used for the requests. The default datacenter proxy works.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}