apify-actorization by apify/agent-skills
npx skills add https://github.com/apify/agent-skills --skill apify-actorizationActor 化将现有软件转换为可在 Apify 平台上运行的可重用无服务器应用程序。Actor 是打包为 Docker 镜像的程序,它们接受定义良好的 JSON 输入,执行操作,并可选择性地生成结构化的 JSON 输出。
apify init.actor/input_schema.jsonapify run --input '{"key": "value"}' 进行测试apify push 部署验证 apify CLI 是否已安装:
apify --help
如果未安装:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
curl -fsSL https://apify.com/install-cli.sh | bash
# 或者 (Mac): brew install apify-cli
# 或者 (Windows): irm https://apify.com/install-cli.ps1 | iex
# 或者: npm install -g apify-cli
验证 CLI 是否已登录:
apify info # 应返回您的用户名
如果未登录,检查 APIFY_TOKEN 环境变量是否已定义。如果未定义,请让用户在 https://console.apify.com/settings/integrations 生成一个,然后:
apify login -t $APIFY_TOKEN
复制此清单以跟踪进度:
apify init 以创建 Actor 结构.actor/input_schema.json.actor/output_schema.json(如果适用).actor/actor.json 元数据apify run 在本地测试apify push 部署在进行更改之前,请先了解项目:
在项目根目录运行:
apify init
这将创建:
.actor/actor.json - Actor 配置和元数据.actor/input_schema.json - Apify 控制台的输入定义Dockerfile(如果不存在)- 容器镜像定义根据项目语言选择:
| 语言 | 安装 | 包装代码 |
|---|---|---|
| JS/TS | npm install apify | await Actor.init() ... await Actor.exit() |
| Python | pip install apify | async with Actor: |
| 其他 | 在包装脚本中使用 CLI | apify actor:get-input / apify actor:push-data |
有关以下内容的详细配置,请参见 schemas-and-output.md:
.actor/input_schema.json).actor/output_schema.json).actor/actor.json)根据 @apify/json_schemas npm 包验证模式。
使用内联输入运行 actor(适用于 JS/TS 和 Python actor):
apify run --input '{"startUrl": "https://example.com", "maxItems": 10}'
或使用输入文件:
apify run --input-file ./test-input.json
重要提示: 始终使用 apify run,而不是 npm start 或 python main.py。CLI 会设置适当的环境和存储。
apify push
这将在 Apify 平台上上传并构建您的 actor。
部署后,您可以在 Apify 商店中为您的 actor 实现货币化。推荐的模型是 按事件付费 (PPE) :
在 Apify 控制台的 Actor > 货币化下配置 PPE。在代码中使用 await Actor.charge('result') 对事件收费。
其他选项:租赁(月度订阅)或 免费(开源)。
.actor/actor.json 存在且名称和描述正确.actor/actor.json 根据 @apify/json_schemas (actor.schema.json) 验证通过.actor/input_schema.json 定义了所有必需的输入.actor/input_schema.json 根据 @apify/json_schemas (input.schema.json) 验证通过.actor/output_schema.json 定义了输出结构(如果适用).actor/output_schema.json 根据 @apify/json_schemas (output.schema.json) 验证通过Dockerfile 存在且构建成功Actor.init() / Actor.exit() 包装了主代码(JS/TS)async with Actor: 包装了主代码(Python)Actor.getInput() / Actor.get_input() 读取输入Actor.pushData() 或键值存储apify run 使用测试输入成功执行generatedBy 已在 actor.json 的 meta 部分设置如果配置了 MCP 服务器,请使用以下工具获取文档:
search-apify-docs - 搜索文档fetch-apify-docs - 获取完整的文档页面否则,MCP 服务器 URL 为:https://mcp.apify.com/?tools=docs。
每周安装量
1.6K
仓库
GitHub 星标
1.6K
首次出现
Jan 29, 2026
安全审计
安装于
opencode1.6K
codex1.5K
gemini-cli1.5K
github-copilot1.5K
cursor1.5K
kimi-cli1.4K
Actorization converts existing software into reusable serverless applications compatible with the Apify platform. Actors are programs packaged as Docker images that accept well-defined JSON input, perform an action, and optionally produce structured JSON output.
apify init in project root.actor/input_schema.jsonapify run --input '{"key": "value"}'apify pushVerify apify CLI is installed:
apify --help
If not installed:
curl -fsSL https://apify.com/install-cli.sh | bash
# Or (Mac): brew install apify-cli
# Or (Windows): irm https://apify.com/install-cli.ps1 | iex
# Or: npm install -g apify-cli
Verify CLI is logged in:
apify info # Should return your username
If not logged in, check if APIFY_TOKEN environment variable is defined. If not, ask the user to generate one at https://console.apify.com/settings/integrations, then:
apify login -t $APIFY_TOKEN
Copy this checklist to track progress:
apify init to create Actor structure.actor/input_schema.json.actor/output_schema.json (if applicable).actor/actor.json metadataapify runapify pushBefore making changes, understand the project:
Run in the project root:
apify init
This creates:
.actor/actor.json - Actor configuration and metadata.actor/input_schema.json - Input definition for the Apify ConsoleDockerfile (if not present) - Container image definitionChoose based on your project's language:
| Language | Install | Wrap Code |
|---|---|---|
| JS/TS | npm install apify | await Actor.init() ... await Actor.exit() |
| Python | pip install apify | async with Actor: |
| Other | Use CLI in wrapper script | apify actor:get-input / apify actor:push-data |
See schemas-and-output.md for detailed configuration of:
.actor/input_schema.json).actor/output_schema.json).actor/actor.json)Validate schemas against @apify/json_schemas npm package.
Run the actor with inline input (for JS/TS and Python actors):
apify run --input '{"startUrl": "https://example.com", "maxItems": 10}'
Or use an input file:
apify run --input-file ./test-input.json
Important: Always use apify run, not npm start or python main.py. The CLI sets up the proper environment and storage.
apify push
This uploads and builds your actor on the Apify platform.
After deploying, you can monetize your actor in the Apify Store. The recommended model is Pay Per Event (PPE) :
Configure PPE in the Apify Console under Actor > Monetization. Charge for events in your code with await Actor.charge('result').
Other options: Rental (monthly subscription) or Free (open source).
.actor/actor.json exists with correct name and description.actor/actor.json validates against @apify/json_schemas (actor.schema.json).actor/input_schema.json defines all required inputs.actor/input_schema.json validates against @apify/json_schemas (input.schema.json).actor/output_schema.json defines output structure (if applicable).actor/output_schema.json validates against ()If MCP server is configured, use these tools for documentation:
search-apify-docs - Search documentationfetch-apify-docs - Get full doc pagesOtherwise, the MCP Server url: https://mcp.apify.com/?tools=docs.
Weekly Installs
1.6K
Repository
GitHub Stars
1.6K
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
opencode1.6K
codex1.5K
gemini-cli1.5K
github-copilot1.5K
cursor1.5K
kimi-cli1.4K
99,500 周安装
@apify/json_schemasoutput.schema.jsonDockerfile is present and builds successfullyActor.init() / Actor.exit() wraps main code (JS/TS)async with Actor: wraps main code (Python)Actor.getInput() / Actor.get_input()Actor.pushData() or key-value storeapify run executes successfully with test inputgeneratedBy is set in actor.json meta section