# US Brand Evidence Chronology Builder (`zinin/us-brand-evidence-chronology-builder`) Actor

Build one deterministic chronology from closed evidence rows without identity or truth inference.

- **URL**: https://apify.com/zinin/us-brand-evidence-chronology-builder.md
- **Developed by:** [Tim Zinin](https://apify.com/zinin) (community)
- **Categories:** Automation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.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 Chronology Builder

Build a deterministic US brand evidence chronology from 1-30 closed, normalized evidence rows and an explicit `asOf` UTC timestamp. The Actor is a local, offline-friendly machine workflow: it sorts submitted facts, marks same-time groups, reports future-dated IDs and basic timestamp warnings, and emits exact counts with stable SHA-256 digests.

### What it does

Each row contains only `evidenceId`, `eventType`, `effectiveAt`, `observedAt`, `sourceUrl`, and `fact`. `effectiveAt` may be `null` when the submitted row has no effective timestamp. The chronology is sorted by `effectiveAt`, then `observedAt`, then `evidenceId`; rows without `effectiveAt` sort last. Equal `(effectiveAt, observedAt)` pairs receive a stable `tg-*` same-time group ID.

The report marks a row future-dated when its effective or observed timestamp is after `asOf`. Warnings cover missing effective time, effective time after observation, effective time after `asOf`, and observation after `asOf`. The Actor copies submitted facts and URLs. It does not resolve a brand, infer identity, verify a source, infer truth, score evidence, or interpret the fact.

### Exact task

The public Task uses fixed timestamps and two rows, so it never reads the current clock. Its input is the same runnable payload shown in the Actor input example, and its deterministic report is available through the run Dataset and `OUTPUT` record.

### Runtime and delivery

The runtime uses Apify SDK `3.7.2`, pay-per-event pricing, one confirmed `apify-actor-start`, and at most one `result-found` event. It confirms the buyer cap before work, performs exactly one `pushData(report, "result-found")`, verifies the result counter, and then writes the successful report to KVS key `OUTPUT`. Validation, budget, push, charge, or output uncertainty writes only the small documented error object when that KVS write succeeds and fails the run; it never claims success.

The result is bounded below 32 KiB. There is no network request, proxy, API key, BYOK, child run, Dataset input, state, replay, queue, cron, or current-clock read. No icon is included in this local builder.

### Pricing tiers

| Tier | Actor start | Result | Discount |
| --- | ---: | ---: | ---: |
| FREE | $0.005000 | $0.010000 | 0% |
| BRONZE | $0.004750 | $0.009500 | 5% |
| SILVER | $0.004500 | $0.009000 | 10% |
| GOLD | $0.004250 | $0.008500 | 15% |
| PLATINUM | $0.004100 | $0.008200 | 18% |
| DIAMOND | $0.004000 | $0.008000 | 20% |

### Public references

These five public references were checked during the local build and describe the runtime, storage, schema, and timestamp conventions:

1. [Apify JavaScript SDK](https://docs.apify.com/sdk/js)
2. [Apify Actors](https://docs.apify.com/platform/actors)
3. [Apify Dataset storage](https://docs.apify.com/platform/storage/dataset)
4. [JSON Schema specification](https://json-schema.org/specification)
5. [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)

### Contract files

The three Apify schemas are in `.actor/`: input, Dataset, and output. Normative input and report schemas, limits, and pricing are in `contract/`. `SPEC.md` is the implementation contract for this local builder.

### Related Actors

Use these public Actors to collect, normalize, compare, and act on evidence before or after building a chronology:

| Actor | What it adds |
| --- | --- |
| [US Brand Federal Award Snapshot](https://apify.com/zinin/us-brand-federal-award-snapshot) | Collects bounded official federal-award evidence for a brand workflow. |
| [US Brand Offer Evidence Normalizer](https://apify.com/zinin/us-brand-offer-evidence-normalizer) | Normalizes buyer-supplied offer observations into stable evidence rows. |
| [US Brand Evidence Snapshot Diff](https://apify.com/zinin/us-brand-evidence-snapshot-diff) | Compares two normalized evidence snapshots after chronology preparation. |
| [US Brand Signal Metrics Aggregator](https://apify.com/zinin/us-brand-signal-metrics-aggregator) | Summarizes normalized signal rows into deterministic portfolio metrics. |
| [US Brand Action Queue](https://apify.com/zinin/us-brand-action-queue) | Converts reviewed evidence into a bounded, ordered follow-up queue. |

These are separate public products. This Actor does not call them or create hidden child-run charges.

# Actor input Schema

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

Required closed contract version.

## `asOf` (type: `string`):

Explicit UTC timestamp; the runtime never reads the current clock.

## `rows` (type: `array`):

One to 30 closed rows. Input order is not semantic.

## Actor input object example

```json
{
  "schemaVersion": "1.0",
  "asOf": "2026-08-05T09:00:00Z",
  "rows": [
    {
      "evidenceId": "nike-offer-001",
      "eventType": "offer",
      "effectiveAt": "2026-08-04T12:00:00Z",
      "observedAt": "2026-08-04T12:30:00Z",
      "sourceUrl": "https://www.nike.com/news/example",
      "fact": "A submitted source reports a US offer change."
    },
    {
      "evidenceId": "nike-award-001",
      "eventType": "award",
      "effectiveAt": "2026-08-04T12:00:00Z",
      "observedAt": "2026-08-04T13:00:00Z",
      "sourceUrl": "https://www.usaspending.gov/award/example",
      "fact": "A submitted source lists an award associated with the brand."
    }
  ]
}
```

# Actor output Schema

## `OUTPUT` (type: `string`):

API link to the bounded terminal record when the OUTPUT write succeeds.

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

API link to the one paid deterministic chronology Dataset item.

# 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 = {
    "schemaVersion": "1.0",
    "asOf": "2026-08-05T09:00:00Z",
    "rows": [
        {
            "evidenceId": "nike-offer-001",
            "eventType": "offer",
            "effectiveAt": "2026-08-04T12:00:00Z",
            "observedAt": "2026-08-04T12:30:00Z",
            "sourceUrl": "https://www.nike.com/news/example",
            "fact": "A submitted source reports a US offer change."
        },
        {
            "evidenceId": "nike-award-001",
            "eventType": "award",
            "effectiveAt": "2026-08-04T12:00:00Z",
            "observedAt": "2026-08-04T13:00:00Z",
            "sourceUrl": "https://www.usaspending.gov/award/example",
            "fact": "A submitted source lists an award associated with the brand."
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/us-brand-evidence-chronology-builder").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 = {
    "schemaVersion": "1.0",
    "asOf": "2026-08-05T09:00:00Z",
    "rows": [
        {
            "evidenceId": "nike-offer-001",
            "eventType": "offer",
            "effectiveAt": "2026-08-04T12:00:00Z",
            "observedAt": "2026-08-04T12:30:00Z",
            "sourceUrl": "https://www.nike.com/news/example",
            "fact": "A submitted source reports a US offer change.",
        },
        {
            "evidenceId": "nike-award-001",
            "eventType": "award",
            "effectiveAt": "2026-08-04T12:00:00Z",
            "observedAt": "2026-08-04T13:00:00Z",
            "sourceUrl": "https://www.usaspending.gov/award/example",
            "fact": "A submitted source lists an award associated with the brand.",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("zinin/us-brand-evidence-chronology-builder").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 '{
  "schemaVersion": "1.0",
  "asOf": "2026-08-05T09:00:00Z",
  "rows": [
    {
      "evidenceId": "nike-offer-001",
      "eventType": "offer",
      "effectiveAt": "2026-08-04T12:00:00Z",
      "observedAt": "2026-08-04T12:30:00Z",
      "sourceUrl": "https://www.nike.com/news/example",
      "fact": "A submitted source reports a US offer change."
    },
    {
      "evidenceId": "nike-award-001",
      "eventType": "award",
      "effectiveAt": "2026-08-04T12:00:00Z",
      "observedAt": "2026-08-04T13:00:00Z",
      "sourceUrl": "https://www.usaspending.gov/award/example",
      "fact": "A submitted source lists an award associated with the brand."
    }
  ]
}' |
apify call zinin/us-brand-evidence-chronology-builder --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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