# US Brand Evidence Snapshot Diff (`zinin/us-brand-evidence-snapshot-diff`) Actor

Compare two buyer-supplied US-brand evidence snapshots by explicit dedupeKey and return one deterministic diff.

- **URL**: https://apify.com/zinin/us-brand-evidence-snapshot-diff.md
- **Developed by:** [Tim Zinin](https://apify.com/zinin) (community)
- **Categories:** MCP servers, Automation, Marketing
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## US Brand Evidence Snapshot Diff

Compare two small US-brand evidence snapshots and get one machine-readable diff. This is an inline-only Actor for agents and analysts who already have two snapshots and need a stable answer about what was added, removed, changed, or unchanged.

### What you provide

Set `primarySide` to `before` or `after`, then put 1-50 rows for that side in the required `primary` array. Put 1-50 rows for the opposite side in the optional `counterpart` array, or omit `counterpart` to represent an empty opposite snapshot. Each row has an explicit bounded ASCII `dedupeKey`, a brand name, `country: "US"`, and optional closed evidence fields. The same key may occur at most once per side. Raw text limits are checked before NFC normalization. Optional fields are omitted rather than set to `null` or an empty string. The Actor does not download URLs and does not read a Dataset.

### What you receive

You receive exactly one deterministic report with sorted result arrays and counts. Added and removed entries preserve the normalized row. Changed entries include both canonical rows, their digests, and field-level differences. Unchanged entries include the canonical row and matching digests. Snapshot rows and explicit set fields are sorted; order inside arbitrary evidence arrays is preserved and can produce a change. Counts and Actor-owned digests are recomputed before delivery.

### Example task

Use this inline input to compare the two snapshots and return the four categories plus the field-level price evidence change:

```json
{
  "schemaVersion": "1.0",
  "primarySide": "before",
  "primary": [
    {"dedupeKey": "acme|offer|001", "brandName": "Acme Northstar Labs", "country": "US", "eventType": "offer", "evidence": {"facts": {"priceUsd": "24.00"}}},
    {"dedupeKey": "acme|award|001", "brandName": "Acme Northstar Labs", "country": "US", "eventType": "award"},
    {"dedupeKey": "unchanged|news|001", "brandName": "Example Federal Tools", "country": "US", "eventType": "news"}
  ],
  "counterpart": [
    {"dedupeKey": "acme|offer|001", "brandName": "Acme Northstar Labs", "country": "US", "eventType": "offer", "evidence": {"facts": {"priceUsd": "19.00"}}},
    {"dedupeKey": "unchanged|news|001", "brandName": "Example Federal Tools", "country": "US", "eventType": "news"},
    {"dedupeKey": "new|launch|001", "brandName": "New Example Brand", "country": "US", "eventType": "news"}
  ]
}
```

The expected counts are `before: 3`, `after: 3`, `added: 1`, `removed: 1`, `changed: 1`, and `unchanged: 1`. The changed key is `acme|offer|001`, with `evidence.facts.priceUsd` changing from `$24.00` to `$19.00`.

### Machine-to-machine use

The executable input and output contracts are closed, bounded, permutation-invariant, and stable for agent pipelines. Nested finite numbers are accepted, while integer-valued numbers outside JavaScript's safe range are rejected before digesting. Set-valued fields are NFC-normalized, deduplicated, and sorted. The Actor has no network modules, no BYOK, no proxy, no Dataset input, no wall-clock identity, and no replay or exactly-once claim. Every run is a separate purchase.

### Pricing and limits

PAY\_PER\_EVENT uses exactly two events: Actor start and one `result-found` report. FREE: `$0.005` / `$0.010`; BRONZE: `$0.00475` / `$0.0095`; SILVER: `$0.0045` / `$0.009`; GOLD: `$0.00425` / `$0.0085`; PLATINUM: `$0.0041` / `$0.0082`; DIAMOND: `$0.004` / `$0.008`. The discount tiers lower both event prices. There is no default Dataset-item event. Runtime: 512 MB, 90 seconds; input: 0-50 rows per side, 100 total, 256 KiB maximum.

### Related Actors

These neighboring Actors were confirmed public and active by the fleet's durable anonymous Store read-back on 2026-08-05:

| Actor | Use it with this diff |
|---|---|
| [Company Profile Lookup](https://apify.com/zinin/company-lookup) | Build company context before comparing evidence snapshots. |
| [Shopify Store Intelligence](https://apify.com/zinin/shopify-store-intelligence) | Produce commerce evidence that can be compared between runs. |
| [Funding Round Tracker](https://apify.com/zinin/funding-round-tracker) | Add funding signals to a wider brand evidence workflow. |
| [Patent Filing Monitor](https://apify.com/zinin/patent-monitor) | Add patent events before snapshot comparison. |
| [Intent Signal Aggregator](https://apify.com/zinin/intent-signal-aggregator) | Feed changed evidence into a broader intent view. |

### FAQ

**Does it verify evidence?** No. It compares buyer-supplied rows.

**Can identity be inferred?** No. Matching uses only the caller's explicit `dedupeKey`.

**What happens on a billing or output failure?** The run fails closed and does not push an error as a paid result. Its error receipt preserves whether delivery was not attempted, unconfirmed, confirmed paid, or unknown, plus observed receipt and counter facts. If the post-charge OUTPUT write fails, the returned terminal receipt says `output.state: failed` instead of returning the successful diff.

The published Store contract is the inline-only input/output contract described above: `schemaVersion` and `primarySide` are required, `primary` has 1-50 rows, `counterpart` is optional with 1-50 rows, and each row requires a unique ASCII `dedupeKey`, `brandName`, and `country: "US"`. Results are deterministic `diff` reports with sorted `added`, `removed`, `changed`, and `unchanged` arrays. The Actor uses exactly two paid events, Actor start and one `result-found` report, with no default Dataset-item event.

# Actor input Schema

## `schemaVersion` (type: `string`):

schemaVersion

## `primarySide` (type: `string`):

Whether primary rows are the before or after snapshot.

## `primary` (type: `array`):

One to 50 rows for the side selected by primarySide. Identical rows are rejected structurally; runtime also rejects the same dedupeKey across non-identical rows.

## `counterpart` (type: `array`):

Optional one to 50 rows for the opposite side; omit it for an empty counterpart snapshot. Runtime rejects repeated dedupeKey values.

## Actor input object example

```json
{
  "schemaVersion": "1.0",
  "primarySide": "before"
}
```

# Actor output Schema

## `OUTPUT` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/us-brand-evidence-snapshot-diff").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("zinin/us-brand-evidence-snapshot-diff").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 '{}' |
apify call zinin/us-brand-evidence-snapshot-diff --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zinin/us-brand-evidence-snapshot-diff",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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