How to Pull Newsletter Posts With the Substack API
Get Substack publication posts into an agent with a URL, a small limit, and a clear plan for reading the returned fields.

Get publication posts into your agent. Paste this into your agent:
Set up https://monid.ai/SKILL.md, then find a Substack publication's recent posts, starting with a small limit, and return their titles, links, publication dates, and engagement counts.
One prompt starts a repeatable publication feed.
A developer building a Substack API integration needs a dependable way to turn a publication URL into records an agent can read. Opening an archive and copying 25 individual posts into a spreadsheet is a poor starting point for a repeatable feed.
A browser gives you pages to read, but your script needs stable identifiers, dates, and a way to distinguish one post from the next. The work gets harder when you want the same columns for several publications and need to keep the original links for review.
This guide shows how to request a small set of posts through Monid, the OpenRouter for agent tools, and design a table around the fields the endpoint declares. We'll choose a URL, inspect the input, and turn the response into a feed your agent can process.
The endpoint's declared fields include title, url, createdUtc, wordcount, and reactionCount. They describe the shape of the intended table; they are not sample results. The endpoint was inspected for this guide, but its flat fee plus per-result billing means it was not run for this article.
How to use the Substack API in your agent
Use AnyAPI's Substack Posts tool through Monid when your input is a publication URL or a specific post URL. An endpoint is a callable tool with a defined input and response; here the endpoint is anyapi /substack.posts. Its inspected schema requires a url, and its optional limit controls the maximum recent posts requested for a publication.
Step 1. Set up your agent or CLI
For an agent, get a key at app.monid.ai, then give the agent the setup instruction below. The agent quickstart explains the setup workflow.
set up https://monid.ai/SKILL.md
For a terminal, install the CLI and add your key. The CLI quickstart covers key setup and commands.
npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main
Keep the key in the CLI's key store or a secret manager, not in a shared script or article. The agent and the CLI use the same basic sequence: discover the tool, inspect its inputs and pricing, then choose whether to run it. Discover and inspect are free; a run is the billable step.
Step 2. Discover and inspect the tool
Search for the job, then inspect the exact provider and path before building a request. This matters because similarly named tools can have different input fields, billing shapes, and availability.
monid discover -q "substack api" --include-unavailable
monid inspect -p anyapi -e /substack.posts
Read the url requirement and the limit, includeContent, and includeComments options. The inspect output also lists the route and current pricing. A tool marked unavailable or degraded is not a reliable choice for this workflow; choose an available tool and inspect it again before putting it into a scheduled job.
Step 3. Submit one small request
Start with the example publication in the inspected schema and a limit of three. The following command supplies the body as JSON and waits for the run to complete.
monid run -p anyapi -e /substack.posts -w -i '{"url":"https://www.astralcodexten.com","limit":3,"includeContent":false,"includeComments":false}'
A publication URL requests recent posts, while a URL containing /p/ targets one post. With a publication, limit ranges from 1 to 100 and defaults to 25. Set includeContent to false when your first job is an index of titles and links; leave comments off when the feed does not need discussion threads.
Step 4. Save the fields you need
Save the returned data with the publication URL and the time of the request. For a first index, select the declared postId, title, url, createdUtc, and reactionCount fields; preserve the original response separately so you can revisit fields without fetching the same data again.
Treat a missing field as missing, not as zero. A zero reactions count and an absent count represent different states, and your downstream agent should keep that distinction. The schema is a description of the response, not a guarantee that every field is populated for every post.
How should you choose an input?
Choose a publication URL for a recent feed and an individual post URL for a known article. Monid passes the JSON input to the selected tool, so the URL and optional fields determine the scope of the request.
Start with a publication
Give url the publication's address and use a small limit while checking your pipeline. The schema says the tool scans recent posts up to that limit. A limit is a ceiling on the requested recent set, not a promise that every requested row exists or survives your filters.
Use one publication per request. Maintain your own list of publication URLs and associate each response with the input that produced it. That association matters when a post has moved or a publication uses a custom domain: the data in the response and the request context both help you trace the source.
Narrow a recent set
Use startDate and endDate in YYYY-MM-DD form to select a date window. The inspected description says these filters apply within the most recent posts scanned by limit. If a date window reaches further back than that recent set, raising the limit changes the scan window; it does not turn this into a complete historical archive.
minWordCount, minReactions, and minComments are useful for narrowing an editorial review queue. Apply them only when excluded posts are genuinely irrelevant to the job. For a comprehensive internal index, collect the broader recent set first and apply your own criteria afterward, so you can change a threshold without discarding context.
Request a single article
Use a post URL when an editor has already selected an article and your agent needs its content. The inspected input describes a single post URL as returning that one article, with limit ignored. Select includeContent when text is needed, and request comments only if the task requires them.
A single article is also a useful unit for a human review step: give the reviewer the original URL alongside any extracted fields. A title or excerpt in a generated summary does not replace the source article, and the agent should preserve the distinction between source text and its own interpretation.
What does the response contain?
The inspected schema declares identification, content, publication, and engagement fields for each post. AnyAPI's tool page is the place to inspect the current endpoint before relying on a field in a production pipeline. The following is a field guide, not a table of results from a run.
| Purpose | Declared fields | How to use them |
|---|---|---|
| Identify a post | postId, slug, url, title | Keep the identifier and original link alongside the title. |
| Place it in time | createdUtc, updatedUtc | Store the source dates separately from your retrieval time. |
| Describe the article | subtitle, description, wordcount, postType | Give reviewers context before they open the post. |
| Read content | text, html, markdown, contentStatus | Select a representation suitable for your next processing step. |
| Review engagement | reactionCount, commentCount, restackCount | Keep counts as snapshots, not permanent totals. |
| Understand access | isPaid, contentStatus | Preserve these fields when interpreting the available content. |
Keep identity separate from display
Use postId as an identifier when present, and retain url as a link back to the source. Titles are display text: a title can be edited, and using it as the sole deduplication key conflates distinct posts with similar titles. Preserve both the original values and your own retrieval timestamp.
If your application merges multiple publications, include the input publication URL in your local record. That makes the origin explicit even when an optional publication field is absent. It also gives you a straightforward way to audit which request produced a row before passing it to a summarizer or a search index.
Choose content deliberately
The schema offers text, HTML, and Markdown when content is included. Plain text suits a simple indexing step; Markdown retains a useful document structure; HTML is appropriate when your application needs markup. Your pipeline should select one representation for its main task and preserve the original response only where your storage and access rules permit it.
The schema also declares isPaid and contentStatus. Do not infer that a complete article is available merely because a post record exists. Read the content fields and status in the actual response before summarizing, and make absence visible to the person reviewing the summary.
Treat counts as snapshots
Reaction, comment, and restack counts describe the values returned at retrieval time. Store a timestamp with each observation if you intend to compare changes later. Comparing two snapshots can show a change between those observations; it cannot establish when the change happened between them.
Avoid turning engagement into an automatic quality score without a review rule. A recent post has had less time to gather reactions than an older one, and the count alone does not explain why readers responded. Use the link, date, and content together when deciding what deserves attention.
How do you build a repeatable workflow?
A repeatable feed stores each request's context, checks the response, and sends only suitable records to the next stage. Monid handles the tool call; your application decides how often to call, how long to retain data, and how to handle missing fields.
Build an editorial review queue
Keep a list of publication URLs and a small maximum for each request. For every response, attach the source URL and retrieval time, then add records with a usable url to a review queue. An editor can open the original article, compare the title and description, and decide whether the item belongs in a briefing.
When you need the article text, request content for the selected post rather than treating every index entry as a finished summary. Keep the source link with any generated notes. This separates collection from interpretation and makes it easier to correct a summary without losing the original reference.
Create a searchable index
A search index benefits from explicit fields. Store the declared title, URL, date, publication context, and selected content representation separately rather than concatenating every value into one string. This lets a later query filter by date or publication and still return a source link.
Deduplicate by a stable identifier when one is present, with URL as another reference. If both are absent, send the record to a review queue instead of silently merging it with another article. That rule prevents a missing identifier from becoming a false match in your own database.
Refresh without overstating coverage
Run on a schedule you control and keep the limit and date window with the job configuration. The recent-post limit means a gap between runs can leave older material outside the scanned set. Record the interval between successful retrievals and review gaps before claiming that your archive is complete.
A scheduler is separate from the endpoint: it invokes the request at your chosen interval and handles logs, retries, and storage. Set a spending boundary in your own system because each request has a flat fee and returned posts add a per-result charge. For another publication-focused collection workflow, see the Google News API guide.
How much does it cost?
Discovery and inspection are free; the inspected Substack Posts route has a flat charge plus a charge for each returned post. Browse the tool catalog for current options. On the AnyAPI tool page, the card says pricing varies by options. The inspected default and octopus route are $0.00042 per request plus $0.00288 per returned result, Verified 2026-11-24.
Estimate a bounded request
For planning, multiply the number of returned posts by the per-result charge and add the flat charge. A limit of three caps the number requested for a publication, so it bounds the result-dependent portion of that request. The actual total depends on how many posts are returned. The schema does not establish the charge for a failed or empty run, so do not build a refund assumption into your budget.
Repeated polling or repeated collection also needs a budget. A request made on a schedule is a new request, and collecting unchanged posts again can add costs without adding useful records. Choose the frequency from your need for freshness, and use the saved identifiers to avoid sending duplicates to downstream processing.
Which endpoint should you use?
For the job in this guide, use the inspected Substack Posts tool when a publication or article URL is your starting point. The table describes the inspected route; it does not claim a measured result.
| Use case | Best endpoint | Why? |
|---|---|---|
| Recent publication posts or one article | AnyAPI Substack Posts | URL input, optional content and filters; $0.00042 flat plus $0.00288 per result, Verified 2026-11-24. |
When should you use something else?
Use Substack's website when your task is to read one article yourself and you do not need a structured feed. This is the Monid blog, and Monid provides access to the AnyAPI tool described here; the choice should follow the job rather than the source of the guide.
The inspected tool works from a publication or post URL and scans a bounded recent set for a publication. It is not a demonstrated complete historical archive, and its declared output is not evidence that every desired field will be present. If your project requires full historical coverage, account-specific access, or custom handling of a site's interface, evaluate a purpose-built integration for those requirements. For another agent workflow built around recent social posts, see the Instagram API guide.
Conclusion
You now have a request shape for collecting recent publication posts, a field plan for a reviewable feed, and a clear limit on what the inspected schema establishes. Start with a small request, retain source links and retrieval times, and expand only after checking the actual response: your agent gets a repeatable input that a human can trace back to its source.
FAQ
Can I use the Substack API from an agent?
Yes. An agent configured with Monid can discover and inspect the AnyAPI Substack Posts tool, then send a publication or post URL as JSON.
Is the Substack Posts tool free?
Discovery and inspection are free; running this route has a flat charge and a per-result charge. The tool page shows the available pricing options.
Do I need to write code?
No. You can give a configured agent a natural-language instruction and have it choose the tool and prepare the request. A CLI is also available for a script or terminal workflow.
How many posts can I request at once?
The inspected publication input accepts a limit from 1 to 100, with a default of 25. It is a maximum, not a guarantee of that many results; a single post URL ignores the limit.
Can I request only free posts?
Yes. The inspected input includes an onlyFree boolean for restricting the request to non-paywalled posts. Keep the returned access and content status with your records.
Can I schedule a Substack feed?
Yes. Your scheduler can invoke the tool on an interval you choose and save the response. Track each request and its result count so the schedule remains within your budget.
What happens if a request fails or returns nothing?
Handle failures and empty responses as distinct states in your own workflow. The inspected schema does not establish their billing treatment, so check the current terms before assuming a charge or refund.
Are there rules for collecting publication content?
Rules differ by jurisdiction and use. Check the applicable rules and permissions for your own collection, storage, and reuse.
Published November 2026.



