/apify-pack:apify-hello-worldfrom apify-pack
Runs a public Apify Actor and retrieves scraped data via apify-client. Demonstrates the call-wait-collect pattern for new Apify integrations.
Ships in apify-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run a public Actor from the Apify Store, wait for it to finish, and retrieve the scraped data. This demonstrates the fundamental call-wait-collect pattern used in every Apify integration.
npm install apify-client completedAPIFY_TOKEN environment variable setapify-install-auth if not readyimport { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
// 1. Run an Actor and wait for it to finish
const run = await client.actor('apify/website-content-crawler').call({
startUrls: [{ url: 'https://docs.apify.com/academy' }],
maxCrawlPages: 5,
});
// 2. Retrieve results from the default dataset
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Crawled ${items.length} pages:`);
items.forEach(item => {
console.log(` - ${item.url}: ${item.text?.substring(0, 80)}...`);
});
Create hello-apify.ts (or .js) with the code above.
# With tsx (recommended)
npx tsx hello-apify.ts
# Or with Node.js (plain JS)
node hello-apify.js
The Actor runs on Apify's cloud infrastructure. When it finishes:
run.id — unique run identifierrun.status — SUCCEEDED, FAILED, TIMED-OUT, or ABORTEDrun.defaultDatasetId — ID of the dataset containing resultsrun.defaultKeyValueStoreId — ID of the KV store with metadata| Actor ID | Purpose | Typical Input |
|---|---|---|
apify/website-content-crawler | Crawl and extract text | { startUrls, maxCrawlPages } |
apify/web-scraper | General-purpose scraper | { startUrls, pageFunction } |
apify/cheerio-scraper | Fast HTML scraper | { startUrls, pageFunction } |
apify/google-search-scraper | Google SERP results | { queries, maxPagesPerQuery } |
// SYNCHRONOUS — .call() waits for the Actor to finish (simple, blocking)
const run = await client.actor('apify/web-scraper').call(input);
// ASYNCHRONOUS — .start() returns immediately, poll later
const run = await client.actor('apify/web-scraper').start(input);
// ... do other work ...
const finishedRun = await client.run(run.id).waitForFinish();
// Get all items (paginated internally)
const { items } = await client.dataset(run.defaultDatasetId).listItems();
// Get items with pagination control
const page1 = await client.dataset(run.defaultDatasetId).listItems({
limit: 100,
offset: 0,
});
// Download entire dataset as CSV/JSON/etc.
const buffer = await client.dataset(run.defaultDatasetId).downloadItems('csv');
// Get a named output from the key-value store
const screenshot = await client
.keyValueStore(run.defaultKeyValueStoreId)
.getRecord('screenshot');
const run = await client.actor('apify/web-scraper').call(
input, // Actor-specific input object
{
memory: 1024, // Memory in MB (128–32768, powers of 2)
timeout: 300, // Timeout in seconds (default: Actor's setting)
build: 'latest', // Which build to use
waitSecs: 120, // Max wait for .call() (0 = don't wait)
}
);
| Error | Cause | Solution |
|---|---|---|
Actor not found | Wrong Actor ID | Check ID at apify.com/store |
run.status === 'FAILED' | Actor crashed | Check run.statusMessage for details |
run.status === 'TIMED-OUT' | Exceeded timeout | Increase timeout or reduce workload |
Dataset is empty | Actor produced no output | Verify input parameters; check Actor logs |
402 Payment Required | Insufficient compute units | Top up at console.apify.com/billing |
import { ApifyClient } from 'apify-client';
import { writeFileSync } from 'fs';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
async function scrapeAndSave() {
console.log('Starting Actor run...');
const run = await client.actor('apify/website-content-crawler').call({
startUrls: [{ url: 'https://example.com' }],
maxCrawlPages: 10,
});
if (run.status !== 'SUCCEEDED') {
throw new Error(`Actor run failed: ${run.status} — ${run.statusMessage}`);
}
const { items } = await client.dataset(run.defaultDatasetId).listItems();
writeFileSync('results.json', JSON.stringify(items, null, 2));
console.log(`Saved ${items.length} items to results.json`);
}
scrapeAndSave().catch(console.error);
Proceed to apify-local-dev-loop for local Actor development.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/apify-ci-integrationConfigure CI/CD pipelines for Apify Actor builds and deployments.
Use when automating Actor deployment via GitHub Actions,
running integration tests against Apify, or building CI/CD for scrapers.
Trigger: "apify CI", "apify GitHub Actions", "apify automated deploy",
"CI apify", "apify pipeline", "auto deploy actor".
/apify-common-errorsDiagnose and fix common Apify Actor and API errors.
Use when encountering run failures, API errors, proxy issues,
or Actor crashes on the Apify platform.
Trigger: "apify error", "fix apify", "actor failed",
"apify not working", "debug apify", "apify 429".
/apify-core-workflow-aBuild a complete web scraping Actor with Crawlee and deploy to Apify.
Use when implementing end-to-end scraping: input schema, crawler,
data extraction, dataset output, and platform deployment.
Trigger: "apify scrape website", "build apify actor",
"crawlee scraper", "apify main workflow".
/apify-core-workflow-bManage Apify datasets, key-value stores, and request queues programmatically.
Use when reading/writing datasets, exporting data, managing Actor storage,
or orchestrating multi-Actor pipelines.
Trigger: "apify dataset", "apify key-value store", "apify storage",
"export apify data", "apify pipeline", "apify request queue".
/apify-cost-tuningOptimize Apify platform costs through memory tuning, compute unit management, and proxy budgeting.
Use when analyzing Apify billing, reducing Actor run costs,
or implementing usage monitoring and budget alerts.
Trigger: "apify cost", "apify billing", "reduce apify costs",
"apify pricing", "apify expensive", "apify budget", "compute units".
/apify-debug-bundleCollect Apify debug evidence for support tickets and troubleshooting.
Use when encountering persistent issues, preparing support tickets,
or collecting diagnostic information about failed Actor runs.
Trigger: "apify debug", "apify support bundle", "collect apify logs",
"apify diagnostic", "apify run failed why".
npx claudepluginhub flight505/skill-forge --plugin apify-packOther plugins' skills for the same job