# Dataset Quality Checker (`riad_h/dataset-quality-checker`) Actor

Validate any Apify dataset for data quality issues. Check emails, URLs, phones, duplicates, and missing fields.

- **URL**: https://apify.com/riad\_h/dataset-quality-checker.md
- **Developed by:** [Riad Hossain](https://apify.com/riad_h) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $40.00 / 1,000 results

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/running/actors-in-store.md#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

## Dataset Quality Checker — Validate Apify Datasets

> Validate any Apify dataset for data quality issues. Check for invalid emails, broken URLs, bad phone numbers, duplicate records, and missing fields. Get a quality score and actionable report.

### The Problem

You ran an Apify Actor and got a dataset with 10,000 records. But datasets can contain:

- Missing emails
- Duplicate records
- Invalid URLs
- Bad phone numbers
- Empty fields

**This Actor scans your dataset and tells you exactly what's wrong.**

### Example Output

```
DATA QUALITY REPORT

Dataset: abc123XY
Records: 10,000

Duplicates:          312
Invalid emails:       48
Invalid URLs:        121
Invalid phones:       35
Missing names:        87
Empty records:         3
Total issues:        606

Quality score: 91/100 (Grade: A)
Processing time: 1.2s
```

### How It Works

```
Apify Dataset ID
      ↓
Load all records
      ↓
Validate emails (RFC 5322)
Validate URLs (domain + TLD)
Validate phones (E.164, 7-15 digits)
Detect duplicates (case-insensitive)
Detect missing/empty fields
      ↓
Calculate quality score (0-100)
      ↓
Push report to dataset
```

### Input

```json
{
  "datasetId": "abc123XY",
  "emailFields": ["email", "emails", "contact.email"],
  "urlFields": ["url", "website", "websiteUrl"],
  "phoneFields": ["phone", "phoneNumber", "contact.phone"],
  "nameFields": ["name", "companyName", "businessName"],
  "duplicateCheckFields": ["email", "url", "phone", "name"],
  "maxRecords": 50000
}
```

Only `datasetId` is required. All other fields have sensible defaults.

### Output

```json
{
  "dataset_id": "abc123XY",
  "total_records": 10000,
  "processed_records": 10000,
  "duplicate_count": 312,
  "invalid_emails": 48,
  "invalid_urls": 121,
  "invalid_phones": 35,
  "missing_names": 87,
  "empty_records": 3,
  "total_issues": 606,
  "quality_score": 91.0,
  "quality_grade": "A",
  "email_issues": [...],
  "url_issues": [...],
  "phone_issues": [...],
  "name_issues": [...],
  "sample_duplicates": [...],
  "sample_invalid_emails": [...],
  "sample_invalid_urls": [...],
  "checked_at": "2026-08-30T18:00:00Z",
  "processing_time_ms": 1200
}
```

### Quality Score

The score is a weighted average:

- Email validity: 25%
- URL validity: 20%
- Phone validity: 15%
- Name completeness: 20%
- Duplicate rate: 20%

| Score | Grade | Meaning |
|-------|-------|---------|
| 95+ | A | Excellent data quality |
| 85-94 | B | Good, minor issues |
| 70-84 | C | Moderate issues, cleanup recommended |
| 50-69 | D | Significant quality problems |
| <50 | F | Poor data quality, major cleanup needed |

### Use Cases

1. **Lead generation validation** — Check scraped lead data before importing to CRM
2. **Pipeline quality monitoring** — Validate datasets in automated workflows
3. **Pre-import cleanup** — Identify issues before data migration
4. **Actor output auditing** — Verify your Apify Actors produce quality output

### Pricing

**Pay-per-event: $0.05 per `dataset-quality-check` event**

One event = one complete dataset quality report.

### License

MIT

# Actor input Schema

## `records` (type: `array`):

Direct list of records to validate. Use this for pipeline integration or when you have records in memory.

## `datasetId` (type: `string`):

Apify Dataset ID to fetch records from. Requires apifyToken if used.

## `apifyToken` (type: `string`):

Your Apify API token. Required only if using datasetId. Find it at console.apify.com → Settings → Integrations.

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

Field names to check for email validity.

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

Field names to check for URL validity.

## `phoneFields` (type: `array`):

Field names to check for phone validity.

## `nameFields` (type: `array`):

Field names to check for missing values.

## `duplicateCheckFields` (type: `array`):

Fields used for duplicate detection.

## `maxRecords` (type: `integer`):

Maximum records to check.

## Actor input object example

```json
{
  "records": [
    {
      "name": "Alice Corp",
      "email": "alice@example.com",
      "phone": "+1-555-123-4567",
      "website": "https://alice.com"
    },
    {
      "name": "Bob Inc",
      "email": "bob@example.com",
      "phone": "5559876543",
      "website": "bob.com"
    },
    {
      "name": "",
      "email": "invalid-email",
      "phone": "123",
      "website": "not-a-url"
    }
  ],
  "datasetId": "",
  "apifyToken": "",
  "emailFields": [
    "email",
    "emails",
    "contact.email",
    "emailAddress"
  ],
  "urlFields": [
    "url",
    "website",
    "websiteUrl",
    "contact.website",
    "link"
  ],
  "phoneFields": [
    "phone",
    "phoneNumber",
    "contact.phone",
    "telephone"
  ],
  "nameFields": [
    "name",
    "companyName",
    "businessName",
    "title",
    "business_name"
  ],
  "duplicateCheckFields": [
    "email",
    "url",
    "phone",
    "name"
  ],
  "maxRecords": 50000
}
```

# Actor output Schema

## `results` (type: `string`):

View the complete quality report with scores, issues, and sample data.

# 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 = {
    "records": [
        {
            "name": "Alice Corp",
            "email": "alice@example.com",
            "phone": "+1-555-123-4567",
            "website": "https://alice.com"
        },
        {
            "name": "Bob Inc",
            "email": "bob@example.com",
            "phone": "5559876543",
            "website": "bob.com"
        },
        {
            "name": "",
            "email": "invalid-email",
            "phone": "123",
            "website": "not-a-url"
        }
    ],
    "datasetId": "",
    "apifyToken": "",
    "emailFields": [
        "email",
        "emails",
        "contact.email",
        "emailAddress"
    ],
    "urlFields": [
        "url",
        "website",
        "websiteUrl",
        "contact.website",
        "link"
    ],
    "phoneFields": [
        "phone",
        "phoneNumber",
        "contact.phone",
        "telephone"
    ],
    "nameFields": [
        "name",
        "companyName",
        "businessName",
        "title",
        "business_name"
    ],
    "duplicateCheckFields": [
        "email",
        "url",
        "phone",
        "name"
    ],
    "maxRecords": 50000
};

