Apify icon

Apify

Apify API

Overview

This node operation runs an Apify actor task synchronously and retrieves dataset items generated by the task run. It is useful for automating data extraction workflows where you want to trigger a task and immediately get the processed results for further automation or analysis. For example, you can run a web scraping actor task and get the scraped data items directly in your workflow.

Use Case Examples

  1. Run an Apify actor task by specifying its ID or URL and get the resulting dataset items in JSON format for processing in subsequent workflow steps.
  2. Limit the number of returned dataset items to control costs in pay-per-result scenarios.
  3. Customize the output format (e.g., JSON, CSV, XML) and apply filters like field selection, skipping empty or hidden fields, and flattening nested objects.

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 synchronously.
Timeout Optional timeout for the task run in seconds; overrides the task's default timeout.
Memory Memory limit for the task run in megabytes; overrides the task's default memory setting.
Max Items Maximum number of dataset items to return from the task run, useful for pay-per-result tasks.
Build Specifies the actor build to run, either by tag or build number; defaults to the task's configured build.
Webhooks Base64-encoded JSON array defining optional webhooks for notifications on actor run events.
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; no limit by default.
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 (expand arrays or 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, forces the response to be downloaded as a file via Content-Disposition header.
Delimiter Delimiter character for CSV format output.
Bom Include or exclude UTF-8 Byte Order Mark (BOM) in text responses.
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 # from the output.
Skip Empty If true, skips empty items from the output.
Simplified If true, applies legacy parameters to emulate simplified results from the legacy Apify Crawler product.
Skip Failed Pages If true, skips items with errorInfo property from the output.
Use Custom Body Whether to use a custom request body for the task run.

Output

JSON

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

Dependencies

  • Requires Apify API credentials (API key) for authentication.

Troubleshooting

  • Invalid Actor Task ID or URL will cause errors; ensure the ID or URL is correct and accessible.
  • Timeout errors may occur if the task run exceeds the specified timeout; increase the timeout or check task performance.
  • Memory limit errors if the specified memory is too low; increase memory allocation as needed.
  • Incorrect format or malformed webhooks JSON may cause webhook failures; validate webhook configuration.
  • If no items are returned, check if the task run completed successfully and produced output data.

Links

Discussion