Skip to main content

Running Actors

In this section, you'll learn how to run Apify Actors using Apify Console or programmatically. You'll learn about their configuration, versioning, data retention, usage, and pricing.


Run your first Apify Actor

To get started, we recommend trying one of the existing Actors from Apify Store. For details on building your own, see Actor development.

Prerequisites

To complete this tutorial, you need an Apify account. If you don't have it yet, sign up for free.

1. Choose your Actor

To find an Actor in Apify Store:

  1. Sign in to Apify Console.
  2. Go to Apify Store.
  3. Use the search bar or browse by categories.

For this tutorial, let's choose Website Content Crawler.

Apify Store

2. Configure and run your Actor

Once you select the Actor, click Use Actor.

In the Input tab, you can customize your Actor's behavior. Website Content Crawler is pre-configured to run without extra input, so you don't need to change anything.

To run the Actor, click Save & Start.

Actor input

3. Wait for the results

The Actor might take a while to gather results and finish its run. While waiting, let's explore the remaining options:

  • Check the tabs where you can find more information about the Actor run. For example, its logs or storage.
  • Use the API button to view the related API endpoints.

Run

4. Save the results

The results of the Actor run appear in the Output tab.

Actor results

To save the data, click Export. You can choose from multiple formats.

Export results

And that's it! You've run your first Actor!

Now you can go back to the Input tab and try again with different settings, run other Apify Actors, or build your own.

Run Actors with Apify API

To invoke Actors with the Apify API, send an HTTP POST request to the Run Actor endpoint. For example:

https://api.apify.com/v2/acts/compass~crawler-google-places/runs?token=<YOUR_API_TOKEN>

An Actor's input and its content type can be passed as a payload of the POST request, and additional options can be specified using URL query parameters. To learn more, see Run an Actor and retrieve data via API.

Run Actors programmatically

You can also invoke Actors programmatically from your own applications or from other Actors.

To start an Actor from your own application, we recommend using Apify API client libraries for JavaScript or Python.

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
token: 'MY-API-TOKEN',
});

// Start the Google Maps Scraper Actor and wait for it to finish.
const actorRun = await client.actor('compass/crawler-google-places').call({
queries: 'apify',
});
// Fetch scraped results from the Actor's dataset.
const { items } = await client.dataset(actorRun.defaultDatasetId).listItems();
console.dir(items);

The newly started Actor runs under the account associated with the provided token, so all consumed resources are charged to this user account.

Internally, the call() function invokes the Run Actor API endpoint, waits for the Actor to finish, and reads its output using the Get dataset items API endpoint.