// Run the Actor and wait for it to finish
const run = await client.actor("riad_h/dataset-quality-checker").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 = {
    "records": [
        {
            "name": "Alice Corp",
            "email": "alice@example.com",
            "phone": "+1-555-123-4567",
            "website": "https://alice.com",
        },
        {
            "name": "Bob Inc",
            "email": "bob@example.com",
            "phone": "5559876543",
            "website": "bob.com",
        },
        {
            "name": "",
            "email": "invalid-email",
            "phone": "123",
            "website": "not-a-url",
        },
    ],
    "datasetId": "",
    "apifyToken": "",
    "emailFields": [
        "email",
        "emails",
        "contact.email",
        "emailAddress",
    ],
    "urlFields": [
        "url",
        "website",
        "websiteUrl",
        "contact.website",
        "link",
    ],
    "phoneFields": [
        "phone",
        "phoneNumber",
        "contact.phone",
        "telephone",
    ],
    "nameFields": [
        "name",
        "companyName",
        "businessName",
        "title",
        "business_name",
    ],
    "duplicateCheckFields": [
        "email",
        "url",
        "phone",
        "name",
    ],
    "maxRecords": 50000,
}

# Run the Actor and wait for it to finish
run = client.actor("riad_h/dataset-quality-checker").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 '{
  "records": [
    {
      "name": "Alice Corp",
      "email": "alice@example.com",
      "phone": "+1-555-123-4567",
      "website": "https://alice.com"
    },
    {
      "name": "Bob Inc",
      "email": "bob@example.com",
      "phone": "5559876543",
      "website": "bob.com"
    },
    {
      "name": "",
      "email": "invalid-email",
      "phone": "123",
      "website": "not-a-url"
    }
  ],
  "datasetId": "",
  "apifyToken": "",
  "emailFields": [
    "email",
    "emails",
    "contact.email",
    "emailAddress"
  ],
  "urlFields": [
    "url",
    "website",
    "websiteUrl",
    "contact.website",
    "link"
  ],
  "phoneFields": [
    "phone",
    "phoneNumber",
    "contact.phone",
    "telephone"
  ],
  "nameFields": [
    "name",
    "companyName",
    "businessName",
    "title",
    "business_name"
  ],
  "duplicateCheckFields": [
    "email",
    "url",
    "phone",
    "name"
  ],
  "maxRecords": 50000
}' |
apify call riad_h/dataset-quality-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,riad_h/dataset-quality-checker"
        }
    }
}

```

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/usGvg3V34ahcijG5Q/builds/2otEhv5dJBzGFImsX/openapi.json
