Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计提醒

apify-js-sdkapify JS SDK 命令行

Agent Skill

apify-js-sdk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

729

周安装

31

GitHub Stars

31

下载量

255
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:apify-js-sdk(apify JS SDK 命令行)
来源仓库:https://github.com/rawveg/skillsforge-marketplace
仓库路径:skills/apify-js-sdk
安装命令:
npx skills add https://github.com/rawveg/skillsforge-marketplace --skill apify-js-sdk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rawveg/skillsforge-marketplace --skill apify-js-sdk

简介

提供对 Apify JavaScript SDK 的全面支持,涵盖网页抓取、爬虫构建和 Actor 开发全流程。

  • 适用于需要创建、管理或部署 Apify 爬虫项目,以及处理数据集、队列和认证逻辑的场景。
  • 集成官方文档资源,支持 Cheerio 解析、API 交互和 Actor 生命周期管理等核心功能。
  • 使用前需确认 API 密钥权限,避免在生产环境直接操作敏感数据或执行高成本爬取任务。
  • apify-js-sdk 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Apify-Js-Sdk Skill

Comprehensive assistance with Apify JavaScript SDK development for web scraping, crawling, and Actor creation. This skill provides access to official Apify documentation covering the API, SDK, and platform features.

When to Use This Skill

This skill should be triggered when:

  • Building web scrapers or crawlers with Apify
  • Working with Apify Actors (creation, management, deployment)
  • Using the Apify JavaScript Client to interact with the Apify API
  • Managing Apify datasets, key-value stores, or request queues
  • Implementing data extraction with Cheerio or other parsing libraries
  • Setting up crawling workflows with link extraction and filtering
  • Debugging Apify code or Actor runs
  • Configuring logging and monitoring for Apify Actors
  • Learning Apify platform best practices

Key Concepts

Actors

Serverless cloud programs running on the Apify platform. Actors can perform various tasks like web scraping, data processing, or automation.

Datasets

Storage for structured data (results from scraping). Each Actor run can have an associated dataset where scraped data is stored.

Key-Value Stores

Storage for arbitrary data like files, screenshots, or configuration. Each Actor run has a default key-value store.

Request Queue

Queue for managing URLs to be crawled. Handles URL deduplication and retry logic automatically.

Apify Client

JavaScript/Python library for interacting with the Apify API programmatically from your code.

Quick Reference

Basic Link Extraction with Cheerio

Extract all links from a webpage using Cheerio:

import * as cheerio from 'cheerio';
import { gotScraping } from 'got-scraping';

const storeUrl = 'https://warehouse-theme-metal.myshopify.com/collections/sales';

const response = await gotScraping(storeUrl);
const html = response.body;

const $ = cheerio.load(html);

// Select all anchor elements
const links = $('a');

// Extract href attributes
for (const link of links) {
    const url = $(link).attr('href');
    console.log(url);
}

Running an Actor with Apify Client

Call an Actor and wait for results:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

// Run an Actor and wait for it to finish
const run = await client.actor('some_actor_id').call();

// Get dataset items from the run
const { items } = await client.dataset(run.defaultDatasetId).listItems();

console.log(items);

Creating and Managing Datasets

Store scraped data in a dataset:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

// Create a new dataset
const dataset = await client.datasets().getOrCreate('my-dataset');

// Add items to the dataset
await client.dataset(dataset.id).pushItems([
    { title: 'Product 1', price: 29.99 },
    { title: 'Product 2', price: 39.99 },
]);

// Retrieve items
const { items } = await client.dataset(dataset.id).listItems();

Key-Value Store Operations

Store and retrieve arbitrary data:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

const store = await client.keyValueStores().getOrCreate('my-store');

// Store a value
await client.keyValueStore(store.id).setRecord({
    key: 'config',
    value: { apiUrl: 'https://api.example.com' },
});

// Retrieve a value
const record = await client.keyValueStore(store.id).getRecord('config');
console.log(record.value);

Logging Configuration

Set up proper logging for Apify Actors:

import logging
from apify.log import ActorLogFormatter

async def main() -> None:
    handler = logging.StreamHandler()
    handler.setFormatter(ActorLogFormatter())

    apify_logger = logging.getLogger('apify')
    apify_logger.setLevel(logging.DEBUG)
    apify_logger.addHandler(handler)

Using the Actor Context

Access Actor run context and storage:

from apify import Actor

async def main() -> None:
    async with Actor:
        # Log messages
        Actor.log.info('Starting Actor run')

        # Access input
        actor_input = await Actor.get_input()

        # Save data to dataset
        await Actor.push_data({
            'url': 'https://example.com',
            'title': 'Example Page'
        })

        # Save to key-value store
        await Actor.set_value('OUTPUT', {'status': 'done'})

Running an Actor Task

Execute a pre-configured Actor task:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

// Run a task with custom input
const run = await client.task('task-id').call({
    startUrls: ['https://example.com'],
    maxPages: 10,
});

console.log(`Task run: ${run.id}`);

Redirecting Logs from Called Actors

Redirect logs from a called Actor to the parent run:

from apify import Actor

async def main() -> None:
    async with Actor:
        # Default redirect logger
        await Actor.call(actor_id='some_actor_id')

        # No redirect logger
        await Actor.call(actor_id='some_actor_id', logger=None)

        # Custom redirect logger
        await Actor.call(
            actor_id='some_actor_id',
            logger=logging.getLogger('custom_logger')
        )

