# Product Taxonomy Mapper API (`webdata_labs/ai-product-taxonomy-mapper-api`) Actor

\[💵 $2 / 1K] Map product catalogs to any custom taxonomy with confidence scores, alternatives, and review flags.

- **URL**: https://apify.com/webdata\_labs/ai-product-taxonomy-mapper-api.md
- **Developed by:** [WebData Labs](https://apify.com/webdata_labs) (community)
- **Categories:** AI, E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 mapped product rows

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Product Taxonomy Mapper API

Map product catalogs to your own category tree. The Actor accepts pasted JSON or an Apify dataset, then returns a category, confidence score, matched evidence, alternatives, and a review flag for every product.

### 🎯 What it does

- Maps products to any merchant, marketplace, or internal taxonomy.
- Uses product titles, descriptions, brands, product types, category keywords, and examples.
- Keeps uncertain results visible with `needsReview` instead of inventing certainty.
- Works without browser scraping, proxies, or a third-party AI key.

### 🚀 Quick start

Provide `products` and `taxonomy`, then click **Start**. The prefilled input is a complete working example.

```json
{
  "products": [{"id":"sku-1","title":"Women's waterproof hiking boots"}],
  "taxonomy": [
    {"id":"boots","name":"Hiking Boots","path":"Apparel > Footwear > Boots","keywords":["hiking","trail","waterproof"]},
    {"id":"sneakers","name":"Sneakers","keywords":["trainer","running"]}
  ]
}
```

### 📥 Input

Use `products` for direct JSON rows or `datasetId` to chain another Actor's dataset. `taxonomy` is required. Tune `minimumConfidence` to control the manual-review threshold and `maxItems` to cap a run.

### 📤 Output

Each source row is preserved and enriched with `mappedCategoryId`, `mappedCategoryName`, `mappedCategoryPath`, `confidence`, `needsReview`, `matchedSignals`, and three ranked `alternatives`.

### 🧠 How scoring works

The mapper normalizes Unicode and combines exact category phrases, category/path token overlap, weighted keywords, and example overlap. Confidence also considers the margin between the best and second-best category. The method is deterministic and auditable.

### 💵 Pricing

The intended Store price is **$2 per 1,000 mapped product rows**, including platform usage. One dataset row is one billable result.

### 🔗 Common workflows

- Map Shopify products to a marketplace taxonomy.
- Normalize supplier catalogs before Google Merchant export.
- Route 1688 sourcing data into an internal category tree.
- Flag low-confidence catalog rows for human review.

### ⚠️ Limits

Quality depends on category names, keywords, examples, and product text. Highly ambiguous products should remain reviewable. The Actor does not claim semantic understanding beyond the evidence it returns.

### 🛟 Support

Open an issue on the Actor page with a minimal redacted input, expected category, and actual output.

# Actor input Schema

## `products` (type: `array`):

Product rows. Each row needs a title.

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

Optional Apify dataset containing product rows.

## `taxonomy` (type: `array`):

Your categories with id, name, and optional path, keywords, and examples.

## `minimumConfidence` (type: `number`):

Rows below this score are flagged for review.

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

Maximum rows processed in one run.

## Actor input object example

```json
{
  "products": [
    {
      "id": "sku-1",
      "title": "Women's waterproof hiking boots",
      "description": "Leather trail boots with rubber sole",
      "brand": "North Peak"
    }
  ],
  "taxonomy": [
    {
      "id": "footwear-boots",
      "name": "Hiking Boots",
      "path": "Apparel > Footwear > Boots",
      "keywords": [
        "hiking",
        "trail",
        "trekking",
        "waterproof"
      ]
    },
    {
      "id": "footwear-sneakers",
      "name": "Sneakers",
      "path": "Apparel > Footwear > Sneakers",
      "keywords": [
        "sneaker",
        "trainer",
        "running"
      ]
    }
  ],
  "minimumConfidence": 0.35,
  "maxItems": 1000
}
```

# Actor output Schema

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

No description

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

No description

# 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 = {
    "products": [
        {
            "id": "sku-1",
            "title": "Women's waterproof hiking boots",
            "description": "Leather trail boots with rubber sole",
            "brand": "North Peak"
        }
    ],
    "taxonomy": [
        {
            "id": "footwear-boots",
            "name": "Hiking Boots",
            "path": "Apparel > Footwear > Boots",
            "keywords": [
                "hiking",
                "trail",
                "trekking",
                "waterproof"
            ]
        },
        {
            "id": "footwear-sneakers",
            "name": "Sneakers",
            "path": "Apparel > Footwear > Sneakers",
            "keywords": [
                "sneaker",
                "trainer",
                "running"
            ]
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("webdata_labs/ai-product-taxonomy-mapper-api").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 = {
    "products": [{
            "id": "sku-1",
            "title": "Women's waterproof hiking boots",
            "description": "Leather trail boots with rubber sole",
            "brand": "North Peak",
        }],
    "taxonomy": [
        {
            "id": "footwear-boots",
            "name": "Hiking Boots",
            "path": "Apparel > Footwear > Boots",
            "keywords": [
                "hiking",
                "trail",
                "trekking",
                "waterproof",
            ],
        },
        {
            "id": "footwear-sneakers",
            "name": "Sneakers",
            "path": "Apparel > Footwear > Sneakers",
            "keywords": [
                "sneaker",
                "trainer",
                "running",
            ],
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("webdata_labs/ai-product-taxonomy-mapper-api").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 '{
  "products": [
    {
      "id": "sku-1",
      "title": "Women'\''s waterproof hiking boots",
      "description": "Leather trail boots with rubber sole",
      "brand": "North Peak"
    }
  ],
  "taxonomy": [
    {
      "id": "footwear-boots",
      "name": "Hiking Boots",
      "path": "Apparel > Footwear > Boots",
      "keywords": [
        "hiking",
        "trail",
        "trekking",
        "waterproof"
      ]
    },
    {
      "id": "footwear-sneakers",
      "name": "Sneakers",
      "path": "Apparel > Footwear > Sneakers",
      "keywords": [
        "sneaker",
        "trainer",
        "running"
      ]
    }
  ]
}' |
apify call webdata_labs/ai-product-taxonomy-mapper-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=webdata_labs/ai-product-taxonomy-mapper-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/NQlCiHQi9ERVYXY7i/builds/L8QxaUFQdIivhGyOy/openapi.json
