# JSON Dataset Join Key Auditor - Missing and Duplicate Keys (`variable_mitts/dataset-join-key-auditor`) Actor

Audit join keys across two JSON datasets. Find unmatched records, duplicate keys and one-to-many matches with source indices and coverage evidence.

- **URL**: https://apify.com/variable_mitts/dataset-join-key-auditor.md
- **Developed by:** [Dhan sites](https://apify.com/variable_mitts) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.48 / 1,000 input work unit inspecteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

## JSON Dataset Join Key Auditor - Missing and Duplicate Keys

Audit join keys across two JSON datasets. Find unmatched records, missing keys and one-to-many matches with exact input indices and bounded coverage.

### Start with this workflow

Check join cardinality before combining two datasets.

**After the run:** Inspect unmatched and duplicate-key evidence in REPORT before joining. The Actor audits supplied records and does not write a merged dataset.

**What is billed:** Each inspected left or right record, including rejections; invalid top-level input is free. Check the Pricing tab for the applicable subscription-tier rate. Result rows and billable input units can differ. A successful execution does not guarantee full coverage.

The example uses a small supplied fixture or the publisher-owned demonstration target. Replace it with input you are authorized to process; inspect coverage, diagnostics and limits before downstream use.

### Working example

```json
{
  "leftRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "B"
    },
    {}
  ],
  "rightRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "A"
    },
    {
      "sku": "C"
    }
  ],
  "leftKey": "sku",
  "rightKey": "sku",
  "maxRecords": 10
}
```

### What the results mean

Checks scalar keys at dot-separated object paths. Missing, null, array and object keys are invalid. String, integer, fractional-number and boolean keys are distinct: 1, 1.0, true and "1" do not join. A single total record cap alternates between left and right inputs. Unmatched means unmatched in inspected coverage; truncation can hide matches. Does not merge or modify datasets.

### Outputs

The default dataset shows side, record_index, status, matching_indices, same_side_duplicate_count. REPORT contains the full result and summary.processed/summary.truncated. Available file records: REPORT, BILLING. Result rows may differ from billed input units.

### Pricing

$0.6 per 1,000 inspected input work units ($0.0006 each) at the entry tier. Each inspected left or right record, including rejections; invalid top-level input is free. Per-record rejections are inspected work. There is no run-start or automatic dataset-row event in the configured pricing. Inspect the Pricing tab for tier discounts, and REPORT/BILLING to reconcile inspected units.

### Limits and support

Default100 work units, maximum1000; at most10000 supplied records per array; serialized input2millioncharacters. The work cap applies before processing and is reduced by the run spending limit. Truncated output describes only the inspected prefix. No source data is changed, no websites fetched and no third-party API called. Run status alone is not validation: inspect REPORT and per-record errors. Use the Issues tab for support with a run ID and a small non-sensitive example. Never post private credentials.

### Who is this for?

Data engineers checking whether two datasets can join cleanly. Supply both JSON arrays and their key paths before performing a merge elsewhere.

### Frequently asked questions

#### Does this merge datasets or only check the join keys?

It audits keys and returns match, missing-key and duplicate evidence. It does not merge datasets. Unmatched means unmatched within inspected coverage, so a capped run may omit a later match.

#### How do I try it before using my full input?

Open the Input tab, review the prefilled example, and run a small batch with a spending limit. Inspect the dataset and report before increasing the batch. Examples can incur the documented inspection or analysis fee; an execution marked successful can still contain rejected records or incomplete coverage.

#### Can I use the Actor through an API or on a schedule?

Yes. Use Apify's [Actor API](https://docs.apify.com/api/v2/acts-run-sync-get-dataset-items-post) or [schedules](https://docs.apify.com/platform/schedules). Keep credentials private and use the documented input fields. The pricing and limits below apply to API runs too.

### Related tools for the next step

- [JSON Dataset Validator - Required Fields and Data Types](https://apify.com/variable_mitts/dataset-contract-field-checker)
- [JSONL Validator - Invalid Lines and Clean JSONL Export](https://apify.com/variable_mitts/jsonl-validator-reject-export)

# Actor input Schema

## `maxRecords` (type: `integer`):

One total cap on inspected input units, also bounded by the run spending limit. See the description for header/join/line counting.

## `leftRecords` (type: `array`):

Sample data is synthetic and never fetched as a URL. Replace with your own authorized input.

## `rightRecords` (type: `array`):

Sample data is synthetic and never fetched as a URL. Replace with your own authorized input.

## `leftKey` (type: `string`):

Name of the column used to match rows, for example sku or product.sku. Enter a field path only. Never enter an API key or credential.

## `rightKey` (type: `string`):

Name of the column used to match rows, for example sku or product.sku. Enter a field path only. Never enter an API key or credential.

## Actor input object example

```json
{
  "maxRecords": 10,
  "leftRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "B"
    },
    {}
  ],
  "rightRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "A"
    },
    {
      "sku": "C"
    }
  ],
  "leftKey": "sku",
  "rightKey": "sku"
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `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 = {
    "maxRecords": 10,
    "leftRecords": [
        {
            "sku": "A"
        },
        {
            "sku": "B"
        },
        {}
    ],
    "rightRecords": [
        {
            "sku": "A"
        },
        {
            "sku": "A"
        },
        {
            "sku": "C"
        }
    ],
    "leftKey": "sku",
    "rightKey": "sku"
};

// Run the Actor and wait for it to finish
const run = await client.actor("variable_mitts/dataset-join-key-auditor").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 = {
    "maxRecords": 10,
    "leftRecords": [
        { "sku": "A" },
        { "sku": "B" },
        {},
    ],
    "rightRecords": [
        { "sku": "A" },
        { "sku": "A" },
        { "sku": "C" },
    ],
    "leftKey": "sku",
    "rightKey": "sku",
}

# Run the Actor and wait for it to finish
run = client.actor("variable_mitts/dataset-join-key-auditor").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 '{
  "maxRecords": 10,
  "leftRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "B"
    },
    {}
  ],
  "rightRecords": [
    {
      "sku": "A"
    },
    {
      "sku": "A"
    },
    {
      "sku": "C"
    }
  ],
  "leftKey": "sku",
  "rightKey": "sku"
}' |
apify call variable_mitts/dataset-join-key-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,variable_mitts/dataset-join-key-auditor"
        }
    }
}
```

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/7zvzWhoo4Du2SNhdb/builds/DObwJyhlXVS3A4R08/openapi.json
