Skip to content

Latest commit

 

History

History
1690 lines (1321 loc) · 51 KB

File metadata and controls

1690 lines (1321 loc) · 51 KB
title Command reference
sidebar_label Command reference
toc_max_heading_level 5

The Apify CLI provides tools for managing your Apify projects and resources from the command line. Use these commands to develop Actors locally, deploy them to Apify platform, manage storage, orchestrate runs, and handle account configuration.

This reference guide documents available commands, their options, and common usage patterns, to efficiently work with Apify platform.

General

The general commands provide basic functionality for getting help and information about the Apify CLI.

apify help
DESCRIPTION
  Prints out help about a command, or all available commands.

USAGE
  $ apify help [commandString]

ARGUMENTS
  commandString  The command to get help for.
apify upgrade
DESCRIPTION
  Checks that installed Apify CLI version is up to date.

USAGE
  $ apify upgrade [-f] [--version <value>]

FLAGS
  -f, --force            [DEPRECATED] This flag is now
                         ignored, as running the command manually will always check
                         for the latest version.
      --version=<value>  The version of the CLI to upgrade to. If
                         not provided, the latest version will be used.
apify api
DESCRIPTION
  Makes an authenticated HTTP request to the Apify API and prints the response.
  The endpoint can be a relative path (e.g. "acts", "v2/acts", or "/v2/acts"); 
  the "v2/" prefix is added automatically if omitted.

  Use --list-endpoints to see all available API endpoints.

USAGE
  $ apify api [methodOrEndpoint] [endpoint] [-d <value>]
              [--describe <value> | -l | -s <value>] [-H <value>]
              [-X GET|POST|PUT|PATCH|DELETE] [-p <value>]

ARGUMENTS
  methodOrEndpoint  The API endpoint path (e.g. "acts",
                    "v2/acts", "/v2/users/me"), or an HTTP method followed by the
                    endpoint (e.g. "GET /v2/users/me").
  endpoint          The API endpoint path when the first
                    argument is an HTTP method.

FLAGS
  -d, --body=<value>      The request body (JSON string).
                          Use "-" to read from stdin.
      --describe=<value>  Print a reference for an endpoint
                          path: its HTTP methods, summary, and path parameters.
                          Leading slashes and a version prefix in the path are
                          optional. For example, "actor-runs/{runId}" and
                          "/v2/actor-runs/{runId}" are both accepted.
      -H, --header=<value>    Additional HTTP header(s). Pass a
                          single "key:value" string, or a JSON object like
                          '{"X-Foo": "bar", "X-Baz": "qux"}' to send multiple
                          headers. The flag can only be used once; use the JSON form
                          for multiple headers.
  -l, --list-endpoints    List all available Apify API
                          endpoints.
      -X, --method=<option>   The HTTP method to use. Defaults
                          to GET.
                          <options: GET|POST|PUT|PATCH|DELETE>
  -p, --params=<value>    Query parameters as a JSON object,
                          e.g. '{"limit": 1, "desc": true}'.
  -s, --search=<value>    Filter results returned by
                          --list-endpoints. The query is case-insensitive and split
                          into tokens by spaces. For an endpoint to be returned,
                          every token must appear in that endpoint's method, path,
                          or summary.
apify telemetry
DESCRIPTION
  Enable or disable anonymous telemetry. We use this data to improve the CLI and
   the Apify platform.

SUBCOMMANDS
  telemetry enable   Enables telemetry.
  telemetry disable  Disables telemetry.
apify telemetry enable
DESCRIPTION
  Enables telemetry.

USAGE
  $ apify telemetry enable
apify telemetry disable
DESCRIPTION
  Disables telemetry.

USAGE
  $ apify telemetry disable

Authentication & Account management

Use these commands to manage your Apify account authentication, access tokens, and configuration settings. These commands control how you interact with Apify platform and manage sensitive information.

apify auth
DESCRIPTION
  Log in, log out, and inspect your stored Apify API token. Also available as 
  `apify login` / `apify logout`.

SUBCOMMANDS
  auth login   Authenticates your Apify account and saves credentials
               to '~/.apify/auth.json'.
  auth logout  Removes authentication by deleting your API token and
               account information from '~/.apify/auth.json'.
  auth token   Prints the current API token for the Apify CLI.
apify auth login / apify login
DESCRIPTION
  Authenticates your Apify account and saves credentials to 
  '~/.apify/auth.json'.
  All other commands use these stored credentials.

  Run 'apify logout' to remove authentication.

USAGE
  $ apify auth login [-m console|manual] [-t <value>]

FLAGS
  -m, --method=<option>  Method of logging in to Apify.
                         <options: console|manual>
  -t, --token=<value>    Apify API token.
apify auth logout / apify logout
DESCRIPTION
  Removes authentication by deleting your API token and account information from
   '~/.apify/auth.json'.
  Run 'apify login' to authenticate again.

USAGE
  $ apify auth logout
apify auth token
DESCRIPTION
  Prints the current API token for the Apify CLI.

USAGE
  $ apify auth token
apify info
DESCRIPTION
  Prints details about your currently authenticated Apify account.

USAGE
  $ apify info
