Apify icon

Apify

Apify API

Overview

This node executes an Apify actor task synchronously and retrieves the resulting dataset items. It is useful for running predefined automation or scraping tasks on the Apify platform and immediately obtaining the output data for further processing or analysis. For example, you can run a web scraping task to collect product data and get the results directly in your workflow.

Use Case Examples

  1. Run a web scraping actor task by specifying its ID and retrieve the scraped data as JSON.
  2. Execute a data extraction task with a custom timeout and memory limit, then get the results in CSV format.
  3. Run a task with specific output formatting options like field selection, unwinding nested arrays, and skipping empty or hidden fields.

Properties

Name Meaning
Actor Task ID The ID or a tilde-separated owner's username and task's name identifying the actor task to run.
Timeout Optional timeout for the task run in seconds, overriding the task's default timeout.
Memory Memory limit for the task run in megabytes, overriding the task's default memory setting.
Max Items Maximum number of dataset items to return from the task run, useful for limiting pay-per-result costs.
Build Specifies the actor build to run, either by tag or build number, defaulting to the task's configured build.
Webhooks Base64-encoded JSON array defining optional webhooks to receive notifications about the actor run status.
Format Format of the results to return, such as json, jsonl, csv, html, xlsx, xml, or rss.
Clean If true, returns only non-empty items and skips hidden fields (fields starting with #).
Offset Number of items to skip at the start of the dataset results.
Limit Maximum number of items to return from the dataset.
Fields Comma-separated list of fields to include in the output items, fixing the output format.
Omit Comma-separated list of fields to omit from the output items.
Unwind Comma-separated list of fields to unwind, expanding arrays or merging objects into separate records.
Flatten Comma-separated list of fields to flatten nested objects into flat structures.
Desc If true, returns results in reverse order.
Attachment If true, sets the response header to force file download instead of display.
Delimiter Delimiter character for CSV format files.
Bom If true, includes UTF-8 Byte Order Mark in CSV files.
Xml Root Overrides the root element name in XML output.
Xml Row Overrides the element name wrapping each item in XML output.
Skip Header Row If true, skips the header row in CSV output.
Skip Hidden If true, skips fields starting with # in the output.
Skip Empty If true, skips empty items in the output.
Simplified If true, applies legacy parameters to emulate simplified results from the Apify Crawler product.
Skip Failed Pages If true, skips items with errorInfo property, emulating legacy API behavior.
Use Custom Body If true, sends a custom JSON body in the request.
Custom Body Custom JSON body to send if 'Use Custom Body' is enabled.

Output

JSON

  • items - Array of dataset items returned by the actor task run.

Dependencies

  • Apify API key credential

Troubleshooting

  • Ensure the Actor Task ID is valid and accessible with the provided API credentials.
  • Timeout errors may occur if the task takes longer than the specified timeout parameter; increase the timeout if needed.
  • Memory limit errors can happen if the task requires more memory than specified; adjust the memory parameter accordingly.
  • Invalid format or field parameters may cause the API to reject the request; verify parameter values against the API documentation.
  • If using custom body, ensure the JSON is correctly formatted to avoid request errors.

Links

Discussion