# Data Gap Auditor: Duplicate Keys, Missing vs Zero, Time Gaps (`geeky_goth_gamer/data-gap-auditor`) Actor

Find what parsers silently lose before you import, migrate or chart a file: duplicate JSON keys, duplicate CSV headers, short rows, missing vs null vs blank vs zero, conflicting duplicate ids, lost leading zeros and time-series gaps with exact missing slots. $0.002 per file.

- **URL**: https://apify.com/geeky_goth_gamer/data-gap-auditor.md
- **Developed by:** [Chris Day](https://apify.com/geeky_goth_gamer) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 files audited

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/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

## Data Gap Auditor: Duplicate Keys, Missing vs Zero, Time Gaps

Most data bugs are silent: the parser keeps going and something is gone. Run this on the RAW file before you convert, migrate, import or chart it.

| Check | What it catches |
|---|---|
| `json-duplicate-key` | A key repeated in one object, at any depth. `json.loads` / `JSON.parse` keep only the last value; you get every value in file order and whether they differ |
| `csv-duplicate-header` | `price,price`: csv.DictReader keeps the last column, pandas renames to `price.1`. Same file, different objects |
| `csv-short-row` / `csv-long-row` | Rows with fewer or more cells than the header: missing cells silently become `""` |
| `mixed-absence` | A field that is missing in some records, `null` in others and `""` in others (each count reported separately, plus zeros) |
| `id-duplicate` / `id-conflict` | Repeated ids split into exact duplicates (safe to dedupe) and conflicts (same id, different content: a dedupe would drop a real change) |
| `ts-gap` | Expected slots with no record (observed / expected / missing, with the missing times). A correct row count can hide a gap when a duplicate fills it |
| `ts-conflict` / `ts-duplicate` | A repeated timestamp with different values (conflict) vs the same value (duplicate) |
| `csv-leading-zero` | Codes like `02134` that a number cast destroys |
| `json-unsafe-integer`, `json-nonstandard-number` | Integers beyond 2^53, NaN/Infinity literals |
| also | BOM, padded or empty headers, formatted numbers (`1,234`, `$5`), unparseable or out-of-order timestamps, NDJSON lines that are not JSON |

Output: `verdict` (`CLEAN`, `MINOR` or `ISSUES`), findings sorted by severity with row numbers / paths and examples, a per-field profile (present / missing / null / empty / zero / types) and, with a timestamp field, a machine-readable `coverage` line: `{expected, observed, missing, missingSlots}`.

### Example

```json
{"text": "[{\"t\":0,\"v\":1},{\"t\":1,\"v\":1},{\"t\":3,\"v\":5},{\"t\":3,\"v\":6},{\"t\":4,\"v\":1}]", "timestampField": "t", "expectedIntervalSecs": 1}
```

→ 5 rows, but `coverage` says expected 5, observed 4, missing second 2, and second 3 is a conflict.

Send the raw text as a string (`text`) or a public `url`. Parsed JSON objects are refused, because duplicate keys are already gone by then. Holidays in business-day series show as gaps (`skipWeekends` skips Saturdays and Sundays only).

### Connect (MCP)

```
https://mcp.apify.com/?tools=geeky_goth_gamer/data-gap-auditor
```

- Claude Code: `claude mcp add --transport http data-gap-auditor "https://mcp.apify.com/?tools=geeky_goth_gamer/data-gap-auditor"`
- Cursor / VS Code / Claude Desktop `mcp.json`: `{"mcpServers": {"data-gap-auditor": {"url": "https://mcp.apify.com/?tools=geeky_goth_gamer/data-gap-auditor"}}}`

Sign in with your Apify account when asked (OAuth), or send `Authorization: Bearer <APIFY_TOKEN>`.

### Standby HTTP API (lowest latency)

`POST https://geeky-goth-gamer--data-gap-auditor.apify.actor/audit` with `Authorization: Bearer $APIFY_TOKEN` and a JSON body (same fields as the batch input). `GET /health` is free.

### Building a product on it?

Keep your own Apify token on your server, pay the per-event price, and set your own resale price. Your users never need an Apify account. Never ship the token in a client config.

### Pricing (pay per event)

| Event | Price |
|---|---|
| `file-audited` | $0.002 per file (up to 5 MB / 200,000 rows) |
| Actor start | $0.00005 |

Invalid input and unreadable files are free.

### Limits

- Deterministic rules, no AI and no guessing: it reports what is in the bytes, it does not repair the file.
- 5 MB per file; CSV dialect is sniffed (set `delimiter` to override). Up to 50 examples per check.
- URLs must be public http(s); private and local addresses are refused.

# Actor input Schema

## `text` (type: `string`):

Paste the RAW JSON, NDJSON or CSV text (not parsed JSON, or duplicate keys are already gone). Up to 5 MB.

## `url` (type: `string`):

Public http(s) link to the file (up to 5 MB).

## `format` (type: `string`):

Format.

## `idField` (type: `string`):

Find duplicate ids, split into exact duplicates (safe to dedupe) and conflicts (same id, different content).

## `timestampField` (type: `string`):

ISO 8601 or epoch seconds/ms. Enables coverage: observed vs expected slots, gaps, duplicate vs conflicting timestamps.

## `expectedIntervalSecs` (type: `number`):

e.g. 1 for 1 Hz, 3600 hourly, 86400 daily. Inferred from the median step if empty.

## `skipWeekends` (type: `boolean`):

For business-day series: Saturday/Sunday slots (UTC) are not counted as missing.

## `expectedStart` (type: `string`):

Count gaps from this time instead of the first record.

## `expectedEnd` (type: `string`):

Count gaps up to this time instead of the last record.

## `valueField` (type: `string`):

Compare only this field when deciding duplicate vs conflict for a repeated timestamp.

## `recordsPath` (type: `string`):

Dot path to the record list, e.g. data.items. Auto-detected if empty.

## `delimiter` (type: `string`):

One character. Sniffed if empty.

## Actor input object example

```json
{
  "text": "{\"id\": 1, \"price\": 10.00, \"price\": 12.50}",
  "format": "auto",
  "skipWeekends": false
}
```

# 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 = {
    "text": "{\"id\": 1, \"price\": 10.00, \"price\": 12.50}"
};

// Run the Actor and wait for it to finish
const run = await client.actor("geeky_goth_gamer/data-gap-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 = { "text": "{\"id\": 1, \"price\": 10.00, \"price\": 12.50}" }

# Run the Actor and wait for it to finish
run = client.actor("geeky_goth_gamer/data-gap-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 '{
  "text": "{\\"id\\": 1, \\"price\\": 10.00, \\"price\\": 12.50}"
}' |
apify call geeky_goth_gamer/data-gap-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,geeky_goth_gamer/data-gap-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/SgSuVaPZCRDfW9rvb/builds/OlqXrX9SFDpnUqlg5/openapi.json