apify secrets
DESCRIPTION
  Manage locally stored secrets that can be referenced from '.actor/actor.json' 
  environment variables using the "@" prefix (e.g. "@mySecret"). Secrets are 
  uploaded alongside the Actor and stored encrypted on the Apify platform.

SUBCOMMANDS
  secrets add  Adds a new secret to '~/.apify' for use in Actor
               environment variables.
  secrets ls   Lists all secret keys stored in your local
               configuration.
  secrets rm   Permanently deletes a secret from your stored
               credentials.
apify secrets add
DESCRIPTION
  Adds a new secret to '~/.apify' for use in Actor environment variables.

USAGE
  $ apify secrets add <name> <value>

ARGUMENTS
  name   Name of the secret.
  value  Value of the secret.
apify secrets ls
DESCRIPTION
  Lists all secret keys stored in your local configuration.

USAGE
  $ apify secrets ls [--json]

FLAGS
      --json  Format the command output as JSON.
apify secrets rm
DESCRIPTION
  Permanently deletes a secret from your stored credentials.

USAGE
  $ apify secrets rm <name>

ARGUMENTS
  name  Name of the secret.

Actor development

These commands help you develop Actors locally. Use them to create new Actor projects, initialize configurations, run Actors in development mode, and validate input schemas. This section also includes commands used within running Actors to interact with the Apify platform, such as reading input, storing values, and pushing data.

apify create
DESCRIPTION
  Creates an Actor project from a template in a new directory. The command 
  automatically initializes a git repository in the newly created Actor 
  directory.

USAGE
  $ apify create [actorName] [--omit-optional-deps]
                 [--skip-dependency-install] [--skip-git-init] [-t <value>]

ARGUMENTS
  actorName  Name of the Actor and its directory.

FLAGS
      --omit-optional-deps       Skip installing optional
                                 dependencies.
      --skip-dependency-install  Skip installing Actor
                                 dependencies.
      --skip-git-init            Skip initializing a git
                                 repository in the Actor directory.
  -t, --template=<value>         Template for the
                                 Actor. If not provided, the command will prompt for
                                 it. Visit
                                 https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
                                 to find available template names.
apify init
DESCRIPTION
  Sets up an Actor project in your current directory by creating actor.json and 
  storage files.
  If the directory contains a Scrapy project in Python, the command 
  automatically creates wrappers so that you can run your scrapers without 
  changes.
  Creates the '.actor/actor.json' file and the 'storage' directory in the 
  current directory, but does not touch any other existing files or directories.

  WARNING: Overwrites existing 'storage' directory.

USAGE
  $ apify init [actorName] [--dockerfile <value>] [-y]

ARGUMENTS
  actorName  Name of the Actor. If not provided, you will be prompted
             for it.

FLAGS
      --dockerfile=<value>  Path to a Dockerfile to use for
                            the Actor (e.g., "./Dockerfile" or
                            "./docker/Dockerfile").
  -y, --yes                 Automatic yes to prompts;
                            assume "yes" as answer to all prompts.
apify run
DESCRIPTION
  Executes Actor locally with simulated Apify environment variables.
  Stores data in local 'storage' directory.

  NOTE: For Node.js Actors, customize behavior by modifying the 'start' script 
  in package.json file.

USAGE
  $ apify run [--allow-missing-secrets] [--entrypoint <value>]
              [-i <value> | --input-file <value>] [-p | --resurrect]

FLAGS
      --allow-missing-secrets  Allow the command to
                               continue even when secret values are not found in the
                               local secrets storage.
      --entrypoint=<value>     Optional entrypoint for
                               running with injected environment variables.
                               For Python, it is the module name, or a path to a
                               file.
                               For Node.js, it is the npm script name, or a path to
                               a JS/MJS file. You can also pass in a directory name,
                               provided that directory contains an "index.js" file.
  -i, --input=<value>          Optional JSON input to
                               be given to the Actor.
      --input-file=<value>     Optional path to a file with
                               JSON input to be given to the Actor. The file must be
                               a valid JSON file. You can also specify `-` to read
                               from standard input.
  -p, --purge                  Whether to purge the
                               default request queue, dataset and key-value store
                               before the run starts.
                               For crawlee projects, this is the default behavior,
                               and the flag is optional.
                               Use `--no-purge` to keep the storage folder intact.
      --resurrect              Whether to keep the default
                               request queue, dataset and key-value store before the
                               run starts.
apify validate-schema
DESCRIPTION
  Validates Actor schemas.

  When a path argument is provided, validates only the input schema at that 
  path.

  When no path is provided, validates all schemas found in '.actor/actor.json':
    - Input schema (from "input" key or default locations)
    - Dataset schema (from "storages.dataset")
    - Output schema (from "output")
    - Key-Value Store schema (from "storages.keyValueStore")

USAGE
  $ apify validate-schema [path]

ARGUMENTS
  path  Optional path to your INPUT_SCHEMA.json file. If not provided,
        validates all schemas in '.actor/actor.json'.
apify actor
DESCRIPTION
  Runtime data operations intended to be called from inside a running Actor: 
  read input, push data, get/set records in the default key-value store, charge 
  pay-per-event, generate schema types.

  For platform-level management (deploy, list, call Actors), see 'apify actors' 
  (plural).

