> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Apify Integration for AI Agents & Workflows

> Web scraping, automation, and data extraction platform via the Apify REST API

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img className="block dark:hidden" src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/apify-light.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=38762cab8ef4ee401c286fc3e3c0380a" alt="Apify logo" width="72" height="72" data-path="logos/apify-light.svg" />

<img className="hidden dark:block" src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/apify-dark.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=e68dfb314865651f3489a08ae506ad3b" alt="Apify logo" width="72" height="72" data-path="logos/apify-dark.svg" />

## Overview

Add **Apify** to any ModuleX agent or workflow. Web scraping, automation, and data extraction platform via the Apify REST API (`api.apify.com/v2`).

<Info>
  **Categories**: Web Search & Scraping · Developer Tools & Infrastructure · Automation · **Auth**: API Token · **Actions**: 7
</Info>

## Authentication

### API Token

Authenticate using your Apify API token

<Steps>
  <Step title="Step 1">
    Go to [https://console.apify.com/account/integrations](https://console.apify.com/account/integrations)
  </Step>

  <Step title="Step 2">
    Copy your Personal API token
  </Step>
</Steps>

#### Required Credentials

| Field     | Description                                     | Required | Format                                           |
| --------- | ----------------------------------------------- | -------- | ------------------------------------------------ |
| API Token | Your Apify API token from the Integrations page | Yes      | `apify_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |

## Available Actions

<AccordionGroup>
  <Accordion title="run_actor — Run an Apify Actor and return the run metadata">
    ### Parameters

    <ResponseField name="actor_id" type="string" required>
      The Actor ID or tilde-separated owner/name identifier (e.g. 'apify\~web-scraper')
    </ResponseField>

    <ResponseField name="run_input" type="object">
      JSON object with the input for the Actor run
    </ResponseField>

    <ResponseField name="build_tag" type="string">
      Specifies the Actor build to run. If not provided, the default build is used.
    </ResponseField>

    <ResponseField name="run_asynchronously" type="boolean">
      If true, returns immediately with run metadata. If false, waits for completion. (Default: `true`)
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      Optional timeout for the run, in seconds
    </ResponseField>

    <ResponseField name="memory" type="integer">
      Memory limit for the run, in megabytes (power of 2, min 128)
    </ResponseField>

    <ResponseField name="max_items" type="integer">
      The maximum number of items that the Actor run should return
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Run Id"
        },
        "act_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Act Id"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "dataset_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dataset Id"
        },
        "key_value_store_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Key Value Store Id"
        },
        "data": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        }
      },
      "required": [
        "success"
      ],
      "title": "RunActorOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="run_task — Start an Apify task and return its run metadata">
    ### Parameters

    <ResponseField name="task_id" type="string" required>
      The ID of the task to run
    </ResponseField>

    <ResponseField name="override_input" type="string">
      Optional JSON string to override the default input for the task run
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      Optional timeout for the run, in seconds
    </ResponseField>

    <ResponseField name="memory" type="integer">
      Memory limit for the run, in megabytes (power of 2, min 128)
    </ResponseField>

    <ResponseField name="build" type="string">
      Specifies the Actor build to run (build tag or number)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Run Id"
        },
        "act_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Act Id"
        },
        "task_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Task Id"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "dataset_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dataset Id"
        },
        "key_value_store_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Key Value Store Id"
        }
      },
      "required": [
        "success"
      ],
      "title": "RunTaskOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="run_task_synchronously — Run an Apify task synchronously and return its dataset items">
    ### Parameters

    <ResponseField name="task_id" type="string" required>
      The ID of the task to run
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      Optional timeout for the run, in seconds
    </ResponseField>

    <ResponseField name="memory" type="integer">
      Memory limit for the run, in megabytes (power of 2, min 128)
    </ResponseField>

    <ResponseField name="build" type="string">
      Specifies the Actor build to run (build tag or number)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      The maximum number of dataset items to return (Default: `100`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Run Id"
        },
        "act_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Act Id"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Started At"
        },
        "finished_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Finished At"
        },
        "dataset_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dataset Id"
        },
        "items": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Items",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "RunTaskSynchronouslyOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_dataset_items — Retrieve items from an Apify dataset">
    ### Parameters

    <ResponseField name="dataset_id" type="string" required>
      The ID of the dataset to retrieve items from
    </ResponseField>

    <ResponseField name="offset" type="integer">
      The number of records to skip before returning results (Default: `0`)
    </ResponseField>

    <ResponseField name="limit" type="integer">
      The maximum number of items to return (Default: `100`)
    </ResponseField>

    <ResponseField name="clean" type="boolean">
      Return only non-empty items and skip hidden fields (fields starting with #)
    </ResponseField>

    <ResponseField name="fields" type="string">
      Comma-separated list of field names to include in results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "items": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Items",
          "type": "array"
        },
        "count": {
          "default": 0,
          "title": "Count",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetDatasetItemsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_kvs_record — Get a record from an Apify key-value store">
    ### Parameters

    <ResponseField name="key_value_store_id" type="string" required>
      The ID of the key-value store
    </ResponseField>

    <ResponseField name="key" type="string" required>
      The key of the record to retrieve
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "content_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content Type"
        },
        "data": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetKvsRecordOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="scrape_single_url — Scrape a single URL using Apify's Web Content Crawler and return its content">
    ### Parameters

    <ResponseField name="url" type="string" required>
      The URL of the web page to scrape
    </ResponseField>

    <ResponseField name="crawler_type" type="string">
      Crawling engine: 'playwright:firefox' (stealthy), 'playwright:chrome', 'cheerio' (fast, static only), 'playwright:adaptive' (auto-switches) (Default: `playwright:firefox`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text"
        },
        "html": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Html"
        },
        "markdown": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Markdown"
        }
      },
      "required": [
        "success"
      ],
      "title": "ScrapeSingleUrlOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="set_key_value_store_record — Create or update a record in an Apify key-value store">
    ### Parameters

    <ResponseField name="key_value_store_id" type="string" required>
      The ID of the key-value store
    </ResponseField>

    <ResponseField name="key" type="string" required>
      The key of the record to create or update
    </ResponseField>

    <ResponseField name="value" type="string" required>
      The value to store. Valid JSON strings are stored as JSON; otherwise as plain text.
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "store_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Store Id"
        },
        "key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Key"
        },
        "content_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content Type"
        }
      },
      "required": [
        "success"
      ],
      "title": "SetKeyValueStoreRecordOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Rate limits depend on Apify plan: Free tier has limited concurrent runs; paid plans scale to hundreds.
* Actor runs are billed by compute units (CU) based on memory and duration.
* Synchronous run endpoints have a default server timeout of 300 seconds.
* Error model: non-2xx responses and timeouts are caught and returned as `success=False` + `error` rather than raising.

## Related integrations

<CardGroup cols={3}>
  <Card title="Browserbase" href="/integrations/tools/browserbase" />

  <Card title="Daytona" href="/integrations/tools/daytona" />

  <Card title="ServiceNow" href="/integrations/tools/servicenow" />
</CardGroup>

## Links

* [Apify](https://apify.com)
