Actor

apify/hello-world

  • Builds
  • latest 0.0.10 / 2018-02-05
  • Created 2017-09-12
  • Last modified 2018-09-12
  • grade 6

Description

Hello world act to demonstrate a simple usage of Apify Actor.


API

To run the actor, send a HTTP POST request to:

https://api.apify.com/v2/acts/apify~hello-world/runs?token=<YOUR_API_TOKEN>

The POST payload will be passed as input for the actor. For more information, read the docs.


Example input

Content type: application/json

{ "message": "Hello world!" }

Source code

Based on the apify/actor-node-basic Docker image (see docs).

const Apify = require('apify');

Apify.main(async () => {
    // Get input of your act and print it
    const input = await Apify.getValue('INPUT');
    console.log('My input:');
    console.dir(input);

    // Save the output
    const output = {
        message: "Hello world!"
    };
    await Apify.setValue('OUTPUT', output);
});