{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack API Scraper: Posts, Authors & Newsletters",
    "description": "Read public Substack posts, publications, and comments in structured rows. Browse archives, search posts, discover publications by topic or category, and read public recommendations. Get titles, authors, dates, engagement, public previews, and quality notes without a Substack login or API key.",
    "version": "0.0",
    "x-build-id": "xS7WxUlI7Kzkui9St"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maximedupre~substack-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maximedupre-substack-api",
        "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/maximedupre~substack-api/runs": {
      "post": {
        "operationId": "runs-sync-maximedupre-substack-api",
        "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/maximedupre~substack-api/run-sync": {
      "post": {
        "operationId": "run-sync-maximedupre-substack-api",
        "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",
        "required": [
          "target"
        ],
        "properties": {
          "target": {
            "title": "Target",
            "enum": [
              "publicationArchive",
              "post",
              "publicationDetails",
              "categoryDiscovery",
              "topicDiscovery",
              "publicationRecommendations",
              "publicationSearch",
              "postComments"
            ],
            "type": "string",
            "description": "Choose the public Substack data to read."
          },
          "category": {
            "title": "Category",
            "minLength": 1,
            "type": "string",
            "description": "Required for `categoryDiscovery`. Enter a category from Substack's public discovery view."
          },
          "ranking": {
            "title": "Ranking view",
            "minLength": 1,
            "type": "string",
            "description": "Required for `categoryDiscovery`. Enter the ranking view to use with the category."
          },
          "topic": {
            "title": "Topic query",
            "minLength": 1,
            "type": "string",
            "description": "Required for `topicDiscovery`. Enter free text for the public publication search."
          },
          "publicationTargets": {
            "title": "Publication targets",
            "minItems": 1,
            "type": "array",
            "description": "Enter one or more public publication handles, Substack subdomain URLs, or supported custom-domain URLs. Use this list for publication archive, publication details, recommendations, or publication post search. For recommendations, each publication is the source.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "minItems": 1,
            "type": "array",
            "description": "Enter one or more canonical public post URLs. For `post`, each URL returns a post. For `postComments`, each URL supplies its public comment thread.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "Enter the full public post URL.",
                  "pattern": "^https://"
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "postQuery": {
            "title": "Post text query",
            "minLength": 1,
            "type": "string",
            "description": "Optional for `publicationArchive` and required for `publicationSearch`. Enter text found in a post title or subtitle. Other targets ignore this field."
          },
          "dateFrom": {
            "title": "Published from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional lower bound for post publication dates. It applies to post targets. Use a UTC calendar date in `YYYY-MM-DD` form."
          },
          "dateTo": {
            "title": "Published to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional upper bound for post publication dates. It applies to post targets. Use a UTC calendar date in `YYYY-MM-DD` form."
          },
          "audience": {
            "title": "Audience",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Optional filter for post results. Choose all audiences, free posts only, or paid posts only. Discovery and publication-details targets ignore this field."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Optional language filter for discovered publications and post results. Enter language names or codes. Other targets ignore this field.",
            "items": {
              "type": "string"
            }
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Optional post type filter. Choose newsletters, podcasts, threads, or videos. Non-post targets ignore this field.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "newsletter",
                "podcast",
                "thread",
                "video"
              ],
              "enumTitles": [
                "Newsletter",
                "Podcast",
                "Thread",
                "Video"
              ]
            }
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "description": "Optional author filter for post results. Enter author names or public handles. Non-post targets ignore this field.",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Optional publication tag filter for post results. Enter tag names. Non-post targets ignore this field.",
            "items": {
              "type": "string"
            }
          },
          "minReactions": {
            "title": "Minimum reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum reaction count for post results. Non-post targets ignore this field."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum comment count for post results. Non-post targets ignore this field."
          },
          "minWords": {
            "title": "Minimum words",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum word count for post results. Non-post targets ignore this field."
          },
          "sortBy": {
            "title": "Post order",
            "enum": [
              "newest",
              "oldest",
              "popularity",
              "engagement",
              "length"
            ],
            "type": "string",
            "description": "Optional order for returned posts. Choose newest, oldest, most popular, most engaged, or longest. Targets that do not return posts ignore this field."
          },
          "includeArticleContent": {
            "title": "Include public article content",
            "type": "boolean",
            "description": "When true, fetch complete public article content as HTML and readable text when available. It applies to publication archives, post retrieval, and publication post search. Restricted posts return public previews only.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Optional positive limit on saved rows. It can stop archive, discovery, search, and comment work early. Leave it empty to return all available results until the source is exhausted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}