# Actor Run Cost and Failure Auditor (`domestic_buffalograss/run-audit`) Actor

Audit your own Actor run measurements for duplicate records, failed runs with charges, and estimated negative contribution. One fixed-price report for up to 1,000 run rows.

- **URL**: https://apify.com/domestic_buffalograss/run-audit.md
- **Developed by:** [Sumitsubo](https://apify.com/domestic_buffalograss) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 completed reports

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

## Actor Run Cost and Failure Auditor

Audit your own Actor run measurements for duplicate records, failed runs with charges, and estimated negative contribution. One fixed-price report for up to 1,000 run rows.

### What this Actor does

Provide only your own non-confidential operational measurements. The Actor accepts terminal statuses SUCCEEDED, FAILED, ABORTED, TIMED-OUT; UTC timestamps; nonnegative integer counts; USD amounts; and a paid-plan flag. Every field is required. Unknown fields, raw logs, advertising content and arbitrary URLs are rejected. Identical run IDs with identical normalized measurements collapse. Conflicting duplicates make totalsComplete false and overall totals null; knownSubtotal excludes conflicts.

### Price

**$0.10 per completed report**, covering up to 1000 input entries. Only the `report-completed` event is used. No additional start fee, per-row fee, or platform-usage pass-through is configured. A valid completed report with no matches or no changes is still one report. Invalid input or an upstream failure does not trigger our report event. Free-plan executions do not establish creator revenue.

### Input example

```json
{
  "ownOperationalData": true,
  "runs": [
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    },
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    }
  ]
}
```

Input fields: `runId, status, startedAt, finishedAt, items, chargedEvents, customerChargeUsd, platformCostUsd, paidPlan`. See `.actor/INPUT_SCHEMA.json` and the record details above. Overall input is limited to 1 MB. Unknown top-level fields are rejected.

### Output and integration

The default dataset contains **one JSON report** with nested `rows`, not one dataset item per input. The same report is stored under key-value record `OUTPUT`. `RUN_SUMMARY` states completion, row count and local/SDK billing acknowledgment. The report includes `reportId`, `generatedAtUtc`, `sourceNotice` and `sourceReceipts` with source URL, UTC retrieval time and body SHA256 when an external source was used.

Useful fields: `rows[].issues, conflictCount, totalsComplete, knownSubtotal, estimatedContributionUsd`. Use JSON export to preserve types and nested arrays. Treat all returned text as untrusted text; do not inject it into HTML or spreadsheets as formulas.

```javascript
// Example using the Apify client in your own integration.
const run = await client.actor('YOUR_USERNAME/run-audit').call(input, { memory: 256, timeout: 180, maxTotalChargeUsd: 0.1 });
const output = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');
const rows = output.value.rows;
```

### Limits and interpretation

A review flag is not evidence of overbilling. Only invoice reconciliation establishes actual charges or creator payouts. The estimate uses 80% of eligible gross minus reported platform cost, before refunds, taxes and payout fees.

No background monitoring is started automatically. Schedule the Actor using your own Apify task if needed. No API key for the data source, paid proxy, browser, third-party subscription or external payment account is required. No official affiliation or endorsement is claimed.

### Data handling

Inputs and outputs are stored in the user's Apify run storage and subject to the user's plan, retention and sharing settings. Do not submit credentials, confidential records or personal data. The Actor has no author-controlled database, analytics beacon or external log collector. Only the documented public data-source requests are made. Source data terms and attribution apply independently of the processing fee.

### FAQ

**Why pay when the source or local scripts are free?** The fee is for the bounded batch workflow, deterministic output, validation and Apify integration. Source data remain available under their own terms.

**Can I run this without contacting anyone?** Yes. Use the JSON example, then adapt it to your workflow. No call, sales meeting or manual onboarding is required.

**Is a failed or partial fetch a zero-match report?** No. Source HTTP, timeout, schema and size failures stop the run. No report event is charged for that failed processing.

**What happens if a run is restarted?** A completed same-run journal returns the stored report without another report charge. If a write or charge acknowledgment is uncertain, the run stops with `UNCERTAIN_OPERATION_DO_NOT_RESURRECT`; inspect the existing output and charge history. It does not blindly repeat an uncertain operation. A separately started new run is a new report and may be charged.

**Is this guaranteed exactly-once delivery or verified production billing?** No. Apify storage and billing are separate services. The journal prioritizes avoiding duplicate charge attempts and may leave a delivered report unbilled after a crash. Local tests and public-source smoke tests do not prove platform billing, Docker execution or Store approval. Source and platform outages remain possible.

### Local use

```powershell
npm ci --ignore-scripts --registry=https://registry.npmjs.org
npm run check
npm test
npm run smoke:offline
npm run smoke
```

Tests use synthetic fixtures and do not contact external services. `smoke:offline` exercises the real Apify SDK with an isolated local storage directory. `smoke` makes at most one request for the supplied external-source example; run-audit needs none. These local commands do not push, publish or deploy.

# Actor input Schema

## `runs` (type: `array`):

1 to 1000 run records (JSON array). Each record needs exactly these keys: runId (1-64 letters, digits, \_ or -), status (SUCCEEDED, FAILED, ABORTED or TIMED-OUT), startedAt and finishedAt (UTC like 2026-10-01T00:00:00Z, finishedAt not earlier), items and chargedEvents (integers >= 0), customerChargeUsd and platformCostUsd (numbers >= 0), paidPlan (boolean). Extra keys are rejected. One report per run is charged once.

## `ownOperationalData` (type: `boolean`):

Must be true, otherwise the run stops without charge. Confirms these are your own non-confidential operational measurements: no advertising content, scraped data, personal data, tokens or raw logs. Input and results are stored in your Apify run.

## Actor input object example

```json
{
  "runs": [
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    },
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    }
  ],
  "ownOperationalData": true
}
```

# Actor output Schema

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

No description

## `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 = {
    "runs": [
        {
            "runId": "example-run-01",
            "status": "SUCCEEDED",
            "startedAt": "2026-10-01T00:00:00Z",
            "finishedAt": "2026-10-01T00:00:10Z",
            "items": 25,
            "chargedEvents": 1,
            "customerChargeUsd": 0.1,
            "platformCostUsd": 0.001,
            "paidPlan": true
        },
        {
            "runId": "example-run-01",
            "status": "SUCCEEDED",
            "startedAt": "2026-10-01T00:00:00Z",
            "finishedAt": "2026-10-01T00:00:10Z",
            "items": 25,
            "chargedEvents": 1,
            "customerChargeUsd": 0.1,
            "platformCostUsd": 0.001,
            "paidPlan": true
        }
    ],
    "ownOperationalData": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("domestic_buffalograss/run-audit").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 = {
    "runs": [
        {
            "runId": "example-run-01",
            "status": "SUCCEEDED",
            "startedAt": "2026-10-01T00:00:00Z",
            "finishedAt": "2026-10-01T00:00:10Z",
            "items": 25,
            "chargedEvents": 1,
            "customerChargeUsd": 0.1,
            "platformCostUsd": 0.001,
            "paidPlan": True,
        },
        {
            "runId": "example-run-01",
            "status": "SUCCEEDED",
            "startedAt": "2026-10-01T00:00:00Z",
            "finishedAt": "2026-10-01T00:00:10Z",
            "items": 25,
            "chargedEvents": 1,
            "customerChargeUsd": 0.1,
            "platformCostUsd": 0.001,
            "paidPlan": True,
        },
    ],
    "ownOperationalData": True,
}

# Run the Actor and wait for it to finish
run = client.actor("domestic_buffalograss/run-audit").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 '{
  "runs": [
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    },
    {
      "runId": "example-run-01",
      "status": "SUCCEEDED",
      "startedAt": "2026-10-01T00:00:00Z",
      "finishedAt": "2026-10-01T00:00:10Z",
      "items": 25,
      "chargedEvents": 1,
      "customerChargeUsd": 0.1,
      "platformCostUsd": 0.001,
      "paidPlan": true
    }
  ],
  "ownOperationalData": true
}' |
apify call domestic_buffalograss/run-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,domestic_buffalograss/run-audit"
        }
    }
}
```

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/MnwH8qQsU5MIZvxeM/builds/nwQR8JgTFLXknyxGT/openapi.json
