Community研究与数据分析github.com

ComposioHQ/Apify-Automation

通过 Composio 的 Apify 集成,自动化网页抓取和数据提取——运行 Actors、管理数据集、创建可复用任务并获取爬取结果。

Apify-Automation 是什么?

该技能通过 Composio 的 Apify 集成,让 AI 代理(如 Claude Code)能够直接控制 Apify 平台,无需离开终端即可完成网页抓取和数据提取的自动化。 用户可以使用 `APIFY_RUN_ACTOR_SYNC_GET_DATASET_ITEMS` 等工具同步或异步运行 Apify Actors(爬虫),并通过 `APIFY_GET_DATASET_ITEMS` 分页检索结构化数据。技能还支持创建可复用任务(`APIFY_CREATE_TASK`)用于周期性数据采集,以及通过 `APIFY_GET_LIST_OF_RUNS` 和 `APIFY_GET_LOG` 监控运行日志。 它特别强调 Actor 输入模式的多样性,要求用户在使用前查阅 Apify Store 中每个 Actor 的具体字段,并提醒了数据分页上限(每次最多1000条)和同步超时(300秒)等关键限制。该技能适用于任何支持 Composio MCP 集成的 AI Agent 平台,为开发者提供了一套端到端的网页数据采集与管理工作流。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/composio-skills/apify-automation

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Apify 自动化

直接在 Claude Code 中运行 Apify 网页抓取 Actors 并管理数据集。无需离开终端即可同步或异步执行爬虫、检索结构化数据、创建可复用任务以及检查运行日志。

工具包文档: composio.dev/toolkits/apify


设置

  1. 将 Composio MCP 服务器添加到您的配置中:
    https://rube.app/mcp
    
  2. 根据提示连接您的 Apify 账户。代理将提供一个身份验证链接。
  3. 浏览 apify.com/store 上可用的 Actors。每个 Actor 都有自己独特的输入模式——在运行之前务必查阅 Actor 的文档。

核心工作流

1. 同步运行 Actor 并获取结果

在一次调用中执行 Actor 并立即检索其数据集项。最适合快速抓取任务。

工具: APIFY_RUN_ACTOR_SYNC_GET_DATASET_ITEMS

关键参数:

  • actorId(必需)—— Actor ID,格式为 username/actor-name(例如 compass/crawler-google-places)
  • input —— 符合 Actor 模式的 JSON 输入对象。每个 Actor 都有唯一的字段名——请查看 apify.com/store 以获取确切的模式。
  • limit —— 返回的最大项数
  • offset —— 用于分页的跳过的项数
  • format —— json(默认)、csv、jsonl、html、xlsx、xml
  • timeout —— 运行超时时间(秒)
  • waitForFinish —— 最大等待时间(0-300 秒)
  • fields —— 要包含的字段的逗号分隔列表
  • omit —— 要排除的字段的逗号分隔列表

示例提示:“运行 Google Places 抓取器,抓取'纽约的餐厅',并返回前 50 条结果”


2. 异步运行 Actor

触发 Actor 运行而不等待完成。适用于长时间运行的抓取任务。

工具: APIFY_RUN_ACTOR

关键参数:

  • actorId(必需)—— Actor 别名或 ID
  • body —— 提供给 Actor 的 JSON 输入对象
  • memory —— 内存限制(MB),必须是 2 的幂,最小值 128
  • timeout —— 运行超时时间(秒)
  • maxItems —— 返回项数的上限
  • build —— 特定的构建标签(例如 latest、beta)

之后使用 APIFY_GET_DATASET_ITEMS 通过运行的 datasetId 检索结果。

示例提示:“使用 1024MB 内存异步启动 example.com 的网页抓取器 Actor”


3. 检索数据集项

从特定数据集中获取数据,支持分页、字段选择和过滤。

工具: APIFY_GET_DATASET_ITEMS

关键参数:

  • datasetId(必需)—— 数据集标识符
  • limit(默认/最大 1000)—— 每页项数
  • offset(默认 0)—— 分页偏移量
  • format —— json(推荐)、csv、xlsx
  • fields —— 仅包含特定字段
  • omit —— 排除特定字段
  • clean —— 移除 Apify 特定的元数据
  • desc —— 反向排序(最新的在前)

示例提示:“以 JSON 格式从数据集 myDatasetId 中获取前 500 项”


4. 检查 Actor 详情

在运行 Actor 之前查看其元数据、输入模式和配置。

工具: APIFY_GET_ACTOR

关键参数:

  • actorId(必需)—— Actor ID,格式为 username/actor-name 或十六进制 ID

示例提示:“显示 apify/web-scraper Actor 的详细信息和输入模式”


5. 创建可复用任务

使用预设输入配置可复用的 Actor 任务,用于周期性抓取作业。

工具: APIFY_CREATE_TASK

配置一次任务,然后使用一致的输入参数重复触发它。适用于计划或定期执行的数据收集工作流。

示例提示:“为 Google 搜索抓取器创建一个 Apify 任务,使用默认查询'AI startups'和美国位置设置”


6. 管理运行和数据集

列出 Actor 运行、浏览数据集并检查运行详情,用于监控和调试。

工具: APIFY_GET_LIST_OF_RUNS、APIFY_DATASETS_GET、APIFY_DATASET_GET、APIFY_GET_LOG

列出运行:

  • 按 Actor 和可选状态过滤
  • 从运行详情中获取 datasetId 以进行数据检索

数据集管理:

  • APIFY_DATASETS_GET —— 列出所有数据集(支持分页)
  • APIFY_DATASET_GET —— 获取特定数据集的元数据

调试:

  • APIFY_GET_LOG —— 检索运行或构建的执行日志

示例提示:“列出网页抓取器 Actor 最近的 10 次运行,并显示最近一次运行的日志”


已知陷阱

  • Actor 输入模式差异巨大: 每个 Actor 都有自己独特的输入字段。像 queries 或 search_terms 这样的通用字段名会被拒绝。始终在 apify.com/store 上查看 Actor 的页面以获取确切的字段名(例如,Google Maps 的 searchStringsArray,网页抓取器的 startUrls)。
  • URL 格式要求: 在 URL 中始终包含完整协议(https:// 或 http://)。许多 Actor 要求将 URL 作为具有 url 属性的对象:{"startUrls": [{"url": "https://example.com"}]}。
  • 数据集分页限制: APIFY_GET_DATASET_ITEMS 每次调用的 limit 最大为 1000。对于大数据集,使用 offset 循环收集所有项。
  • 枚举值为小写: 大多数 Actor 期望枚举值为小写(例如 relevance 而非 RELEVANCE,all 而非 ALL)。
  • 同步超时为 5 分钟: APIFY_RUN_ACTOR_SYNC_GET_DATASET_ITEMS 的 waitForFinish 最大为 300 秒。对于较长的运行,请使用 APIFY_RUN_ACTOR(异步)并通过 APIFY_GET_DATASET_ITEMS 轮询。
  • 数据量成本: 大数据集获取成本可能很高。建议使用适中的限制和增量处理,以避免超时或内存压力。
  • 推荐 JSON 格式: 尽管 CSV/XLSX 格式可用,但 JSON 是自动化处理最可靠的格式。对于下游自动化,避免使用 CSV/XLSX。

快速参考

工具 Slug描述
APIFY_RUN_ACTOR_SYNC_GET_DATASET_ITEMS同步运行 Actor 并立即获取结果
APIFY_RUN_ACTOR异步运行 Actor(触发并返回)
APIFY_RUN_ACTOR_SYNC同步运行 Actor,返回输出记录
APIFY_GET_ACTOR获取 Actor 元数据和输入模式
APIFY_GET_DATASET_ITEMS从数据集中检索项(分页)
APIFY_DATASET_GET获取数据集元数据(项数等)
APIFY_DATASETS_GET列出所有用户数据集
APIFY_CREATE_TASK创建可复用的 Actor 任务
APIFY_GET_TASK_INPUT检查任务的存储输入
APIFY_GET_LIST_OF_RUNS列出 Actor 的运行
APIFY_GET_LOG获取运行的执行日志

由 Composio 提供支持

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相关技能