Call it
curl https://api.peume.com/v1/call/threads-substack-posts \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"includeComments": false,
"url": "your url",
"includeContent": true,
"contentType": "all",
"onlyFree": false
}
}'const res = await fetch("https://api.peume.com/v1/call/threads-substack-posts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"includeComments": false,
"url": "your url",
"includeContent": true,
"contentType": "all",
"onlyFree": false
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/threads-substack-posts",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"includeComments": False,
"url": "your url",
"includeContent": True,
"contentType": "all",
"onlyFree": False
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: threads-substack-posts.
Parameters
minWordCountintegerOnly return posts with at least this many words, which filters out short notes and announcements (e.g. 1000).
maxCommentsintegerMaximum comments collected per post when 'includeComments' is true (0-500, default 20). Costs nothing extra (e.g. 50).
endDatestringOnly return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31). Applied within the most recent 'limit' posts scanned.
includeCommentsbooleanInclude public comment threads and their direct replies on each post (e.g. true).
Example: false
urlRequiredstringEither a Substack publication URL / custom domain to fetch its recent posts (e.g.), OR a single post URL to fetch just that one article with full content (e.g.).
routestringUpstream source to run on; omit for "octopus". octopus ($0.00042 + $0.00288 per result, at most $0.289, 99.8% uptime).
octopus
includeContentbooleanInclude the full article body as text, HTML and Markdown. Set false for metadata only, which is faster (e.g. false).
Example: true
limitintegerMaximum number of recent posts to return when given a publication URL (1-100, default 25); ignored for a single post URL, which always returns that one post. You are billed per post returned, so a lower limit costs less.
minReactionsintegerOnly return posts with at least this many reactions (e.g. 100).
contentTypestringRestrict to a single post type, or 'all' (e.g. newsletter).
all · newsletter · podcast · thread
Example: all
onlyFreebooleanReturn only free (non-paywalled) posts (e.g. true).
Example: false
startDatestringOnly return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01). Applied within the most recent 'limit' posts scanned, so raise 'limit' to reach older date ranges.
minCommentsintegerOnly return posts with at least this many comments (e.g. 10).
