Skip to content

What is the argument for client.actor() ? #527

@timonson

Description

@timonson

I can't find a good explanation inside the documentation what the string for await.client.actor() is. It is a string for a resource. But what resource is this. What does this string mean? Is it unique or secret? Where do I find it? Thanks! Would you mind elaborating please. Thank you!

import { ApifyClient } from "apify-client";

// Initialize the ApifyClient with API token
const client = new ApifyClient({
  token: "apify_api_dku1ovxcbvcvbvcbnxvgnfgjhf6h3ETo5C",
});

// Prepare Actor input
const input = {
  "usernames": [
    "horst_gmbh",
  ],
};

(async () => {
  // Run the Actor and wait for it to finish
  const run = await client.actor("dSCLg0C3YEZ8ghzYX").call(input);

  // Fetch and print Actor results from the run's dataset (if any)
  console.log("Results from dataset");
  const { items } = await client.dataset(run.defaultDatasetId).listItems();
  items.forEach((item) => {
    console.dir(item);
  });
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions