# Ecommerce RAG Ingestion Engine (`blukaze/ecommerce-rag-ingestion-engine`) Actor

Stop feeding your LLMs noisy HTML and irrelevant UI clutter. The Ecommerce RAG Ingestion Engine is a production-ready Apify Actor designed to transform entire ecommerce domains with a specialized focus on Shopify into clean, AI-ready knowledge bases.

- **URL**: https://apify.com/blukaze/ecommerce-rag-ingestion-engine.md
- **Developed by:** [Blukaze Automations](https://apify.com/blukaze) (community)
- **Categories:** AI, E-commerce, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Ecommerce Store Knowledgebase Scraper

An advanced, production-ready Apify Actor designed to scrape ecommerce websites (with a strong focus on Shopify) to extract both **structured product catalogs** and **AI-ready RAG chunks**.

This actor is purpose-built for AI teams, agencies, and ecommerce brands that need to ingest a domain’s content into LLM support bots, semantic search pipelines, merchandising copilots, or internal vector databases.

### Why use this over a generic crawler?
* **Ecommerce-Aware**: It automatically identifies and classifies URLs into Product, Collection, Policy, FAQ, and Blog page types.
* **Shopify Optimized**: Employs specific logic to dig into native Shopify payload structures (e.g. `product.json` payloads, variant variables) enabling reliable, resilient extractions compared to CSS selectors.
* **LLM & RAG Native**: It doesn't just dump HTML. It cleans pages, stripping headers, footers, and noise, and intelligently chunks the main text content via Markdown boundary detection, estimating token sizes automatically.
* **Configurable Outputs**: Choose to output catalog data, knowledge chunks, or both depending on your pipeline requirements.

### Ideal Use Cases
- **AI Support Bots**: Train OpenAI, Anthropic, or dialogue systems on the exact latest return policies, shipping times, and FAQs directly from the source.
- **Semantic Product Search**: Ingest `products` datasets into Pinecone, Weaviate, or Qdrant to enable rich natural language querying over catalogs.
- **Knowledge Ingestion Pipelines**: Integrate directly with Make, n8n, or Langchain to automatically synchronize website knowledge to your enterprise RAG stack.

### Output Modes

The actor allows you to selectively choose what output formats you desire via `outputMode` using the `includeSections` controls:

#### 1. Catalog Only
Extracts clean, normalized product data pushed to the `products` dataset.
```json
{
  "url": "https://example.com/products/cool-shirt",
  "title": "Cool Graphic T-Shirt",
  "price": 29.99,
  "currency": "USD",
  "availability": "in_stock",
  "brand": "Example Brand",
  "variants": [
    {"title": "Small", "price": 29.99, "sku": "SHIRT-S"},
    {"title": "Large", "price": 29.99, "sku": "SHIRT-L"}
  ]
}
````

#### 2. Knowledge Only (RAG Chunks)

Pushes clean text chunks properly bounded and estimated for tokens into the `knowledge_chunks` dataset.

```json
{
  "url": "https://example.com/policies/shipping-policy",
  "title": "Shipping Policy - International Shipping",
  "section_type": "policy_section",
  "source_kind": "policy",
  "text": "We offer international shipping to over 100 countries. Standard international shipping takes 10-15 business days...",
  "token_estimate": 45
}
```

### Input Configuration

| Field | Type | Description |
|---|---|---|
| `startUrls` | Array | URLs or Sitemaps to begin crawling. |
| `includeSections` | Array | Types of pages to process (`products`, `policies`, `faq`, etc.) |
| `outputMode` | String | `catalog_only`, `knowledge_only`, or `both`. |
| `maxPages` | Integer | Hard limit of pages to traverse (cost control). |
| `chunkSizeTokens` | Integer | Target maximum token size for RAG chunks. |

### Limitations

- **Render Heavy Sites**: Currently operates on a high-speed `CheerioCrawler`. Highly complex SPAs without Server-Side Rendering (SSR) might have some data hidden. Shopify and most modern ecommerce platforms provide SSR or JSON-LD which this actor consumes natively.
- **Paywalls/Logins**: Does not support bypassing logins or captchas outside of Apify's standard proxy rotation parameters.

# Actor input Schema

## `startUrls` (type: `array`):

List of ecommerce store URLs or sitemaps to start crawling from.

## `includeSections` (type: `array`):

Which types of pages should be extracted and chunked? (e.g. products, collections, faq, policies, reviews\_qna, blog, general\_pages)

## `maxPages` (type: `integer`):

Maximum number of pages the crawler will visit.

## `maxProducts` (type: `integer`):

Limit the number of products extracted. Leave empty for no limit.

## `maxDepth` (type: `integer`):

How deep to follow links from the start URL. (0 means only start URLs).

## `chunkSizeTokens` (type: `integer`):

The approximate maximum number of tokens per RAG chunk.

## `outputMode` (type: `string`):

What data should the actor output?

## `respectRobotsTxt` (type: `boolean`):

If enabled, crawler will not visit pages blocked by robots.txt.

## `proxyConfiguration` (type: `object`):

Select proxies to be used.

## `debugMode` (type: `boolean`):

Enable verbose logging for troubleshooting.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://vault-demo-store.myshopify.com/"
    }
  ],
  "includeSections": [
    "products",
    "collections",
    "faq",
    "policies"
  ],
  "maxPages": 500,
  "maxProducts": 100,
  "maxDepth": 10,
  "chunkSizeTokens": 500,
  "outputMode": "both",
  "respectRobotsTxt": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugMode": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

The master dataset containing both product JSON catalog entries and formatted Markdown RAG chunks.

# 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 = {
    "startUrls": [
        {
            "url": "https://vault-demo-store.myshopify.com/"
        }
    ],
    "includeSections": [
        "products",
        "collections",
        "faq",
        "policies"
    ],
    "maxPages": 500,
    "maxProducts": 100,
    "maxDepth": 10,
    "chunkSizeTokens": 500,
    "outputMode": "both",
    "respectRobotsTxt": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "debugMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("blukaze/ecommerce-rag-ingestion-engine").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 = {
    "startUrls": [{ "url": "https://vault-demo-store.myshopify.com/" }],
    "includeSections": [
        "products",
        "collections",
        "faq",
        "policies",
    ],
    "maxPages": 500,
    "maxProducts": 100,
    "maxDepth": 10,
    "chunkSizeTokens": 500,
    "outputMode": "both",
    "respectRobotsTxt": False,
    "proxyConfiguration": { "useApifyProxy": True },
    "debugMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("blukaze/ecommerce-rag-ingestion-engine").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://vault-demo-store.myshopify.com/"
    }
  ],
  "includeSections": [
    "products",
    "collections",
    "faq",
    "policies"
  ],
  "maxPages": 500,
  "maxProducts": 100,
  "maxDepth": 10,
  "chunkSizeTokens": 500,
  "outputMode": "both",
  "respectRobotsTxt": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugMode": false
}' |
apify call blukaze/ecommerce-rag-ingestion-engine --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=blukaze/ecommerce-rag-ingestion-engine",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Ecommerce RAG Ingestion Engine",
        "description": "Stop feeding your LLMs noisy HTML and irrelevant UI clutter. The Ecommerce RAG Ingestion Engine is a production-ready Apify Actor designed to transform entire ecommerce domains with a specialized focus on Shopify into clean, AI-ready knowledge bases.",
        "version": "0.0",
        "x-build-id": "tVp2HozlO2i8OpFT7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/blukaze~ecommerce-rag-ingestion-engine/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-blukaze-ecommerce-rag-ingestion-engine",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/blukaze~ecommerce-rag-ingestion-engine/runs": {
            "post": {
                "operationId": "runs-sync-blukaze-ecommerce-rag-ingestion-engine",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/blukaze~ecommerce-rag-ingestion-engine/run-sync": {
            "post": {
                "operationId": "run-sync-blukaze-ecommerce-rag-ingestion-engine",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls",
                    "outputMode"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of ecommerce store URLs or sitemaps to start crawling from.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "includeSections": {
                        "title": "Sections to Include",
                        "type": "array",
                        "description": "Which types of pages should be extracted and chunked? (e.g. products, collections, faq, policies, reviews_qna, blog, general_pages)",
                        "default": [
                            "products",
                            "collections",
                            "faq",
                            "policies"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPages": {
                        "title": "Max Pages to Crawl",
                        "type": "integer",
                        "description": "Maximum number of pages the crawler will visit.",
                        "default": 1000
                    },
                    "maxProducts": {
                        "title": "Max Products to Extract",
                        "type": "integer",
                        "description": "Limit the number of products extracted. Leave empty for no limit."
                    },
                    "maxDepth": {
                        "title": "Max Crawl Depth",
                        "type": "integer",
                        "description": "How deep to follow links from the start URL. (0 means only start URLs).",
                        "default": 10
                    },
                    "chunkSizeTokens": {
                        "title": "Target Chunk Size (Tokens)",
                        "type": "integer",
                        "description": "The approximate maximum number of tokens per RAG chunk.",
                        "default": 500
                    },
                    "outputMode": {
                        "title": "Output Mode",
                        "enum": [
                            "catalog_only",
                            "knowledge_only",
                            "both"
                        ],
                        "type": "string",
                        "description": "What data should the actor output?",
                        "default": "both"
                    },
                    "respectRobotsTxt": {
                        "title": "Respect robots.txt",
                        "type": "boolean",
                        "description": "If enabled, crawler will not visit pages blocked by robots.txt.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Select proxies to be used.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Enable verbose logging for troubleshooting.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
