Apify

Run Apify actors and retrieve results

Apify is a powerful platform for building, deploying, and running web automation and web scraping actors at scale. Apify enables you to extract useful data from any website, automate workflows, and connect your data pipelines seamlessly.

With Apify, you can:

  • Run ready-made or custom actors: Integrate public actors or develop your own, automating a wide range of web data extraction and browser tasks.
  • Retrieve datasets: Access and manage structured datasets collected by actors in real time.
  • Scale web automation: Leverage cloud infrastructure to run tasks reliably, asynchronously or synchronously, with robust error handling.

In Sim, the Apify integration allows your agents to perform core Apify operations programmatically:

  • Run Actor (Sync): Use apify_run_actor_sync to launch an Apify actor and wait for its completion, retrieving the results as soon as the run finishes.
  • Run Actor (Async): Use apify_run_actor_async to start an actor in the background and periodically poll for results, suitable for longer or complex jobs.

These operations equip your agents to automate, scrape, and orchestrate data collection or browser automation tasks directly inside workflows — all with flexible configuration and result handling, without the need for manual runs or external tools. Integrate Apify as a dynamic automation and data-extraction engine that programmatically powers your agents' web-scale workflows.

Usage Instructions

Integrate Apify into your workflow. Run any Apify actor or saved task with custom input, fetch dataset items, and check run status. Supports both synchronous and asynchronous execution with automatic dataset fetching.

Tools

apify_run_actor_sync

Run an APIFY actor synchronously and get results (max 5 minutes)

Input

ParameterTypeRequiredDescription
apiKeystringYesAPIFY API token from console.apify.com/account#/integrations
actorIdstringYesActor ID or username/actor-name. Examples: "apify/web-scraper", "janedoe/my-actor", "moJRLRc85AitArpNN"
inputstringNoActor input as JSON string. Example: {"startUrls": [{"url": "https://example.com"\}\], "maxPages": 10}
memorynumberNoMemory in megabytes allocated for the actor run (128-32768). Example: 1024 for 1GB, 2048 for 2GB
timeoutnumberNoTimeout in seconds for the actor run. Example: 300 for 5 minutes, 3600 for 1 hour
buildstringNoActor build to run. Examples: "latest", "beta", "1.2.3", "build-tag-name"

Output

ParameterTypeDescription
successbooleanWhether the actor run succeeded
runIdstringAPIFY run ID
statusstringRun status (SUCCEEDED, FAILED, etc.)
itemsarrayDataset items (if completed)

apify_run_actor_async

Run an APIFY actor asynchronously with polling for long-running tasks

Input

ParameterTypeRequiredDescription
apiKeystringYesAPIFY API token from console.apify.com/account#/integrations
actorIdstringYesActor ID or username/actor-name. Examples: "apify/web-scraper", "janedoe/my-actor", "moJRLRc85AitArpNN"
inputstringNoActor input as JSON string. Example: {"startUrls": [{"url": "https://example.com"\}\], "maxPages": 10}
waitForFinishnumberNoInitial wait time in seconds (0-60) before polling starts. Example: 30
itemLimitnumberNoMax dataset items to fetch (1-250000). Default: 100. Example: 500
memorynumberNoMemory in megabytes allocated for the actor run (128-32768). Example: 1024 for 1GB, 2048 for 2GB
timeoutnumberNoTimeout in seconds for the actor run. Example: 300 for 5 minutes, 3600 for 1 hour
buildstringNoActor build to run. Examples: "latest", "beta", "1.2.3", "build-tag-name"

Output

ParameterTypeDescription
successbooleanWhether the actor run succeeded
runIdstringAPIFY run ID
statusstringRun status (SUCCEEDED, FAILED, etc.)
datasetIdstringDataset ID containing results
itemsarrayDataset items (if completed)

apify_run_task

Run a saved APIFY actor task synchronously and get dataset items (max 5 minutes)

Input

ParameterTypeRequiredDescription
apiKeystringYesAPIFY API token from console.apify.com/account#/integrations
taskIdstringYesTask ID or username/task-name. Examples: "janedoe/my-task", "moJRLRc85AitArpNN"
inputstringNoJSON string that overrides the task's saved input. Example: {"startUrls": [{"url": "https://example.com"\}\]\}
itemLimitnumberNoMax dataset items to return (1-250000). Example: 500
memorynumberNoMemory in megabytes allocated for the run (128-32768). Example: 1024 for 1GB
timeoutnumberNoTimeout in seconds for the run. Example: 300 for 5 minutes
buildstringNoActor build to run. Examples: "latest", "beta", "1.2.3"

Output

ParameterTypeDescription
successbooleanWhether the task run succeeded
statusstringRun status (SUCCEEDED, FAILED, etc.)
itemsarrayDataset items produced by the run

apify_get_dataset_items

Retrieve items stored in an APIFY dataset

Input

ParameterTypeRequiredDescription
apiKeystringYesAPIFY API token from console.apify.com/account#/integrations
datasetIdstringYesDataset ID to read items from. Example: "9RnD3Pql2vGZkc5H5"
itemLimitnumberNoMax items to return (1-250000). Default: all items. Example: 500
offsetnumberNoNumber of items to skip at the start. Default: 0
fieldsstringNoComma-separated list of fields to include. Example: "title,url,price"

Output

ParameterTypeDescription
successbooleanWhether the items were retrieved
datasetIdstringDataset ID the items were read from
itemsarrayItems stored in the dataset
countnumberNumber of items returned

apify_get_run

Get the status and details of an APIFY actor run

Input

ParameterTypeRequiredDescription
apiKeystringYesAPIFY API token from console.apify.com/account#/integrations
runIdstringYesActor run ID to fetch. Example: "HG7ML7M8z78YcAPEB"

Output

ParameterTypeDescription
successbooleanWhether the run was found
runIdstringAPIFY run ID
statusstringRun status (READY, RUNNING, SUCCEEDED, FAILED, etc.)
startedAtstringWhen the run started (ISO timestamp)
finishedAtstringWhen the run finished (ISO timestamp)
datasetIdstringDefault dataset ID for the run
keyValueStoreIdstringDefault key-value store ID for the run
statsjsonRun statistics (memory, CPU, duration)

On this page