Skip to main content
Version: 1.8

Quick start

Learn how to create, run, and deploy Actors using Apify CLI.

Before you start

1. Create an Actor

To create an Actor, run the following command in your terminal:

apify create

The CLI then asks you for the following:

  1. Name your Actor. Use lowercase letters, numbers, and hyphens.
  2. Select a type of Actor to create: web scraper, AI agent, API and data pipeline, or browser automation. Let's choose web scraper.
  3. Choose the programming language: JavaScript, TypeScript, or Python. Let's choose JavaScript.
  4. Based on your choice, the CLI suggests Actor templates. For this tutorial, let's choose Crawlee and Cheerio.
Explore Actor templates

To find a template that best suits your needs, browse the full list of templates.

The CLI creates a new directory with the boilerplate code and installs all project dependencies.

2. Run your Actor

When you run the code locally, the results of the Actor run are saved to your disk.

  1. Navigate to the Actor directory:

    cd your-actor-name
  2. Run your Actor:

    apify run

View the results

Local runs store their data in the storage directory:

PathContents
storage/datasets/default/Results the Actor added to its default dataset. One JSON file per item.
storage/key_value_stores/default/Records the Actor read or wrote, including its input.
storage/request_queues/default/Requests the Actor enqueued.

3. Deploy your Actor

By deploying your Actor to the Apify platform, you can run your code on Apify's infrastructure, schedule runs, and monitor logs and stored data.

Log in to Apify Console

To log in, run:

apify login

You can then choose one of the following methods:

  • (Recommended) Sign in through the Apify Console in your browser.
  • Provide an Apify API token.

Push your Actor to Apify

To upload your Actor's source code and build it on the Apify platform, run:

apify push

The CLI creates the Actor in your account, shows the build log, and prints a link to your Actor in Apify Console when the build succeeds.

Next steps