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.json
apify run --input '{"key": "value"}'
apify push
Verify 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 run
apify push
Before 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 @apify/json_schemas (output.schema.json)Dockerfile 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 sectionIf 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.