Skip to main content
Version: 3.0

apify

npm version Downloads Chat on discord Build Status

Quick Start

This short tutorial will set you up to start using Apify SDK in a minute or two. If you want to learn more, proceed to the Apify Platform guide that will take you step by step through running your Actor on Apify's platform.

Apify SDK requires Node.js 16 or later. Add Apify SDK to any Node.js project by running:

npm install apify

To initialize your Actor and to stop it use the Actor.init() and Actor.exit() functions. You also may use Actor.main() function for cases with multiple crawlers in one context.

import { Actor } from 'apify';

await Actor.init();

const input = (await Actor.getInput()) ?? {};
await Actor.setValue('OUTPUT', {
message: 'Hello from Apify SDK!',
input,
});

await Actor.exit();

You can also install the crawlee module, as it now provides the crawlers that were previously exported by Apify SDK. If you don't plan to use crawlers in your Actors, then you don't need to install it. Keep in mind that neither playwright nor puppeteer are bundled with crawlee in order to reduce install size and allow greater flexibility. That's why we manually install it with NPM. You can choose one, both, or neither. For more information and example please check documentation.

Support

If you find any bug or issue with the Apify SDK, please submit an issue on GitHub. For questions, you can ask on Stack Overflow or contact support@apify.com

Upgrading

Visit the Upgrading Guide to find out what changes you might want to make, and, if you encounter any issues, join our Discord server for help!

Contributing

Your code contributions are welcome, and you'll be praised to eternity! If you have any ideas for improvements, either submit an issue or create a pull request. For contribution guidelines and the code of conduct, see CONTRIBUTING.md.

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details.

Acknowledgments

Many thanks to Chema Balsas for giving up the apify package name on NPM and renaming his project to jsdocify.

Index

Type Aliases

UserFunc

UserFunc<T>: () => Awaitable<T>

Type parameters

  • T = unknown

Type declaration

    • (): Awaitable<T>
    • Returns Awaitable<T>

Page Options