# Substack New-Post Monitor (`delta_tools/substack-new-post-monitor`) Actor

Watch your favorite Substack newsletters and get alerted only when something new is published. Built-in cross-run dedup means scheduled re-runs push nothing and cost ~nothing when nothing changed. Pay only per new post detected.

- **URL**: https://apify.com/delta\_tools/substack-new-post-monitor.md
- **Developed by:** [Delta Tools](https://apify.com/delta_tools) (community)
- **Categories:** News, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 new posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Substack New-Post Monitor

Watches your favorite Substack newsletters and reports **only genuinely new posts**.
Schedule it daily or hourly: runs where nothing new was published push **zero rows**
and cost nothing beyond the Actor start — you pay per new post detected, never per
scan.

### How it works

1. For each publication you configure, the Actor fetches the latest public posts
   from Substack's **public API** (`/api/v1/archive`) — no auth, no key, no proxy.
2. It compares them against a saved snapshot in a named key-value store
   (`substack-monitor-state`), namespaced per `stateKey`, so separate monitors
   never share or clobber baselines.
3. Posts it has never seen are pushed to the dataset and billed once each
   (`new-substack-post` event). Everything else — including scheduled re-runs
   with zero new posts — pushes nothing and bills nothing.

Only **public post metadata** is read (title, subtitle, public excerpt, published
date, author, URL, audience). For paywalled posts the Actor sets `paywalled: true`
and reports the public metadata only — it never attempts to read paid content.

### Input

```json
{
  "publications": [
    { "url": "https://platformer.substack.com", "maxPosts": 10 },
    { "url": "https://astralcodexten.substack.com", "maxPosts": 20 }
  ],
  "stateKey": "default",
  "reportInitialAsNew": true
}
```

- `publications` — one entry per newsletter. Use the `https://<name>.substack.com`
  URL. Custom-domain publications serve the public API on their underlying
  `<name>.substack.com` URL, so use that instead.
- `stateKey` — namespace for the snapshot. Change it to start a fresh baseline.
- `reportInitialAsNew` — first run reports everything as new (builds the
  baseline while reporting); turn off to silently establish the baseline.

### Output (dataset)

One row per genuinely new post:

| field | meaning |
|---|---|
| `publicationName`, `publicationUrl` | which newsletter |
| `postId` | stable Substack post id (dedup key) |
| `title`, `subtitle`, `excerpt` | public metadata |
| `url` | canonical post URL |
| `publishedDate` | ISO timestamp |
| `author`, `authorHandle` | byline |
| `postType` | e.g. `newsletter`, `podcast` |
| `paywalled` | `true` when `audience` is not `everyone` (public metadata only) |
| `detectedAt` | when this Actor first saw it |

A run receipt (`substack-monitor-state` → `state-v1-<stateKey>-last-receipt`)
records per-publication status, fetch counts, and errors for auditing.

### Pricing (pay-per-event)

- **Actor start:** $0.001
- **New post detected:** $0.0025

A daily monitor that finds 3 new posts in a week costs roughly
7 × $0.001 + 3 × $0.0025 = **$0.0145**. Runs that find nothing cost just the
start event. (All prices are the FREE-tier event price; Apify's tiered
discounts apply at higher plans.)

### Limits & honesty

- Public API only. If Substack removes or gates an endpoint, affected
  publications report `status: "error"` in the run receipt instead of failing
  the run.
- Invalid URLs and nonexistent publications are reported per-publication with a
  clear message; the rest of the run continues.

# Actor input Schema

## `publications` (type: `array`):

One entry per Substack publication. Use the https://<name>.substack.com URL (custom-domain publications serve their API on the underlying <name>.substack.com URL — use that), e.g. https://platformer.substack.com

## `stateKey` (type: `string`):

Namespace for the saved snapshot, so separate monitors never share baselines. Change it to start fresh.

## `reportInitialAsNew` (type: `boolean`):

On the very first run there is no baseline, so every post is reported as new. Turn off to silently build the baseline instead.

## `httpTimeoutSeconds` (type: `integer`):

Timeout per API request.

## Actor input object example

```json
{
  "publications": [
    {
      "url": "https://platformer.substack.com",
      "maxPosts": 10
    }
  ],
  "stateKey": "default",
  "reportInitialAsNew": true,
  "httpTimeoutSeconds": 45
}
```

# Actor output Schema

## `publicationName` (type: `string`):

No description

## `publicationUrl` (type: `string`):

No description

## `postId` (type: `string`):

No description

## `title` (type: `string`):

No description

## `subtitle` (type: `string`):

No description

## `excerpt` (type: `string`):

No description

## `url` (type: `string`):

No description

## `publishedDate` (type: `string`):

No description

## `author` (type: `string`):

No description

## `authorHandle` (type: `string`):

No description

## `postType` (type: `string`):

No description

## `paywalled` (type: `string`):

'true' when audience is not 'everyone' (public metadata only)

## `audience` (type: `string`):

No description

## `detectedAt` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "publications": [
        {
            "url": "https://platformer.substack.com",
            "maxPosts": 10
        }
    ],
    "stateKey": "default",
    "reportInitialAsNew": true,
    "httpTimeoutSeconds": 45
};

// Run the Actor and wait for it to finish
const run = await client.actor("delta_tools/substack-new-post-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "publications": [{
            "url": "https://platformer.substack.com",
            "maxPosts": 10,
        }],
    "stateKey": "default",
    "reportInitialAsNew": True,
    "httpTimeoutSeconds": 45,
}

# Run the Actor and wait for it to finish
run = client.actor("delta_tools/substack-new-post-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "publications": [
    {
      "url": "https://platformer.substack.com",
      "maxPosts": 10
    }
  ],
  "stateKey": "default",
  "reportInitialAsNew": true,
  "httpTimeoutSeconds": 45
}' |
apify call delta_tools/substack-new-post-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,delta_tools/substack-new-post-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/C9Fzj3eC1znI7aLak/builds/XxEtzEZp8OoTg0bw1/openapi.json