Getting Actor Run Details

Retrieve information about an Actor run:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

// Get run details
const run = await client.run('run-id').get();

console.log(`Status: ${run.status}`);
console.log(`Started: ${run.startedAt}`);
console.log(`Finished: ${run.finishedAt}`);

Listing Actor Builds

Get all builds for a specific Actor:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

const { items } = await client.actor('actor-id').builds().list({
    limit: 10,
    desc: true,
});

for (const build of items) {
    console.log(`Build ${build.buildNumber}: ${build.status}`);
}

Reference Files

This skill includes comprehensive documentation in the references/ directory:

llms-txt.md

Complete API reference documentation with detailed information on:

  • Actor Management: Creating, updating, and running Actors
  • Builds: Managing Actor builds and versions
  • Runs: Controlling Actor execution and monitoring
  • Tasks: Pre-configured Actor executions
  • Datasets: Structured data storage and retrieval
  • Key-Value Stores: Arbitrary data storage
  • Request Queues: URL queue management
  • Client SDK: JavaScript/Python client libraries
  • Logging: Configuring and managing logs

llms-full.md

Extensive documentation covering:

  • Complete Apify API v2 reference
  • All API endpoints with request/response examples
  • Authentication and rate limiting
  • Error handling
  • Webhooks and integrations

llms.md

High-level overview and getting started guide with:

  • Platform concepts and architecture
  • Quick start examples
  • Common patterns and workflows
  • Best practices for web scraping

Working with This Skill

For Beginners

Start with these concepts:

  1. Understanding Actors: Review the Actors introduction to learn about the core building block
  2. First Scraper: Use the link extraction examples to build your first web scraper
  3. Data Storage: Learn about Datasets and Key-Value Stores for storing results
  4. API Basics: Get familiar with the Apify Client for programmatic access

Key reference: llms.md for platform overview and getting started guides

For Intermediate Users

Focus on these areas:

  1. Advanced Crawling: Implement request queues and link filtering
  2. Actor Tasks: Set up pre-configured runs with custom inputs
  3. Logging: Configure proper logging with ActorLogFormatter
  4. Error Handling: Implement retry logic and error recovery
  5. Webhooks: Set up notifications for Actor run events

Key reference: llms-txt.md for detailed API methods and parameters

For Advanced Users

Explore these topics:

  1. Actor Builds: Manage versions and deployments
  2. Metamorph: Transform running Actors into different Actors
  3. Custom Integrations: Build complex workflows with the API
  4. Performance Optimization: Tune concurrency and resource usage
  5. Multi-Actor Orchestration: Chain multiple Actors together

Key reference: llms-full.md for complete API endpoint reference

Navigation Tips

  • Search by concept: Use keywords like "dataset", "actor", "build" to find relevant sections
  • Check examples: Look for code blocks in the documentation for working examples
  • API endpoints: All endpoints follow the pattern /v2/{resource}/{action}
  • Client methods: SDK methods mirror API endpoints (e.g., client.actor().run())

Common Patterns

Web Scraping Workflow

  1. Set up the crawler with initial URLs
  2. Extract links from pages
  3. Filter and enqueue new URLs
  4. Extract data from pages
  5. Store results in a dataset
  6. Handle errors and retries

Actor Development Workflow

  1. Create Actor locally or in Apify Console
  2. Write scraping logic with Cheerio/Puppeteer
  3. Test locally with sample data
  4. Build and deploy to Apify platform
  5. Create tasks for different configurations
  6. Monitor runs and debug issues

Data Pipeline Pattern

  1. Run an Actor to scrape data
  2. Store results in a dataset
  3. Call another Actor to process the data
  4. Export final results to external system
  5. Use webhooks to trigger next steps

Resources

Official Documentation

  • API Reference: Complete API v2 documentation at https://docs.apify.com/api/v2
  • SDK Docs: JavaScript and Python SDK documentation
  • Academy: Web scraping tutorials and best practices
  • Examples: Ready-to-use Actor templates

Getting Help

  • Check the reference files for detailed API documentation
  • Review code examples for common patterns
  • Use the Apify Console for visual debugging
  • Monitor Actor runs with detailed logs

Notes

  • This skill was automatically generated from official Apify documentation
  • Reference files preserve structure and examples from source docs
  • Code examples include proper language detection for syntax highlighting
  • Documentation covers both JavaScript and Python SDKs
  • API version 2 is the current stable version

Best Practices

  1. Always use API tokens for authentication (never hardcode)
  2. Handle rate limits appropriately (respect platform quotas)
  3. Store credentials securely using Actor secrets
  4. Log appropriately (INFO for progress, DEBUG for details)
  5. Clean up resources (close stores/datasets when done)
  6. Use request queues for large-scale crawling
  7. Implement retries for failed requests
  8. Monitor Actor memory usage to prevent crashes

Updating

To refresh this skill with updated documentation:

  1. Re-run the documentation scraper with the same configuration
  2. The skill will be rebuilt with the latest information
  3. Review the updated reference files for new features

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.31%
按下载量换算75

Antigravity

24.07%
按下载量换算61

OpenCode

18.53%
按下载量换算47

Gemini CLI

11.85%
按下载量换算30

windsurf

7.97%
按下载量换算20

Codex

3.74%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills