# Apify Dataset Release QA Gate (`rotvuvo/apify-dataset-release-qa-gate`) Actor

Audit pasted Apify-style dataset rows for release-readiness quality signals before publishing or trusting output.

- **URL**: https://apify.com/rotvuvo/apify-dataset-release-qa-gate.md
- **Developed by:** [Wit Nomad](https://apify.com/rotvuvo) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Apify Dataset Release QA Gate

Audit pasted Apify-style dataset rows before you publish or trust an Actor output. The Actor produces one structured release-readiness report with blockers, warnings, scores, and sampled problem rows.

### What it does

- Checks required fields for missing or empty values.
- Detects duplicate rows using one or more top-level unique key fields.
- Normalizes domain and URL-like keys for duplicate detection.
- Reports field coverage for inspected fields.
- Flags type drift across rows, such as a field switching between number, string, and null.
- Validates configured URL/domain fields and email fields.
- Pushes a single summary QA report item to the default dataset.

### Input

This MVP supports `items` mode only.

Required:

- `items`: non-empty array of dataset row objects to audit.

Optional:

- `requiredFields`: top-level field names expected to be present and non-empty.
- `uniqueKeys`: top-level field names used as a composite duplicate key.
- `urlFields`: top-level field names expected to contain URLs or domains.
- `emailFields`: top-level field names expected to contain emails.
- `maxRows`: maximum rows to inspect. Default: `1000`.
- `strictMode`: when true, warnings become release blockers.

Example input:

```json
{
  "items": [
    {
      "name": "Acme AI",
      "domain": "https://acme.ai",
      "email": "hello@acme.ai"
    },
    {
      "name": "Acme AI Inc.",
      "domain": "acme.ai",
      "email": ""
    }
  ],
  "requiredFields": ["name", "domain"],
  "uniqueKeys": ["domain"],
  "urlFields": ["domain"],
  "emailFields": ["email"]
}
````

### Output

The Actor always emits one summary dataset item for any valid non-empty `items` input.

The default dataset is documented by `.actor/dataset_schema.json` for the Store/API output tab. The overview table highlights the release grade, score, row count, duplicate group count, blockers, warnings, recommendations, sample problem rows, and check timestamp.

Key output fields:

- `rowCount`
- `overallScore`
- `grade`: `PASS`, `WARN`, or `FAIL`
- `blockers`
- `warnings`
- `recommendations`
- `duplicateGroups`
- `missingRequiredCounts`
- `fieldCoverage`
- `typeDriftWarnings`
- `urlWarnings`
- `emailWarnings`
- `sampleProblemRows`

Example output shape:

```json
{
  "rowCount": 5,
  "overallScore": 58,
  "grade": "FAIL",
  "blockers": ["Required field \"name\" is missing in 40% of inspected rows."],
  "duplicateCount": 1,
  "missingRequiredCounts": { "name": 2, "domain": 0 }
}
```

### Scoring

The score starts at 100 and subtracts capped penalties for missing required values, duplicate groups, URL/domain warnings, email warnings, and type drift. A report fails when blockers exist or the score drops below 60.

### MVP limitations

- It does not fetch Apify datasets by ID.
- It does not call the Apify cloud API.
- It does not scrape websites.
- It does not use AI/LLM.
- It does not clean or mutate data; it reports quality signals only.
- It does not guarantee Store approval, legal compliance, deliverability, lead accuracy, or commercial usefulness.
- It supports top-level fields only for required-field, unique-key, URL/domain, and email checks.

### Running it

In Apify Console, start with the prefilled input in Apify Console or paste rows using the example input shape above. The prefilled sample intentionally contains quality issues, so a `FAIL` report is expected and proves the audit path is working.

For local source checkout verification:

```bash
npm install
npm test
apify validate-schema
```

To run locally without Apify storage, save the example input as `input.json` and run:

```bash
node src/main.js --input input.json --output output.json
```

# Actor input Schema

## `mode` (type: `string`):

Input mode. This MVP supports pasted dataset rows only.

## `items` (type: `array`):

Rows from an Apify dataset, spreadsheet, JSON export, or local sample. This MVP audits pasted rows only and does not fetch datasets by ID.

## `requiredFields` (type: `array`):

Top-level fields that should be present and non-empty in each audited row.

## `uniqueKeys` (type: `array`):

Top-level fields used as a composite key for duplicate detection. Domain and URL-like fields are normalized before comparison.

## `urlFields` (type: `array`):

Top-level fields expected to contain a URL or domain-like value.

## `emailFields` (type: `array`):

Top-level fields expected to contain email values.

## `maxRows` (type: `integer`):

Maximum input rows to inspect. Leave the default in place for normal runs; do not use this as a tiny Store QA prefill limit.

## `strictMode` (type: `boolean`):

When true, any warning is treated as a release blocker.

## Actor input object example

```json
{
  "mode": "items",
  "items": [
    {
      "name": "Acme AI",
      "domain": "https://acme.ai",
      "email": "hello@acme.ai",
      "employeeCount": 42,
      "sourceUrl": "https://example.com/acme"
    },
    {
      "name": "Acme AI Inc.",
      "domain": "acme.ai",
      "email": "",
      "employeeCount": "42",
      "sourceUrl": "not a url"
    },
    {
      "name": "Beta Tools",
      "domain": "beta.tools",
      "email": "sales@beta.tools",
      "employeeCount": 12,
      "sourceUrl": "https://example.com/beta"
    },
    {
      "name": "",
      "domain": "gamma.example",
      "email": "bad-email",
      "employeeCount": null,
      "sourceUrl": "https://example.com/gamma"
    },
    {
      "domain": "delta.example",
      "email": "contact@delta.example",
      "employeeCount": 8,
      "sourceUrl": "https://example.com/delta"
    }
  ],
  "requiredFields": [
    "name",
    "domain"
  ],
  "uniqueKeys": [
    "domain"
  ],
  "urlFields": [
    "domain",
    "sourceUrl"
  ],
  "emailFields": [
    "email"
  ],
  "maxRows": 1000,
  "strictMode": false
}
```

# 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 = {
    "mode": "items",
    "items": [
        {
            "name": "Acme AI",
            "domain": "https://acme.ai",
            "email": "hello@acme.ai",
            "employeeCount": 42,
            "sourceUrl": "https://example.com/acme"
        },
        {
            "name": "Acme AI Inc.",
            "domain": "acme.ai",
            "email": "",
            "employeeCount": "42",
            "sourceUrl": "not a url"
        },
        {
            "name": "Beta Tools",
            "domain": "beta.tools",
            "email": "sales@beta.tools",
            "employeeCount": 12,
            "sourceUrl": "https://example.com/beta"
        },
        {
            "name": "",
            "domain": "gamma.example",
            "email": "bad-email",
            "employeeCount": null,
            "sourceUrl": "https://example.com/gamma"
        },
        {
            "domain": "delta.example",
            "email": "contact@delta.example",
            "employeeCount": 8,
            "sourceUrl": "https://example.com/delta"
        }
    ],
    "requiredFields": [
        "name",
        "domain"
    ],
    "uniqueKeys": [
        "domain"
    ],
    "urlFields": [
        "domain",
        "sourceUrl"
    ],
    "emailFields": [
        "email"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rotvuvo/apify-dataset-release-qa-gate").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 = {
    "mode": "items",
    "items": [
        {
            "name": "Acme AI",
            "domain": "https://acme.ai",
            "email": "hello@acme.ai",
            "employeeCount": 42,
            "sourceUrl": "https://example.com/acme",
        },
        {
            "name": "Acme AI Inc.",
            "domain": "acme.ai",
            "email": "",
            "employeeCount": "42",
            "sourceUrl": "not a url",
        },
        {
            "name": "Beta Tools",
            "domain": "beta.tools",
            "email": "sales@beta.tools",
            "employeeCount": 12,
            "sourceUrl": "https://example.com/beta",
        },
        {
            "name": "",
            "domain": "gamma.example",
            "email": "bad-email",
            "employeeCount": None,
            "sourceUrl": "https://example.com/gamma",
        },
        {
            "domain": "delta.example",
            "email": "contact@delta.example",
            "employeeCount": 8,
            "sourceUrl": "https://example.com/delta",
        },
    ],
    "requiredFields": [
        "name",
        "domain",
    ],
    "uniqueKeys": ["domain"],
    "urlFields": [
        "domain",
        "sourceUrl",
    ],
    "emailFields": ["email"],
}

# Run the Actor and wait for it to finish
run = client.actor("rotvuvo/apify-dataset-release-qa-gate").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 '{
  "mode": "items",
  "items": [
    {
      "name": "Acme AI",
      "domain": "https://acme.ai",
      "email": "hello@acme.ai",
      "employeeCount": 42,
      "sourceUrl": "https://example.com/acme"
    },
    {
      "name": "Acme AI Inc.",
      "domain": "acme.ai",
      "email": "",
      "employeeCount": "42",
      "sourceUrl": "not a url"
    },
    {
      "name": "Beta Tools",
      "domain": "beta.tools",
      "email": "sales@beta.tools",
      "employeeCount": 12,
      "sourceUrl": "https://example.com/beta"
    },
    {
      "name": "",
      "domain": "gamma.example",
      "email": "bad-email",
      "employeeCount": null,
      "sourceUrl": "https://example.com/gamma"
    },
    {
      "domain": "delta.example",
      "email": "contact@delta.example",
      "employeeCount": 8,
      "sourceUrl": "https://example.com/delta"
    }
  ],
  "requiredFields": [
    "name",
    "domain"
  ],
  "uniqueKeys": [
    "domain"
  ],
  "urlFields": [
    "domain",
    "sourceUrl"
  ],
  "emailFields": [
    "email"
  ]
}' |
apify call rotvuvo/apify-dataset-release-qa-gate --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=rotvuvo/apify-dataset-release-qa-gate",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Apify Dataset Release QA Gate",
        "description": "Audit pasted Apify-style dataset rows for release-readiness quality signals before publishing or trusting output.",
        "version": "0.1",
        "x-build-id": "NubtZTCuVFVjaAdo0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/rotvuvo~apify-dataset-release-qa-gate/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-rotvuvo-apify-dataset-release-qa-gate",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/rotvuvo~apify-dataset-release-qa-gate/runs": {
            "post": {
                "operationId": "runs-sync-rotvuvo-apify-dataset-release-qa-gate",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/rotvuvo~apify-dataset-release-qa-gate/run-sync": {
            "post": {
                "operationId": "run-sync-rotvuvo-apify-dataset-release-qa-gate",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "items"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "items"
                        ],
                        "type": "string",
                        "description": "Input mode. This MVP supports pasted dataset rows only.",
                        "default": "items"
                    },
                    "items": {
                        "title": "Dataset rows to audit",
                        "minItems": 1,
                        "type": "array",
                        "description": "Rows from an Apify dataset, spreadsheet, JSON export, or local sample. This MVP audits pasted rows only and does not fetch datasets by ID.",
                        "items": {
                            "type": "object"
                        }
                    },
                    "requiredFields": {
                        "title": "Required fields",
                        "type": "array",
                        "description": "Top-level fields that should be present and non-empty in each audited row.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "uniqueKeys": {
                        "title": "Unique key fields",
                        "type": "array",
                        "description": "Top-level fields used as a composite key for duplicate detection. Domain and URL-like fields are normalized before comparison.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "urlFields": {
                        "title": "URL or domain fields",
                        "type": "array",
                        "description": "Top-level fields expected to contain a URL or domain-like value.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "emailFields": {
                        "title": "Email fields",
                        "type": "array",
                        "description": "Top-level fields expected to contain email values.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxRows": {
                        "title": "Maximum rows",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum input rows to inspect. Leave the default in place for normal runs; do not use this as a tiny Store QA prefill limit.",
                        "default": 1000
                    },
                    "strictMode": {
                        "title": "Strict mode",
                        "type": "boolean",
                        "description": "When true, any warning is treated as a release blocker.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
