# Product Matching (`moving_beacon-owner1/product-matching`) Actor

Product Matching — matches products across two datasets using identifiers, names, and brands, then returns confidence scores, matching evidence, product differences, and clear match classifications.

- **URL**: https://apify.com/moving\_beacon-owner1/product-matching.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** E-commerce, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.99 / 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 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 Matching

A reusable **entity-matching** Actor. Give it two product datasets (A and B) and it returns, for every A record, its best B match with a **confidence score**, human-readable **evidence**, and the concrete **field differences**. It never claims an exact match when the confidence is insufficient.

### What does this Actor do?

For each record in Dataset A it finds the most likely matching record in Dataset B and classifies the match:

- `exact` — identifier-level agreement (SKU / GTIN / MPN / model) or a perfect normalized name + brand.
- `probable` — strong name + brand agreement.
- `possible` — plausible but weaker match.
- `no_match` — nothing cleared the confidence bar.

Matching is delegated to the repository's shared `matching` module, which **caps confidence when hard identifiers conflict**, so two different products are never reported as the same item.

### Why use it?

- Reconcile a supplier catalogue against your own, or two competitor price feeds, without hand-mapping SKUs.
- Every match is auditable: you see *why* it matched and *how* the two records differ (e.g. price, availability, URL).

### How to use it

1. Provide **Dataset A** and **Dataset B** — inline JSON arrays (`recordsA` / `recordsB`), or descriptors pointing at an Apify dataset (`datasetA` / `datasetB`).
2. Optionally set `matchFields` to control which fields identify a product, and `minConfidence` to tune strictness.
3. Run and export the matches.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `recordsA` / `recordsB` | array | Inline product records for each side. |
| `datasetA` / `datasetB` | object | Advanced: `{records\|csv\|json\|datasetId\|datasetUrl}`. |
| `matchFields` | object | `{nameFields, brandFields, idFields, compareFields}` overrides. |
| `minConfidence` | number | 0–1; matches below this become `no_match` (default 0.6). |

#### Input example

```json
{
  "recordsA": [{ "name": "Wireless Mouse", "brand": "Acme", "sku": "AM-100", "price": 19.99 }],
  "recordsB": [{ "name": "Acme Wireless Mouse", "brand": "Acme", "sku": "AM-100", "price": 22.50 }],
  "minConfidence": 0.6
}
```

### Output

One `match` record per A record, plus a final `summary` record.

#### Output example

```json
{
  "recordType": "match",
  "recordA": { "name": "Wireless Mouse", "sku": "AM-100", "price": 19.99 },
  "recordB": { "name": "Acme Wireless Mouse", "sku": "AM-100", "price": 22.50 },
  "matchStatus": "exact",
  "matchConfidence": 0.98,
  "matchingEvidence": ["identifier 'sku' matches (am100)", "brand matches ('acme' vs 'acme')"],
  "differences": { "price": [19.99, 22.50] }
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Configuration

- `matchFields.idFields` — identifier fields checked first (default: gtin, upc, ean, isbn, sku, mpn, model, manufacturerNumber).
- `matchFields.nameFields` / `brandFields` — fields used for name/brand similarity.
- `matchFields.compareFields` — fields whose differences are reported (default: price, currency, availability, url).

### Environment variables

None. This Actor processes only the records you provide — no scraping, no proxy required.

# Actor input Schema

## `recordsA` (type: `array`):

Products for side A as an inline JSON array of objects. Alternatively provide 'datasetA'.

## `recordsB` (type: `array`):

Products for side B as an inline JSON array of objects. Alternatively provide 'datasetB'.

## `datasetA` (type: `object`):

Descriptor for side A: {records|csv|json|datasetId|datasetUrl}. Use instead of recordsA to pull from an Apify dataset.

## `datasetB` (type: `object`):

Descriptor for side B: {records|csv|json|datasetId|datasetUrl}.

## `matchFields` (type: `object`):

Optional overrides: {nameFields:\[...], brandFields:\[...], idFields:\[...], compareFields:\[...]}. Defaults cover name/title, brand/manufacturer, common identifiers.

## `minConfidence` (type: `number`):

Matches below this confidence (0-1) are reported as 'no\_match'.

## Actor input object example

```json
{
  "recordsA": [
    {
      "name": "Wireless Mouse",
      "brand": "Acme",
      "sku": "AM-100",
      "price": 19.99
    }
  ],
  "recordsB": [
    {
      "name": "Acme Wireless Mouse",
      "brand": "Acme",
      "sku": "AM-100",
      "price": 22.5
    }
  ],
  "matchFields": {},
  "minConfidence": 0.6
}
```

# Actor output Schema

## `results` (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 = {
    "recordsA": [
        {
            "name": "Wireless Mouse",
            "brand": "Acme",
            "sku": "AM-100",
            "price": 19.99
        }
    ],
    "recordsB": [
        {
            "name": "Acme Wireless Mouse",
            "brand": "Acme",
            "sku": "AM-100",
            "price": 22.5
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/product-matching").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 = {
    "recordsA": [{
            "name": "Wireless Mouse",
            "brand": "Acme",
            "sku": "AM-100",
            "price": 19.99,
        }],
    "recordsB": [{
            "name": "Acme Wireless Mouse",
            "brand": "Acme",
            "sku": "AM-100",
            "price": 22.5,
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/product-matching").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 '{
  "recordsA": [
    {
      "name": "Wireless Mouse",
      "brand": "Acme",
      "sku": "AM-100",
      "price": 19.99
    }
  ],
  "recordsB": [
    {
      "name": "Acme Wireless Mouse",
      "brand": "Acme",
      "sku": "AM-100",
      "price": 22.5
    }
  ]
}' |
apify call moving_beacon-owner1/product-matching --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/product-matching"
        }
    }
}

```

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/EpqogwFr7aFRxlb6g/builds/aWSQYWyC7MuJiTwIO/openapi.json
