Apify icon

Apify

Apify API

Overview

This node allows users to run an Apify Actor synchronously with specified input parameters and retrieve dataset items generated by the run. It is useful for automating web scraping, data extraction, or any task encapsulated in an Apify Actor, where you want to trigger the Actor execution and immediately get the results for further processing in an n8n workflow.

Use Case Examples

  1. Run a web scraping Actor to extract product data from an e-commerce site and get the scraped items as output.
  2. Trigger a data transformation Actor with custom input and retrieve the processed dataset items for analysis.

Properties

Name Meaning
Actor ID The identifier of the Actor to run, which can be an Actor ID, a tilde-separated owner's username and Actor name, or a URL pointing to the Actor.
Timeout Optional timeout for the Actor run in seconds.
Memory Memory limit for the Actor run in megabytes.
Max Items Maximum number of items the Actor run should return, useful for limiting pay-per-result costs.
Build Specifies the Actor build to run, either by tag or build number.
Webhooks Base64-encoded JSON array defining optional webhooks for notifications on Actor run events.
Format Format of the results, e.g., json, jsonl, csv, html, xlsx, xml, rss.
Clean If true, returns only non-empty items and skips hidden fields.
Offset Number of items to skip at the start of the dataset.
Limit Maximum number of items to return from the dataset.
Fields Comma-separated list of fields to include in the output items.
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, forces the response to be downloaded as a file.
Delimiter Delimiter character for CSV format results.
Bom Include or exclude UTF-8 Byte Order Mark in text responses.
Xml Root Overrides the root element name for 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 error information from the output.
Use Custom Body Whether to use a custom JSON body for the Actor run request.
Custom Body Custom JSON body to send with the Actor run request if 'Use Custom Body' is true.

Output

JSON

  • items - Array of dataset items returned by the Actor run.

Dependencies

  • Requires Apify API credentials (API key) to authenticate requests.

Troubleshooting

  • Ensure the Actor ID or URL is valid and accessible with the provided API credentials.
  • Timeout errors may occur if the Actor run takes longer than the specified timeout parameter; increase timeout if needed.
  • Memory limits should be set according to the Actor's requirements; insufficient memory may cause run failures.
  • If using custom body, ensure the JSON is correctly formatted to avoid request errors.

Links

Discussion