SUBCOMMANDS
  actor set-value              Sets or removes a
                               record in the default key-value store associated
                               with the Actor run.
  actor push-data              Saves data to Actor's
                               run default dataset.
  actor get-value              Gets a value from the
                               default key-value store associated with the Actor
                               run.
  actor get-public-url         Get an HTTP URL that
                               allows public access to a key-value store item.
  actor get-input              Gets the Actor input
                               value from the default key-value store associated
                               with the Actor run.
  actor charge                 Charge for a specific
                               event in a pay-per-event Actor run.
  actor calculate-memory       Calculates the Actor’s
                               dynamic memory usage based on a memory expression
                               from actor.json, input data, and run options.
  actor generate-schema-types  Generate TypeScript
                               types from Actor schemas.
apify actor calculate-memory
DESCRIPTION
  Calculates the Actor’s dynamic memory usage based on a memory expression from 
  actor.json, input data, and run options.

USAGE
  $ apify actor calculate-memory [--build <value>]
                                 [--default-memory-mbytes <value>]
                                 [--input <value>] [--max-items <value>]
                                 [--max-total-charge-usd <value>]
                                 [--timeout-secs <value>]

FLAGS
      --build=<value>                  Actor build
                                       version or build tag to evaluate the
                                       expression with.
      --default-memory-mbytes=<value>
                                       Memory-calculation expression (in MB). If
                                       omitted, the value is loaded from the
                                       actor.json file.
      --input=<value>                  Path to the
                                       input JSON file used for the calculation.
      --max-items=<value>              Maximum
                                       number of items Actor can output.
      --max-total-charge-usd=<value>   Maximum
                                       total charge in USD.
      --timeout-secs=<value>           Maximum run
                                       timeout, in seconds.
apify actor charge
DESCRIPTION
  Charge for a specific event in a pay-per-event Actor run.

USAGE
  $ apify actor charge <eventName> [--count <value>]
                       [--idempotency-key <value>] [--test-pay-per-event]

ARGUMENTS
  eventName  Name of the event to charge for.

FLAGS
      --count=<value>            Number of events to
                                 charge.
      --idempotency-key=<value>  Idempotency key for the
                                 charge request.
      --test-pay-per-event       Test pay-per-event
                                 charging without actually charging.
apify actor generate-schema-types
DESCRIPTION
  Generate TypeScript types from Actor schemas.

  Generates types from the input schema and, when no custom path is provided,
  also from the Dataset, Output (experimental), and Key-Value Store 
  (experimental)
  schemas defined in '.actor/actor.json'.

  Reads the input schema from one of these locations (in priority order):
    1. Object in '.actor/actor.json' under "input" key
    2. JSON file path in '.actor/actor.json' "input" key
    3. .actor/INPUT_SCHEMA.json
    4. INPUT_SCHEMA.json

  Optionally specify a custom schema file path, or a directory path.
  When a directory is provided, all schemas are discovered from it
  just as if the command were run from that directory with no argument.

USAGE
  $ apify actor generate-schema-types [path]
                                      [--all-optional] [-o <value>] [--strict]

ARGUMENTS
  path  Optional path to an input schema file or a directory containing
        Actor schemas. If a directory is given, all schema types are generated
        from it. If not provided, searches default locations in the current
        directory.

FLAGS
      --all-optional    Mark all properties as optional in
                        generated types.
  -o, --output=<value>  Directory where the generated files
                        should be outputted. Defaults to src/__generated__/actor/ to
                        stay within the typical tsconfig rootDir.
      --strict          Whether generated interfaces should be
                        strict (no index signature [key: string]: unknown).
apify actor get-input
DESCRIPTION
  Gets the Actor input value from the default key-value store associated with 
  the Actor run.

USAGE
  $ apify actor get-input
apify actor get-public-url
DESCRIPTION
  Get an HTTP URL that allows public access to a key-value store item.

USAGE
  $ apify actor get-public-url <key>

ARGUMENTS
  key  Key of the record in the key-value store.
apify actor get-value
DESCRIPTION
  Gets a value from the default key-value store associated with the Actor run.

USAGE
  $ apify actor get-value <key>

ARGUMENTS
  key  Key of the record in the key-value store.
apify actor push-data
DESCRIPTION
  Saves data to Actor's run default dataset.

USAGE
  $ apify actor push-data [item]

ARGUMENTS
  item  JSON string with one object or array of objects containing data to
        be stored in the default dataset.
apify actor set-value
DESCRIPTION
  Sets or removes a record in the default key-value store associated with the 
  Actor run.

USAGE
  $ apify actor set-value <key> [value] [-c <value>]

ARGUMENTS
  key    Key of the record in key-value store.
  value  Record data, which can be one of the following values:
         - If empty, the record in the key-value store is deleted.
         - If no `contentType` flag is specified, value is expected to be any JSON
         string value.
         - If options.contentType is set, value is taken as is.

FLAGS
  -c, --content-type=<value>  Specifies a custom MIME
                              content type of the record. By default
                              "application/json" is used.

Actor management

These commands let you manage Actors on Apify platform. They provide functionality for deployment, execution, monitoring, and maintenance of your Actors in the cloud environment.

apify actors
DESCRIPTION
  Search, list, deploy, and call Actors on the Apify platform.
  For runtime operations inside a running Actor (push-data, get-input, 
  set-value...), see 'apify actor' (singular).

