All Collections
Integrations
Other ways to integrate
Run actor/task and retrieve data via API
Run actor/task and retrieve data via API

The most common workflow for your integration - run, wait, collect data. Let's look at how to integrate this.

Lukáš Křivka avatar
Written by Lukáš Křivka
Updated over a week ago

Integrating the Apify platform with your system involves accessing it via API. The Apify API provides endpoints that allow you to start your actors or tasks, wait for the run to finish, and retrieve the data.

There are two ways to run your actors and tasks via API:

  1. Synchronously - For runs shorter than 5 minutes. Returns the data automatically.

  2. Asynchronously - For runs over 5 minutes.

To run an actor or task, send a POST request to an endpoint such as https://api.apify.com/v2/acts/ACTOR_NAME_OR_ID/runs?token=YOUR_TOKEN. Include any required input in a JSON object in the request's body.

You can test the API and its endpoints using desktop clients such as Postman.

If you are using a synchronous endpoint, you can relax and wait for your data. Otherwise, you will need to wait for the run to finish using webhooks, polling, or the waitForFinish parameter. Once the run is finished, you can collect your data from its dataset or key-value store.

See the full tutorial and code examples for running actors and tasks via API. You can find a full description of the Apify API in our documentation.

Did this answer your question?