# Website to AI Chatbot (Asyntai) (`asyntai/website-ai-chatbot`) Actor

Turn any website into an AI chatbot that answers visitors 24/7 from your own content. Create the chatbot from a URL, feed it web pages or any Apify dataset, ask it questions, and get the widget code to paste into your site.

- **URL**: https://apify.com/asyntai/website-ai-chatbot.md
- **Developed by:** [Asyntai](https://apify.com/asyntai) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website to AI Chatbot (Asyntai)

Turn any website into an AI chatbot that answers your visitors day and night. Give this Actor a URL, and [Asyntai](https://asyntai.com) reads the website, writes the chatbot's instructions, and hands you the widget code to paste into the site.

Then keep the chatbot sharp with the data you already collect on Apify: send it web pages or a whole dataset, and it answers from that content at once.

### What does this Actor do?

Pick one action per run:

- **Create a chatbot from a website.** Enter a URL. Asyntai reads the website, and the run returns the chatbot ID, the widget ID and the widget code. With "Wait until the chatbot is ready" on, the run finishes when the chatbot has learned the site.
- **Add web pages to the knowledge base.** Enter a list of page URLs. Each page goes into the chatbot's knowledge base.
- **Import an Apify dataset into the knowledge base.** Enter a dataset ID, for example the result of a crawler run. Each item with text becomes one knowledge base entry.
- **Ask the chatbot a question.** Get the chatbot's answer as data. Send the same conversation ID again to continue the conversation.

### Why use it?

- **Answers from your own content.** The chatbot answers with the facts on your website and in your data, 24/7, in your visitors' language.
- **Fresh after every crawl.** Connect your crawler to this Actor, and each new run updates what the chatbot knows.
- **One snippet to go live.** The run returns the widget code. Paste it into your website, and visitors can chat right away.
- **Leads and chats in one place.** Every conversation, and every visitor who leaves contact details, lands in the [Asyntai dashboard](https://asyntai.com/dashboard).

### How to use it

1. Sign in to Asyntai, open **Settings → API**, and copy your API key.
2. Paste the key into **Asyntai API key**.
3. Choose an action in **What to do**, and fill the matching section.
4. Press **Start**. Open the **Output** tab when the run finishes.

To use a chatbot you already have, enter its **Chatbot ID**: the `websiteId` from the output of a "Create a chatbot" run. Leave it empty to use the main chatbot of your account.

### Keep the chatbot current automatically

1. Open the Actor or task that collects your data, and go to **Integrations**.
2. Connect it to this Actor.
3. Set **What to do** to **Import an Apify dataset into the knowledge base**.
4. Enter your **Chatbot ID**, and set **Dataset ID** to `{{resource.defaultDatasetId}}`.

After each run of your crawler, the new items go straight into the chatbot.

The Actor takes the text from the first of these item fields: `text`, `markdown`, `content`, `body`, `description`. It takes the title from `metadata.title`, `title`, `name` or the URL. For other datasets, name your own fields in **Text field** and **Title field**. Dotted paths such as `faq.answer` work too.

### Input example

```json
{
    "apiKey": "YOUR_ASYNTAI_API_KEY",
    "action": "create_chatbot",
    "websiteUrl": "https://example.com",
    "chatbotName": "Support",
    "waitUntilReady": true
}
```

### Output example

```json
{
    "action": "create_chatbot",
    "status": "created",
    "websiteId": 12345,
    "domain": "example.com",
    "widgetId": "asyntai_ab12cd34ef56",
    "ready": true,
    "instructionsStatus": "completed",
    "crawlStatus": "completed",
    "pagesCrawled": 42,
    "knowledgeItems": 42,
    "embedCode": "<script>...</script>",
    "dashboardUrl": "https://asyntai.com/dashboard"
}
```

The key-value store record `OUTPUT` holds a short summary of the run. For page and dataset imports it shows how many items were added.

### Pricing

This Actor is free on Apify. It uses the Asyntai API, which comes with every paid Asyntai plan, from Starter up.

### Support

Questions or ideas? Write to hello@asyntai.com, or read the [setup guide](https://asyntai.com/documentation/integrations/apify/).

# Actor input Schema

## `apiKey` (type: `string`):

Your Asyntai API key. Find it at https://asyntai.com/settings/api/ after you sign in.

## `action` (type: `string`):

Create a chatbot from a website, add pages or a dataset to a chatbot's knowledge base, or ask a chatbot a question.

## `websiteUrl` (type: `string`):

Create a chatbot: the website the chatbot learns from and answers for.

## `chatbotName` (type: `string`):

Create a chatbot: an optional name that you see in the Asyntai dashboard.

## `reuseExisting` (type: `boolean`):

Create a chatbot: when the account already has a chatbot for this website, return it instead of creating a second one.

## `waitUntilReady` (type: `boolean`):

Create a chatbot: wait until Asyntai has read the website and written the chatbot's instructions.

## `maxWaitMinutes` (type: `integer`):

Create a chatbot: stop the wait after this many minutes. The chatbot continues to learn in the background.

## `chatbotId` (type: `string`):

The numeric ID of an existing chatbot (the 'websiteId' in this Actor's output). Leave empty to use the primary chatbot of the account.

## `urls` (type: `array`):

Add web pages: each page is fetched and added to the chatbot's knowledge base.

## `datasetId` (type: `string`):

Import a dataset: the ID of an Apify dataset, for example the output of Website Content Crawler. Each item with text becomes one knowledge base entry. In an Actor integration, use {{resource.defaultDatasetId}}.

## `textField` (type: `string`):

Import a dataset: the item field that holds the text. Leave empty to use the first of: text, markdown, content, body, description.

## `titleField` (type: `string`):

Import a dataset: the item field that holds the title. Leave empty to use metadata.title, title, name, or the URL.

## `maxItems` (type: `integer`):

Import a dataset: the maximum number of items to import.

## `question` (type: `string`):

Ask: the question to send to the chatbot.

## `sessionId` (type: `string`):

Ask: send the same ID again to continue the same conversation.

## Actor input object example

```json
{
  "action": "create_chatbot",
  "websiteUrl": "https://asyntai.com",
  "reuseExisting": true,
  "waitUntilReady": true,
  "maxWaitMinutes": 10,
  "maxItems": 200
}
```

# Actor output Schema

## `results` (type: `string`):

One row per chatbot, page, dataset item or answer.

## `summary` (type: `string`):

A short summary of the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "websiteUrl": "https://asyntai.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("asyntai/website-ai-chatbot").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "websiteUrl": "https://asyntai.com" }

# Run the Actor and wait for it to finish
run = client.actor("asyntai/website-ai-chatbot").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "websiteUrl": "https://asyntai.com"
}' |
apify call asyntai/website-ai-chatbot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,asyntai/website-ai-chatbot"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/M9by9nkXL2Wz328bE/builds/aPlQTlVDZBRZ9bzFi/openapi.json
