Skool All-in-One API
Full read AND write access to Skool communities via Apify.
Prerequisites
- -
.env file with INLINECODE1 - Node.js 20.6+
- INLINECODE2 CLI tool
CRITICAL: Skool Data Model
Posts and comments are the SAME object in Skool.
- - To read comments: use
posts:getComments — NOT INLINECODE4 - To create a comment: use
posts:createComment — NOT INLINECODE6 - There is NO
comments: namespace. Everything is posts:.
Content is PLAIN TEXT, not HTML.
- - CORRECT: INLINECODE9
- WRONG: INLINECODE10
User mentions: INLINECODE11
Workflow
Copy this checklist and track progress:
CODEBLOCK0
Step 1: Determine Action
Select the action based on user needs:
| User Need | Action | Params |
|---|
| Authentication | | |
| Login to Skool |
auth:login | email, password, groupSlug |
|
Posts | | |
| List posts |
posts:list | page?, sortType? |
| Filter posts (date, unanswered) |
posts:filter | since?, until?, notAnsweredBy?, maxPosts? |
| Get single post |
posts:get | postId |
| Create post |
posts:create | title, content (plain text), labelId? |
| Edit post or comment |
posts:update | postId, title?, content? |
| Delete post or comment |
posts:delete | postId |
| Pin/unpin post |
posts:pin /
posts:unpin | postId |
| Like/unlike |
posts:vote | postId, vote ("up" or "") |
|
Comments | | |
| Get comments (nested tree) |
posts:getComments | postId |
| Reply to post |
posts:createComment | content, rootId=postId, parentId=postId |
| Reply to comment (nested) |
posts:createComment | content, rootId=postId, parentId=commentId |
|
Members | | |
| List members |
members:list | page? |
| List pending applications |
members:pending | (none) |
| Approve member |
members:approve | memberId (use member.memberId, NOT member.id) |
| Reject member |
members:reject | memberId |
| Ban member |
members:ban | memberId |
|
Events | | |
| List calendar events |
events:list | (none) |
| List upcoming events |
events:upcoming | (none) |
Step 2: Authentication
Recommended flow (fast):
- 1. Run
auth:login once to get cookies - Use cookies in all subsequent calls (~2s each instead of ~10s)
- Cookies expire every ~3.5 days — re-login when you get auth errors
CODEBLOCK1
Step 3: Execute Action
With cookies (fast, ~2s):
CODEBLOCK2
With email+password (slower, ~10s, uses Playwright):
CODEBLOCK3
Get results from dataset:
CODEBLOCK4
Step 4: Present Results
Format results based on the action:
- - posts:list — Show title, author, likes, commentCount, url
- posts:getComments — Show nested comment tree with replies
- members:pending — Show name, bio, location, application answers, source
- members:list — Show name, level, points, bio, social links
Common Workflows
Get unanswered posts from last 7 days
To find which posts the user hasn't replied to, you need their Skool user ID.
CODEBLOCK5
How to get USER_ID: Run members:list and find the user by firstName/lastName. The id field (NOT memberId) is what you pass to notAnsweredBy.
Alternative — just get posts with 0 comments:
CODEBLOCK6
Approve pending members
CODEBLOCK7
Reply to a post with user mention
CODEBLOCK8
Reply to a specific comment (nested)
CODEBLOCK9
Important Notes
- 1. memberId vs id: For approve/reject/ban, use
memberId field (membership ID), NOT id (user account ID). They are different. - Content format: Posts and comments use PLAIN TEXT. Never send HTML tags.
- Mentions: Use
[@Name](obj://user/{userId}) format. Get userId from members:list. - Rate limits: Skool limits writes to ~20-30/min. Reads are ~60/min.
- Cookie expiry: Cookies last ~3.5 days. Re-login when you get 403 errors.
- Comment nesting: rootId is ALWAYS the original post ID. parentId is the post (for top-level) or comment (for nested reply).
Actor Details
- - Actor: INLINECODE40
- Actor ID: INLINECODE41
- Apify Store: https://apify.com/cristiantala/skool-all-in-one-api
Skool 全合一 API
通过 Apify 对 Skool 社区进行完整的读写访问。
前置条件
- - 包含 APIFY_TOKEN 的 .env 文件
- Node.js 20.6+
- mcpc CLI 工具
关键:Skool 数据模型
在 Skool 中,帖子和评论是同一个对象。
- - 读取评论:使用 posts:getComments — 而不是 comments:list
- 创建评论:使用 posts:createComment — 而不是 comments:create
- 没有 comments: 命名空间。所有操作都在 posts: 下。
内容是纯文本,不是 HTML。
- - 正确:Hello world
- 错误:
Hello world
用户提及: @显示名称
工作流程
复制此清单并跟踪进度:
任务进度:
- - [ ] 步骤 1:确定所需操作
- [ ] 步骤 2:登录(auth:login)或使用现有 cookies
- [ ] 步骤 3:执行操作
- [ ] 步骤 4:呈现结果
步骤 1:确定操作
根据用户需求选择操作:
auth:login | email, password, groupSlug |
|
帖子 | | |
| 列出帖子 | posts:list | page?, sortType? |
| 筛选帖子(日期、未回复) | posts:filter | since?, until?, notAnsweredBy?, maxPosts? |
| 获取单个帖子 | posts:get | postId |
| 创建帖子 | posts:create | title, content(纯文本), labelId? |
| 编辑帖子或评论 | posts:update | postId, title?, content? |
| 删除帖子或评论 | posts:delete | postId |
| 置顶/取消置顶帖子 | posts:pin / posts:unpin | postId |
| 点赞/取消点赞 | posts:vote | postId, vote(up 或 ) |
|
评论 | | |
| 获取评论(嵌套树形结构) | posts:getComments | postId |
| 回复帖子 | posts:createComment | content, rootId=postId, parentId=postId |
| 回复评论(嵌套) | posts:createComment | content, rootId=postId, parentId=commentId |
|
成员 | | |
| 列出成员 | members:list | page? |
| 列出待审批申请 | members:pending | (无) |
| 批准成员 | members:approve | memberId(使用 member.memberId,不是 member.id) |
| 拒绝成员 | members:reject | memberId |
| 封禁成员 | members:ban | memberId |
|
活动 | | |
| 列出日历活动 | events:list | (无) |
| 列出即将到来的活动 | events:upcoming | (无) |
步骤 2:认证
推荐流程(快速):
- 1. 运行一次 auth:login 获取 cookies
- 在所有后续调用中使用 cookies(每次约 2 秒,而非约 10 秒)
- Cookies 约每 3.5 天过期 — 遇到认证错误时重新登录
bash
登录并获取 cookies
export $(grep APIFY_TOKEN .env | xargs)
RESULT=$(curl -s -X POST https://api.apify.com/v2/acts/cristiantala~skool-all-in-one-api/runs?token=$APIFY_TOKEN&waitForFinish=120 \
-H Content-Type: application/json \
-d {
action: auth:login,
email: 用户邮箱,
password: 用户密码,
groupSlug: 群组标识
})
RUN_ID=$(echo $RESULT | jq -r .data.id)
COOKIES=$(curl -s https://api.apify.com/v2/actor-runs/$RUNID/dataset/items?token=$APIFYTOKEN | jq -r .[0].cookies)
echo Cookies 已保存。有效期约 3.5 天。
步骤 3:执行操作
使用 cookies(快速,约 2 秒):
bash
export $(grep APIFY_TOKEN .env | xargs)
curl -s -X POST https://api.apify.com/v2/acts/cristiantala~skool-all-in-one-api/runs?token=$APIFY_TOKEN&waitForFinish=120 \
-H Content-Type: application/json \
-d {
action: 操作名称,
cookies: 登录获取的COOKIES,
groupSlug: 群组标识,
params: { 参数 }
}
使用邮箱+密码(较慢,约 10 秒,使用 Playwright):
bash
export $(grep APIFY_TOKEN .env | xargs)
curl -s -X POST https://api.apify.com/v2/acts/cristiantala~skool-all-in-one-api/runs?token=$APIFY_TOKEN&waitForFinish=120 \
-H Content-Type: application/json \
-d {
action: 操作名称,
email: 用户邮箱,
password: 用户密码,
groupSlug: 群组标识,
params: { 参数 }
}
从数据集中获取结果:
bash
RUN_ID=$(echo $RESULT | jq -r .data.id)
curl -s https://api.apify.com/v2/actor-runs/$RUNID/dataset/items?token=$APIFYTOKEN | jq .
步骤 4:呈现结果
根据操作格式化结果:
- - posts:list — 显示标题、作者、点赞数、评论数、链接
- posts:getComments — 显示包含回复的嵌套评论树
- members:pending — 显示姓名、简介、位置、申请回答、来源
- members:list — 显示姓名、等级、积分、简介、社交链接
常见工作流程
获取过去 7 天未回复的帖子
要查找用户尚未回复的帖子,需要用户的 Skool 用户 ID。
- 1. auth:login → 保存 cookies
- members:list → 按姓名/邮箱查找用户 → 获取其 id 字段(这是用户 ID,不是 memberId)
- posts:filter 使用参数:
{
since: 2026-03-20T00:00:00Z,
notAnsweredBy: 步骤2获取的用户ID,
maxPosts: 50
}
- 4. 显示筛选后的帖子 — 这些是用户尚未回复的帖子
如何获取用户 ID: 运行 members:list,按 firstName/lastName 查找用户。id 字段(不是 memberId)是传递给 notAnsweredBy 的值。
替代方案 — 仅获取评论数为 0 的帖子:
- 1. auth:login → 保存 cookies
- posts:list 使用参数:{ page: 1 }
- 筛选 commentCount === 0 的结果
批准待审批成员
- 1. auth:login → 保存 cookies
- members:pending → 获取包含申请回答的列表
- 对每个要批准的成员:members:approve 使用参数:{ memberId: member.memberId }
重要提示:使用 member.memberId(成员资格 ID),不是 member.id(用户 ID)
回复帖子并提及用户
- 1. auth:login → 保存 cookies
- posts:createComment 使用参数:
- content: 好观点
@姓名!我同意你的分析。
- rootId: 帖子-id
- parentId: 帖子-id(顶级评论时与 rootId 相同)
回复特定评论(嵌套)
- 1. posts:getComments → 查找评论 ID
- posts:createComment 使用参数:
- content: 感谢分享!
- rootId: 原始帖子-id(始终是根帖子,绝不是评论)
- parentId: 评论-id(你要回复的评论)
重要说明
- 1. memberId 与 id:对于批准/拒绝/封禁,使用 memberId 字段(成员资格 ID),不是 id(用户账户 ID)。两者不同。
- 内容格式:帖子和评论使用纯文本。切勿发送 HTML 标签。
- 提及:使用