SUBCOMMANDS
  actors start   Starts Actor remotely and returns run details
                 immediately.
  actors rm      Permanently removes an Actor from your account.
  actors search  Searches Actors in the Apify Store.
  actors push    Deploys Actor to Apify platform using settings
                 from '.actor/actor.json'.
  actors pull    Download Actor code to current directory. Clones
                 Git repositories or fetches Actor files based on the source type.
  actors ls      Prints a list of recently executed Actors or
                 Actors you own.
  actors info    Get information about an Actor.
  actors call    Executes Actor remotely using your authenticated
                 account.
  actors build   Creates a new build of the Actor.
apify actors ls
DESCRIPTION
  Prints a list of recently executed Actors or Actors you own.

USAGE
  $ apify actors ls [--desc] [--json] [--limit <value>] [--my]
                    [--offset <value>]

FLAGS
      --desc            Sort Actors in descending order.
      --json            Format the command output as JSON.
      --limit=<value>   Number of Actors that will be listed.
      --my              Whether to list Actors made by the logged
                        in user.
      --offset=<value>  Number of Actors that will be skipped.
apify actors search
DESCRIPTION
  Searches Actors in the Apify Store.

  Searches the Apify Store for Actors matching the given query. Results can be 
  filtered by category, author, pricing model, and more. This command does not 
  require authentication.

USAGE
  $ apify actors search [query] [--category <value>]
                        [--json] [--limit <value>] [--offset <value>]
                        [--pricing-model <value>] [--sort-by <value>]
                        [--username <value>]

ARGUMENTS
  query  Search query to find Actors by title, name, description, username,
         or readme.

FLAGS
      --category=<value>       Filter by category (e.g.
                               AI).
      --json                   Format the command output as
                               JSON.
      --limit=<value>          Maximum number of results to
                               return.
      --offset=<value>         Number of results to skip
                               for pagination.
      --pricing-model=<value>  Filter by pricing model.
      --sort-by=<value>        Sort order for the results.
      --username=<value>       Filter by Actor author
                               username.
apify actors rm
DESCRIPTION
  Permanently removes an Actor from your account.

USAGE
  $ apify actors rm <actorId> [-y]

ARGUMENTS
  actorId  The Actor ID to delete.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.

Actor deployment

These commands handle the deployment workflow of Actors to Apify platform. Use them to push local changes, pull remote Actors, and manage Actor versions and builds.

apify actors push / apify push
DESCRIPTION
  Deploys Actor to Apify platform using settings from '.actor/actor.json'.
  Files under '3' MB upload as "Multiple source files"; larger projects upload 
  as ZIP file.
  Files matched by .gitignore and .actorignore are excluded. Use negation 
  patterns (e.g. !dist/) in .actorignore to force-include git-ignored files.
  Use --force to override newer remote versions.

USAGE
  $ apify actors push [actorId] [--allow-missing-secrets]
                      [-b <value>] [--dir <value>] [-f] [--json] [--open]
                      [-v <value>] [-w <value>]

ARGUMENTS
  actorId  Name or ID of the Actor to push (e.g. "apify/hello-world" or
           "E2jjCZBezvAZnX8Rb"). If not provided, the command will create or
           modify the Actor with the name specified in '.actor/actor.json' file.

FLAGS
      --allow-missing-secrets    Allow the command to
                                 continue even when secret values are not found in
                                 the local secrets storage.
  -b, --build-tag=<value>        Build tag to be
                                 applied to the successful Actor build. By default,
                                 it is taken from the '.actor/actor.json' file.
      --dir=<value>              Directory where the
                                 Actor is located.
  -f, --force                    Push an Actor even
                                 when the local files are older than the Actor on
                                 the platform.
      --json                     Format the command
                                 output as JSON.
      --open                     Whether to open the
                                 browser automatically to the Actor details page.
  -v, --version=<value>          Actor version number
                                 to which the files should be pushed. By default, it
                                 is taken from the '.actor/actor.json' file.
  -w, --wait-for-finish=<value>  In seconds, how long
                                 to wait for the build to finish. If no value
                                 passed, it waits forever. To return as soon as the
                                 build is queued (fire-and-forget), pass 0. The exit
                                 code reflects the build outcome only — if the wait
                                 elapses with the build still running, the command
                                 exits 0; check status via the printed link or
                                 --json output.
apify actors pull / apify pull
DESCRIPTION
  Download Actor code to current directory. Clones Git repositories or fetches 
  Actor files based on the source type.

USAGE
  $ apify actors pull [actorId] [--dir <value>] [-v <value>]

ARGUMENTS
  actorId  Name or ID of the Actor to run (e.g. "apify/hello-world" or
           "E2jjCZBezvAZnX8Rb"). If not provided, the command will update the
           Actor in the current directory based on its name in ".actor/actor.json"
           file.

FLAGS
      --dir=<value>      Directory where the Actor should be
                         pulled to.
  -v, --version=<value>  Actor version number which will be
                         pulled, e.g. 1.2. Default: the highest version.
apify actors call / apify call
DESCRIPTION
  Executes Actor remotely using your authenticated account.
  Reads input from local key-value store by default.

USAGE
  $ apify actors call [actorId] [-b <value>]
                      [-i <value> | -f <value>] [--json] [-m <value>] [-o] [-s]
                      [-t <value>]

