[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [Substack publication archive](https://spiral.ai/integrations/opencode/substack-publication-archive)

# How to Use Substack publication archive in opencode

Get a publication's post listings with titles, dates, links, free or paid status, word counts, and engagement counts. Use it to browse recent coverage or build a reading list before opening individual posts.

|  |  |
| --- | --- |
| Model | Substack publication archive |
| Available through | Alexandria |
| Category | News & Media |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Substack publication archive in opencode

- Use Substack publication archive for Astral Codex Ten to get its 10 newest entries. Write a Markdown reading list in this project with titles, dates, links, and free or paid status.
- Use Substack publication archive for Lenny's Newsletter to list 20 recent posts. Create a local table of titles, word counts, comments, and reactions for editorial review.
- Use Substack publication archive to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from Substack publication archive and tell me what changed since last week.
- Check Substack publication archive and summarize what you find in three bullet points.

## How to set up Substack publication archive in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Substack publication archive**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "substack-com/newsletters/archive",
    "input": {
      "publication": "<publication>"
    }
  }'
```

Then paste one of the prompts above: opencode finds Substack publication archive on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## Substack publication archive tools and prices

- [Substack · Archive](https://spiral.ai/tools/alexandria/substack-com/newsletters/archive) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| sort | new, top, pinned | new | new = newest first, top = most popular, pinned = the publication's pinned posts only (usually one, a single page). |
| limit | 1 to 50 | 12 | Posts to return. Substack serves 25 per request, so larger pages take two requests. |
| cursor |  | — | next_cursor from the previous page of the same publication, sort and query. Takes precedence over offset. |
| offset | 0 to 10000 | 0 | Posts to skip. new listings reach at most 250 by offset; follow next_cursor for deeper pages. Ignored when cursor is set. |

## What can you do with Substack publication archive in opencode?

Build a linked research brief from Substack publication listings and available article text. A coding agent can turn the results into project notes that separate complete articles from paid previews.

### Prepare a newsletter reading brief

Browse recent publication entries, find articles about a chosen subject, and summarize the available text with links. Label paid previews so readers know which summaries cover only part of an article.

### Check an editorial pitch

Review a newsletter's recent titles, search the proposed subject, and read relevant public articles before pitching. Turn the findings into a short list of covered angles and questions still worth investigating.

### Compare published arguments

Select articles from public newsletters covering the same issue. Use their listings and available text to compare claims, dates, and supporting examples in a linked research memo.

### Build a topic reading list

Find relevant titles in a publication's archive or topic results, then inspect the available articles to write useful reading notes. Keep links and distinguish complete articles from previews.

### Prepare interview questions

Review a public newsletter's recent coverage and search an interview topic. Read selected articles to draft questions tied to the publication's actual claims and examples.

### Review product management advice

Find relevant Lenny's Newsletter articles through recent listings or topic searches. Compare the available text to identify recommendations a product team could discuss, with a source link for each.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## Substack publication archive in other agents

- [Amp](https://spiral.ai/integrations/amp/substack-publication-archive)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/substack-publication-archive)
- [Claude](https://spiral.ai/integrations/claude-desktop/substack-publication-archive)
- [Claude Code](https://spiral.ai/integrations/claude-code/substack-publication-archive)
- [Cline](https://spiral.ai/integrations/cline/substack-publication-archive)
- [Codex](https://spiral.ai/integrations/codex/substack-publication-archive)
- [Cursor](https://spiral.ai/integrations/cursor/substack-publication-archive)
- [Devin](https://spiral.ai/integrations/devin/substack-publication-archive)
- [dots](https://spiral.ai/integrations/dots/substack-publication-archive)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/substack-publication-archive)
- [Gemini](https://spiral.ai/integrations/gemini/substack-publication-archive)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/substack-publication-archive)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/substack-publication-archive)
- [goose](https://spiral.ai/integrations/goose/substack-publication-archive)
- [Grok](https://spiral.ai/integrations/grok/substack-publication-archive)
- [Grok Build](https://spiral.ai/integrations/grok-build/substack-publication-archive)
- [Hermes](https://spiral.ai/integrations/hermes/substack-publication-archive)
- [Instinct](https://spiral.ai/integrations/instinct/substack-publication-archive)
- [Manus](https://spiral.ai/integrations/manus/substack-publication-archive)
- [Muse](https://spiral.ai/integrations/muse/substack-publication-archive)
- [Muse Code](https://spiral.ai/integrations/muse-code/substack-publication-archive)
- [n8n](https://spiral.ai/integrations/n8n/substack-publication-archive)
- [Notion](https://spiral.ai/integrations/notion/substack-publication-archive)
- [OpenClaw](https://spiral.ai/integrations/openclaw/substack-publication-archive)
- [Perplexity](https://spiral.ai/integrations/perplexity/substack-publication-archive)
- [Raycast](https://spiral.ai/integrations/raycast/substack-publication-archive)
- [VS Code](https://spiral.ai/integrations/vscode/substack-publication-archive)
- [Windsurf](https://spiral.ai/integrations/windsurf/substack-publication-archive)
- [Zapier](https://spiral.ai/integrations/zapier/substack-publication-archive)

## More opencode guides

- [Substack post text](https://spiral.ai/integrations/opencode/substack-post-text)
- [Substack publication search](https://spiral.ai/integrations/opencode/substack-publication-search)
- [Spaceflight News API topic news](https://spiral.ai/integrations/opencode/spaceflight-news-api-topic-news)
- [TMDB TV season episodes](https://spiral.ai/integrations/opencode/tmdb-tv-season-episodes)
- [Spaceflight News API launch coverage](https://spiral.ai/integrations/opencode/spaceflight-news-api-launch-coverage)
- [TMDB actor and filmmaker profile](https://spiral.ai/integrations/opencode/tmdb-actor-and-filmmaker-profile)

## Questions about Substack publication archive in opencode

**Can opencode use Substack publication archive?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Substack publication archive like any built-in tool.

**How much does Substack publication archive cost in opencode?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need an Alexandria account to use Substack publication archive in opencode?**

No. Spiral runs Substack publication archive on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Substack publication archive in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while Substack publication archive runs?**

Substack publication archive runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

**Does a publication's website contain every email it sends?**

No. Substack posts addressed to free subscribers only are sent by email and do not appear on the publication page, so a public archive cannot represent every email.

**How much of a paid post is public?**

The writer decides where the paywall falls within the post. Public previews therefore vary in length, and post retrieval returns the preview for paid content.

**Can an older free article become paywalled?**

Yes. Substack lets publishers automatically paywall their free archive after a chosen period, so an article's public availability can change as it ages.

**Can published articles change after their original release?**

Yes. Writers can edit published posts, and those edits appear on the web and in Substack's apps. The available article can therefore differ from an earlier reading.

**Does the displayed publication date prove when an article first appeared?**

No. Substack allows writers to change a published post's displayed date to a past date, so that date alone does not establish its first public appearance.

