Skip to main content
This is documentation for SDK for JavaScript | Apify Documentation 2.3, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.4).
Version: 2.3

Accept user input

This example accepts and logs user input:

const { Actor } = require('apify');

Actor.main(async () => {
const input = await Actor.getInput();
console.log(input);
});

To provide the actor with input, create a INPUT.json file inside the "default" key-value store:

{PROJECT_FOLDER}/apify_storage/key_value_stores/default/INPUT.json

Anything in this file will be available to the actor when it runs.

To learn about other ways to provide an actor with input, refer to the Apify Platform Documentation.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.