ARGUMENTS
  actorId  Name or ID of the Actor to run (e.g. "my-actor",
           "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
           command runs the remote Actor specified in the '.actor/actor.json'
           file.

FLAGS
  -b, --build=<value>       Tag or number of the build to
                            run (e.g. "latest" or "1.2.34").
  -i, --input=<value>       Optional JSON input to be
                            given to the Actor.
  -f, --input-file=<value>  Optional path to a file with
                            JSON input to be given to the Actor. The file must be a
                            valid JSON file. You can also specify `-` to read from
                            standard input.
      --json                Format the command output as JSON.
  -m, --memory=<value>      Amount of memory allocated for
                            the Actor run, in megabytes.
  -o, --output-dataset      Prints out the entire default
                            dataset on successful run of the Actor.
  -s, --silent              Prevents printing the logs of
                            the Actor run to the console.
  -t, --timeout=<value>     Timeout for the Actor run in
                            seconds. Zero value means there is no timeout.
apify actors start
DESCRIPTION
  Starts Actor remotely and returns run details immediately.
  Uses authenticated account and local key-value store for input.

USAGE
  $ apify actors start [actorId] [-b <value>]
                       [-i <value> | --input-file <value>] [--json] [-m <value>]
                       [-t <value>]

ARGUMENTS
  actorId  Name or ID of the Actor to run (e.g. "my-actor",
           "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
           command runs the remote Actor specified in the '.actor/actor.json'
           file.

FLAGS
  -b, --build=<value>       Tag or number of the build to
                            run (e.g. "latest" or "1.2.34").
  -i, --input=<value>       Optional JSON input to be
                            given to the Actor.
      --input-file=<value>  Optional path to a file with JSON
                            input to be given to the Actor. The file must be a valid
                            JSON file. You can also specify `-` to read from
                            standard input.
      --json                Format the command output as JSON.
  -m, --memory=<value>      Amount of memory allocated for
                            the Actor run, in megabytes.
  -t, --timeout=<value>     Timeout for the Actor run in
                            seconds. Zero value means there is no timeout.
apify actors info
DESCRIPTION
  Get information about an Actor.

USAGE
  $ apify actors info <actorId> [--input | --readme] [--json]

ARGUMENTS
  actorId  The ID of the Actor to return information about.

FLAGS
      --input   Return the Actor input schema.
      --json    Format the command output as JSON.
      --readme  Return the Actor README.

Actor builds

Use these commands to manage Actor build processes. They help you create, monitor, and maintain versioned snapshots of your Actors that can be executed on Apify platform.

apify builds
DESCRIPTION
  Create, inspect, tag, and delete Actor builds on the Apify platform.

SUBCOMMANDS
  builds add-tag     Adds a tag to a specific Actor build.
  builds remove-tag  Removes a tag from a specific Actor build.
  builds rm          Permanently removes an Actor build from
                     the Apify platform.
  builds ls          Lists all builds of the Actor.
  builds log         Prints the log of a specific build.
  builds info        Prints information about a specific build.
  builds create      Creates a new build of the Actor.
  builds wait        Waits for an Actor build to reach a
                     terminal status (SUCCEEDED, FAILED, ABORTED, TIMED-OUT).
apify builds add-tag
DESCRIPTION
  Adds a tag to a specific Actor build.

USAGE
  $ apify builds add-tag -b <value> -t <value>

FLAGS
  -b, --build=<value>  The build ID to tag.
  -t, --tag=<value>    The tag to add to the build.
apify builds create / apify actors build
DESCRIPTION
  Creates a new build of the Actor.

USAGE
  $ apify builds create [actorId] [--json] [--log]
                        [--tag <value>] [--version <value>] [--wait]

ARGUMENTS
  actorId  Optional Actor ID or Name to trigger a build for. By default,
           it will use the Actor from the current directory.

FLAGS
      --json             Format the command output as JSON.
      --log              Whether to print out the build log after
                         the build is triggered.
      --tag=<value>      Build tag to be applied to the
                         successful Actor build. By default, this is "latest".
      --version=<value>  Optional Actor Version to build. By
                         default, this will be inferred from the tag, but this flag
                         is required when multiple versions have the same tag.
      --wait             Wait for the build to reach a terminal
                         status. Returns exit code 0 only when the build SUCCEEDED.
apify builds info
DESCRIPTION
  Prints information about a specific build.

USAGE
  $ apify builds info <buildId> [--json]

ARGUMENTS
  buildId  The build ID to get information about.

FLAGS
      --json  Format the command output as JSON.
apify builds log
DESCRIPTION
  Prints the log of a specific build.

USAGE
  $ apify builds log <buildId>

ARGUMENTS
  buildId  The build ID to get the log from.
apify builds ls
DESCRIPTION
  Lists all builds of the Actor.

USAGE
  $ apify builds ls [actorId] [-c] [--desc] [--json]
                    [--limit <value>] [--offset <value>]

ARGUMENTS
  actorId  Optional Actor ID or Name to list runs for. By default, it
           will use the Actor from the current directory.

FLAGS
  -c, --compact         Display a compact table.
      --desc            Sort builds in descending order.
      --json            Format the command output as JSON.
      --limit=<value>   Number of builds that will be listed.
      --offset=<value>  Number of builds that will be skipped.
apify builds remove-tag
DESCRIPTION
  Removes a tag from a specific Actor build.

USAGE
  $ apify builds remove-tag -b <value> -t <value> [-y]

FLAGS
  -b, --build=<value>  The build ID to remove the tag from.
  -t, --tag=<value>    The tag to remove from the build.
  -y, --yes            Automatic yes to prompts; assume "yes"
                       as answer to all prompts.
apify builds rm
DESCRIPTION
  Permanently removes an Actor build from the Apify platform.

USAGE
  $ apify builds rm <buildId> [-y]

ARGUMENTS
  buildId  The build ID to delete.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.
apify builds wait
DESCRIPTION
  Waits for an Actor build to reach a terminal status (SUCCEEDED, FAILED, 
  ABORTED, TIMED-OUT).
  Returns exit code 0 only when the build SUCCEEDED. Designed for CI and agentic
   workflows.

USAGE
  $ apify builds wait <buildId> [--json]
                      [--poll-interval <value>] [-t <value>]

ARGUMENTS
  buildId  The build ID to wait for.

FLAGS
      --json                   Format the command output as
                               JSON.
      --poll-interval=<value>  In seconds, how often to
                               poll the platform. Defaults to 2.
  -t, --timeout=<value>        In seconds, how long to
                               wait before giving up. If skipped, it waits
                               indefinitely.

Actor runs

These commands control Actor execution on Apify platform. Use them to start, monitor, and manage Actor runs, including accessing logs and handling execution states.

apify runs
DESCRIPTION
  Inspect, abort, resurrect, or delete existing Actor runs.
  Does not start new runs — use 'apify call' (synchronous) or 'apify actors 
  start' (asynchronous) for that.

SUBCOMMANDS
  runs abort      Aborts an Actor run.
  runs info       Prints information about an Actor run.
  runs log        Prints the log of a specific run.
  runs ls         Lists all runs of the Actor.
  runs resurrect  Resurrects an aborted or finished Actor Run.
  runs rm         Deletes an Actor Run.
  runs wait       Waits for an Actor run to reach a terminal
                  status (SUCCEEDED, FAILED, ABORTED, TIMED-OUT).
apify runs abort
DESCRIPTION
  Aborts an Actor run.

USAGE
  $ apify runs abort <runId> [-f] [--json]

ARGUMENTS
  runId  The run ID to abort.

FLAGS
  -f, --force  Whether to force the run to abort immediately, instead
               of gracefully.
      --json   Format the command output as JSON.
apify runs info
DESCRIPTION
  Prints information about an Actor run.

USAGE
  $ apify runs info <runId> [--json] [-v]

ARGUMENTS
  runId  The run ID to print information about.

FLAGS
      --json     Format the command output as JSON.
  -v, --verbose  Prints more in-depth information about the Actor
                 run.
apify runs log
DESCRIPTION
  Prints the log of a specific run.

USAGE
  $ apify runs log <runId>

ARGUMENTS
  runId  The run ID to get the log from.
apify runs ls
DESCRIPTION
  Lists all runs of the Actor.

USAGE
  $ apify runs ls [actorId] [-c] [--desc] [--json]
                  [--limit <value>] [--offset <value>]

ARGUMENTS
  actorId  Optional Actor ID or Name to list runs for. By default, it
           will use the Actor from the current directory.

FLAGS
  -c, --compact         Display a compact table.
      --desc            Sort runs in descending order.
      --json            Format the command output as JSON.
      --limit=<value>   Number of runs that will be listed.
      --offset=<value>  Number of runs that will be skipped.
apify runs resurrect
DESCRIPTION
  Resurrects an aborted or finished Actor Run.

USAGE
  $ apify runs resurrect <runId> [--json]

ARGUMENTS
  runId  The run ID to resurrect.

FLAGS
      --json  Format the command output as JSON.
apify runs rm
DESCRIPTION
  Deletes an Actor Run.

USAGE
  $ apify runs rm <runId> [-y]

ARGUMENTS
  runId  The run ID to delete.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.
apify runs wait
DESCRIPTION
  Waits for an Actor run to reach a terminal status (SUCCEEDED, FAILED, ABORTED,
   TIMED-OUT).
  Returns exit code 0 only when the run SUCCEEDED. Designed for CI and agentic 
  workflows.

USAGE
  $ apify runs wait <runId> [--json] [--poll-interval <value>]
                    [-t <value>]

ARGUMENTS
  runId  The run ID to wait for.

FLAGS
      --json                   Format the command output as
                               JSON.
      --poll-interval=<value>  How often to poll the
                               platform, in seconds. Defaults to 2.
  -t, --timeout=<value>        Maximum seconds to wait
                               before giving up. Without this flag the command waits
                               indefinitely.

Storage

These commands manage data storage on Apify platform. Use them to work with datasets, key-value stores, and request queues for persistent data storage and retrieval.

Datasets

Use these commands to manage datasets, which provide structured storage for tabular data. They enable creation, modification, and data manipulation within datasets.

apify datasets
DESCRIPTION
  Manage Apify datasets — create, list, rename, delete, push items, and download
   items in various formats.

SUBCOMMANDS
  datasets create      Creates a new dataset for storing
                       structured data on your account.
  datasets get-items   Retrieves dataset items in specified
                       format (JSON, CSV, etc).
  datasets ls          Prints all datasets on your account.
  datasets info        Prints information about a specific
                       dataset.
  datasets rm          Permanently removes a dataset.
  datasets rename      Change the dataset name or remove the
                       name with --unname flag.
  datasets push-items  Adds data items to specified dataset.
                       Accepts single object or array of objects.
apify datasets create
DESCRIPTION
  Creates a new dataset for storing structured data on your account.

USAGE
  $ apify datasets create [datasetName] [--json]

ARGUMENTS
  datasetName  Optional name for the Dataset.

FLAGS
      --json  Format the command output as JSON.
apify datasets get-items
DESCRIPTION
  Retrieves dataset items in specified format (JSON, CSV, etc).

USAGE
  $ apify datasets get-items <datasetId>
                             [--format json|jsonl|csv|html|rss|xml|xlsx]
                             [--limit <value>] [--offset <value>]

ARGUMENTS
  datasetId  The ID of the Dataset to export the items for.

FLAGS
      --format=<option>  The format of the returned output. By
                         default, it is set to 'json'.
                         <options: json|jsonl|csv|html|rss|xml|xlsx>
      --limit=<value>    The amount of elements to get from the
                         dataset. By default, it will return all available items.
      --offset=<value>   The offset in the dataset where to start
                         getting items.
apify datasets info
DESCRIPTION
  Prints information about a specific dataset.

USAGE
  $ apify datasets info <storeId> [--json]

ARGUMENTS
  storeId  The dataset store ID to print information about.

FLAGS
      --json  Format the command output as JSON.
apify datasets ls
DESCRIPTION
  Prints all datasets on your account.

USAGE
  $ apify datasets ls [--desc] [--json] [--limit <value>]
                      [--offset <value>] [--unnamed]

FLAGS
      --desc            Sorts datasets in descending order.
      --json            Format the command output as JSON.
      --limit=<value>   Number of datasets that will be listed.
      --offset=<value>  Number of datasets that will be skipped.
      --unnamed         Lists datasets that don't have a name set.
apify datasets push-items
DESCRIPTION
  Adds data items to specified dataset. Accepts single object or array of 
  objects.

USAGE
  $ apify datasets push-items <nameOrId> [item]

ARGUMENTS
  nameOrId  The dataset ID or name to push the objects to.
  item      The object or array of objects to be pushed.
apify datasets rename
DESCRIPTION
  Change the dataset name or remove the name with --unname flag.

USAGE
  $ apify datasets rename <nameOrId> [newName] [--unname]

ARGUMENTS
  nameOrId  The dataset ID or name to delete.
  newName   The new name for the dataset.

FLAGS
      --unname  Removes the unique name of the dataset.
apify datasets rm
DESCRIPTION
  Permanently removes a dataset.

USAGE
  $ apify datasets rm <datasetNameOrId> [-y]

ARGUMENTS
  datasetNameOrId  The dataset ID or name to delete.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.

Key-value stores

These commands handle key-value store operations. Use them to create stores, manage key-value pairs, and handle persistent storage of arbitrary data types.

apify key-value-stores
DESCRIPTION
  Manage Apify key-value stores — create, list, rename, delete stores, and 
  get/set/delete individual records.

  Alias: kvs.

SUBCOMMANDS
  key-value-stores create        Creates a new
                                 key-value store on your account.
  key-value-stores delete-value  Delete a value
                                 from a key-value store.
  key-value-stores get-value     Retrieves stored
                                 value for specified key. Use --only-content-type
                                 to check MIME type.
  key-value-stores info          Shows information
                                 about a key-value store.
  key-value-stores keys          Lists all keys in
                                 a key-value store.
  key-value-stores ls            Lists all
                                 key-value stores on your account.
  key-value-stores rename        Renames a
                                 key-value store, or removes its unique name.
  key-value-stores rm            Permanently
                                 removes a key-value store.
  key-value-stores set-value     Stores value with
                                 specified key. Set content-type with
                                 --content-type flag.
apify key-value-stores create
DESCRIPTION
  Creates a new key-value store on your account.

USAGE
  $ apify key-value-stores create
                                  [key-value store name] [--json]

ARGUMENTS
  key-value store name  Optional name for the key-value
                        store.

FLAGS
      --json  Format the command output as JSON.
apify key-value-stores delete-value
DESCRIPTION
  Delete a value from a key-value store.

USAGE
  $ apify key-value-stores delete-value
                                        <store id> <itemKey> [-y]

ARGUMENTS
  store id  The key-value store ID to delete the value from.
  itemKey   The key of the item in the key-value store.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.
apify key-value-stores get-value
DESCRIPTION
  Retrieves stored value for specified key. Use --only-content-type to check 
  MIME type.

USAGE
  $ apify key-value-stores get-value
                                     <keyValueStoreId> <itemKey>
                                     [--only-content-type]

ARGUMENTS
  keyValueStoreId  The key-value store ID to get the value from.
  itemKey          The key of the item in the key-value store.

FLAGS
      --only-content-type  Only return the content type of the
                           specified key.
apify key-value-stores info
DESCRIPTION
  Shows information about a key-value store.

USAGE
  $ apify key-value-stores info <storeId> [--json]

ARGUMENTS
  storeId  The key-value store ID to print information about.

FLAGS
      --json  Format the command output as JSON.
apify key-value-stores keys
DESCRIPTION
  Lists all keys in a key-value store.

USAGE
  $ apify key-value-stores keys <storeId>
                                [--exclusive-start-key <value>] [--json]
                                [--limit <value>]

ARGUMENTS
  storeId  The key-value store ID to list keys for.

FLAGS
      --exclusive-start-key=<value>  The key to start
                                     the list from.
      --json                         Format the
                                     command output as JSON.
      --limit=<value>                The maximum
                                     number of keys to return.
apify key-value-stores ls
DESCRIPTION
  Lists all key-value stores on your account.

USAGE
  $ apify key-value-stores ls [--desc] [--json]
                              [--limit <value>] [--offset <value>] [--unnamed]

FLAGS
      --desc            Sorts key-value stores in descending
                        order.
      --json            Format the command output as JSON.
      --limit=<value>   Number of key-value stores that will be
                        listed.
      --offset=<value>  Number of key-value stores that will be
                        skipped.
      --unnamed         Lists key-value stores that don't have a
                        name set.
apify key-value-stores rename
DESCRIPTION
  Renames a key-value store, or removes its unique name.

USAGE
  $ apify key-value-stores rename
                                  <keyValueStoreNameOrId> [newName] [--unname]

ARGUMENTS
  keyValueStoreNameOrId  The key-value store ID or name to
                         delete.
  newName                The new name for the key-value
                         store.

FLAGS
      --unname  Removes the unique name of the key-value store.
apify key-value-stores rm
DESCRIPTION
  Permanently removes a key-value store.

USAGE
  $ apify key-value-stores rm <keyValueStoreNameOrId>
                              [-y]

ARGUMENTS
  keyValueStoreNameOrId  The key-value store ID or name to
                         delete.

FLAGS
  -y, --yes  Automatic yes to prompts; assume "yes" as answer to all
             prompts.
apify key-value-stores set-value
DESCRIPTION
  Stores value with specified key. Set content-type with --content-type flag.

USAGE
  $ apify key-value-stores set-value <storeId>
                                     <itemKey> [value] [--content-type <value>]

ARGUMENTS
  storeId  The key-value store ID to set the value in.
  itemKey  The key of the item in the key-value store.
  value    The value to set.

FLAGS
      --content-type=<value>  The MIME content type of the
                              value. By default, "application/json" is assumed.

Request queues

These commands manage request queues, which handle URL processing for web scraping and automation tasks. Use them to maintain lists of URLs with automatic retry mechanisms and state management.

apify request-queues
DESCRIPTION
  Manage Apify request queues. No subcommands are available yet.

USAGE
  $ apify request-queues

Tasks

These commands help you manage scheduled and configured Actor runs. Use them to create, modify, and execute predefined Actor configurations as tasks.

apify task
DESCRIPTION
  Run saved Apify tasks (named Actor configurations). Only 'task run' is 
  available; create and manage tasks in Apify Console.

SUBCOMMANDS
  task run  Executes predefined Actor task remotely using local
            key-value store for input.
apify task run
DESCRIPTION
  Executes predefined Actor task remotely using local key-value store for input.
  Customize with --memory and --timeout flags.

USAGE
  $ apify task run <taskId> [-b <value>] [--json] [-m <value>]
                   [-t <value>]

ARGUMENTS
  taskId  Name or ID of the Task to run (e.g. "my-task" or
          "E2jjCZBezvAZnX8Rb").

FLAGS
  -b, --build=<value>    Tag or number of the build to run
                         (e.g. "latest" or "1.2.34").
      --json             Format the command output as JSON.
  -m, --memory=<value>   Amount of memory allocated for the
                         Task run, in megabytes.
  -t, --timeout=<value>  Timeout for the Task run in seconds.
                         Zero value means there is no timeout.

MCP

Use these commands to configure the Apify MCP server in your AI client.

apify mcp
DESCRIPTION
  Configure the Apify MCP server in your AI client: Claude Code, Cursor, VS 
  Code, Codex CLI, Kiro, or Antigravity.

SUBCOMMANDS
  mcp install  Configure a local MCP client to use the Apify MCP
               server. Writes or merges a server entry named 'apify' into the
               client's config file, or runs the client's own 'mcp add' command
               when available.
apify mcp install
DESCRIPTION
  Configure a local MCP client to use the Apify MCP server. Writes or merges a 
  server entry named 'apify' into the client's config file, or runs the client's
   own 'mcp add' command when available.

USAGE
  $ apify mcp install <client> [-t <value>] [--tools <value>]
                      [--url <value>] [-y]

ARGUMENTS
  client  Target MCP client. One of: claude-code, cursor, vscode,
          vscode-insiders, codex, kiro, antigravity.

FLAGS
  -t, --token=<value>  Apify API token to embed in the config.
                       Defaults to the token from 'apify login'.
      --tools=<value>  Comma-separated tool IDs or Actor full names
                       to expose. Forwarded as a '?tools=' query parameter.
      --url=<value>    Apify MCP server URL.
  -y, --yes            Overwrite an existing 'apify' entry
                       without prompting.