Apify自动化
简介
在Claude Code终端直接运行Apify Actor,自动完成网页抓取与结构化数据提取。
原始描述
Automates web scraping and structured data extraction by running Apify Actors directly from the Claude Code terminal.
通过你的 Agent 添加
安装目录:apify-automation/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: Apify Automation
description: Automate web scraping and data extraction with Apify -- run Actors, manage datasets, create reusable tasks, and retrieve crawl results through the Composio Apify integration.
category: Development & Code Tools
source: composio
tags: [html, api, xlsx, json, mcp, automation, ai, claude]
url: https://github.com/ComposioHQ/awesome-claude-skills/tree/master/apify-automation
Apify Automation
Run Apify web scraping Actors and manage datasets directly from Claude Code. Execute crawlers synchronously or asynchronously, retrieve structured data, create reusable tasks, and inspect run logs without leaving your terminal.
Toolkit docs: composio.dev/toolkits/apify
Setup
- Add the Composio MCP server to your configuration:
https://rube.app/mcp
- Connect your Apify account when prompted. The agent will provide an authentication link.
- Browse available Actors at apify.com/store. Each Actor has its own unique input schema -- always check the Actor's documentation before running.
Core Workflows
1. Run an Actor Synchronously and Get Results
https://rube.app/mcp
1. Run an Actor Synchronously and Get Results
Execute an Actor and immediately retrieve its dataset items in a single call. Best for quick scraping jobs.
Tool: APIFY_RUN_ACTOR_SYNC_GET_DATASET_ITEMS
Key parameters:
actorId(required) -- Actor ID in formatusername/actor-name(e.g.,compass/crawler-google-places)input-- JSON input object matching the Actor's schema. Each Actor has unique field names -- check apify.com/store for the exact schema.limit-- max items to returnoffset-- skip items for paginationformat--json(default),csv,jsonl,html,xlsx,xmltimeout-- run timeout in secondswaitForFinish-- max wait time (0-300 seconds)fields-- comma-separated list of fields to includeomit-- comma-separated list of fields to exclude
Example prompt: "Run the Google Places scraper for 'restaurants in New York' and return the first 50 results"
2. Run an Actor Asynchronously
Trigger an Actor run without waiting for completion. Use for long-running scraping jobs.
Tool: APIFY_RUN_ACTOR
Key parameters:
actorId(required) -- Actor slug or IDbody-- JSON input object for the Actormemory-- memory limit in MB (must be power of 2, minimum 128)timeout-- run timeout in secondsmaxItems-- cap on returned itemsbuild-- specific build tag (e.g.,latest,beta)
Follow up with APIFY_GET_DATASET_ITEMS to retrieve results using the run's datasetId.
Example prompt: "Start the web scraper Actor for example.com asynchronously with 1024MB memory"
3. Retrieve Dataset Items
Fetch data from a specific dataset with pagination, field selection, and filtering.
Tool: APIFY_GET_DATASET_ITEMS
Key parameters:
datasetId(required) -- dataset identifierlimit(default/max 1000) -- items per pageoffset(default 0) -- pagination offsetformat--json(recommended),csv,xlsxfields-- include only specific fieldsomit-- exclude specific fieldsclean-- remove Apify-specific metadatadesc-- reverse order (newest first)
Example prompt: "Get the first 500 items from dataset myDatasetId in JSON format"
4. Inspect Actor Details
View Actor metadata, input schema, and configuration before running it.
Tool: APIFY_GET_ACTOR
Key parameters:
actorId(required) -- Actor ID in formatusername/actor-nameor hex ID
Example prompt: "Show me the details and input schema for the apify/web-scraper Actor"
5. Create Reusable Tasks
Configure reusable Actor tasks with preset inputs for recurring scraping jobs.
Tool: APIFY_CREATE_TASK
Configure a task once, then trigger it repeatedly with consistent input parameters. Useful for scheduled or recurring data collection workflows.
Example prompt: "Create an Apify task for the Google Search scraper with default query 'AI startups' and US location"
6. Manage Runs and Datasets
List Actor runs, browse datasets, and inspect run details for monitoring and debugging.
Tools: APIFY_GET_LIST_OF_RUNS, APIFY_DATASETS_GET, APIFY_DATASET_GET, APIFY_GET_LOG
For listing runs:
- Filter by Actor and optionally by status
- Get
datasetIdfrom run details for data retrieval
For dataset management:
APIFY_DATASETS_GET-- list all your datasets with paginationAPIFY_DATASET_GET-- get metadata for a specific dataset
For debugging:
APIFY_GET_LOG-- retrieve execution logs for a run or build
Example prompt: "List the last 10 runs for the web scraper Actor and show logs for the most recent one"
Known Pitfalls
- Actor input schemas vary wildly: Every Actor has its own unique input fields. Generic field names like
queries or search_terms will be rejected. Always check the Actor's page on apify.com/store for exact field names (e.g., searchStringsArray for Google Maps, startUrls for web scrapers).
- URL format requirements: Always include the full protocol (
https:// or http://) in URLs. Many Actors require URLs as objects with a url property: {"startUrls": [{"url": "https://example.com"}]}.
- Dataset pagination cap:
APIFY_GET_DATASET_ITEMS has a
queries or search_terms will be rejected. Always check the Actor's page on apify.com/store for exact field names (e.g., searchStringsArray for Google Maps, startUrls for web scrapers).https:// or http://) in URLs. Many Actors require URLs as objects with a url property: {"startUrls": [{"url": "https://example.com"}]}.APIFY_GET_DATASET_ITEMS has a