search docs
Edit on GitHub

Input and output

Documentation of Apify actors - serverless computing jobs that enable execution of long-running web scraping and automation tasks in the cloud.

Apify actors can accept input and generate output. Both input and output are stored in a key-value store in the actor's apify_storage/key_value_stores/default directory. They are created when the actor is started and can be found under the INPUT and OUTPUT keys, respectively.

Note that the actor can store other values such as crawling results or screenshots of web pages under arbitrary keys.

The key-value store associated with an actor run can be conveniently accessed using the getValue() and setValue() functions provided by the apify NPM package. Internally, these functions read the ID of the key-value store from the APIFY_DEFAULT_KEY_VALUE_STORE_ID environment variable. They then access the key-value store using the Apify API.

For more details about the key-value stores, visit the Storage section.

Passing input

There are three ways to pass input to an actor

  • using the INPUT tab if you are running the actor in the Apify app
  • by creating or editing the INPUT.json file in the key-value store
  • using a POST payload when running the actor using the Apify API