360 Secure SkillHub
360 安全技能中心

Apify Substack Scraper

调用 Apify 上的 Substack 抓取 Actor,按用户给出的出版地址、每刊最大文章数和是否包含正文运行任务,支持同步返回或轮询异步运行状态,最后汇总标题、作者、日期与互动数据并支持 JSON/CSV 导出。需设置 APIFY_TOKEN,并具备 curl 与 jq。

marcindudekdev
marcindudekdev
热度 81.48
最近更新 2026-05-11 17:29:21
分类:搜索依赖:代码执行 / 第三方 API应用场景:研究 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add apify-substack-scraper
Metadata
name
apify-substack-scraper
description
Scrape Substack newsletters and articles. Use when user asks to search Substack, find newsletter posts, extract Substack content, or monitor Substack publications. Requires APIFY_TOKEN environment variable.
metadata
{"openclaw":{"emoji":"📰","requires":{"env":["APIFY_TOKEN"],"bins":["curl","jq"]},"primaryEnv":"APIFY_TOKEN"}}

Substack Scraper

Scrape Substack newsletters using an Apify Actor via the REST API.

Actor ID

BULaGFURBV7WG3K81

Prerequisites

  • APIFY_TOKEN environment variable must be set
  • curl and jq must be available

Workflow

Step 1: Confirm parameters with user

Ask what they want to scrape. Supported input fields:

  • urls (array of strings) - Substack publication URLs to scrape
  • maxArticles (integer) - max articles per publication
  • includeContent (boolean) - include full article text

Step 2: Run the Actor

RESULT=$(curl -s -X POST "https://api.apify.com/v2/acts/BULaGFURBV7WG3K81/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.substack.com"], "maxArticles": 20}')
echo "$RESULT" | jq '.'

Step 3: Poll and fetch (if async)

RUN_ID=$(curl -s -X POST "https://api.apify.com/v2/acts/BULaGFURBV7WG3K81/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.substack.com"], "maxArticles": 100}' | jq -r '.data.id')
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | jq -r '.data.status'
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN" | jq '.'

Step 4: Present results

Summarize articles: titles, authors, dates, engagement. Offer JSON/CSV export.

Error Handling

  • If APIFY_TOKEN not set: export APIFY_TOKEN=your_token
  • If run FAILS: check log endpoint