Dataset Cleaner: dedupe, normalize phones, emails and URLs avatar

Dataset Cleaner: dedupe, normalize phones, emails and URLs

Pricing

$3.00 / 1,000 row outputs

Go to Apify Store
Dataset Cleaner: dedupe, normalize phones, emails and URLs

Dataset Cleaner: dedupe, normalize phones, emails and URLs

Clean scraper, CSV or JSON rows: remove duplicates (exact, loose, fuzzy), normalize phones to E.164, emails, URLs, domains, dates and countries, split names, drop empty columns. Reads a dataset ID, file link or pasted rows. No AI. $0.0003 per row written.

Pricing

$3.00 / 1,000 row outputs

Rating

0.0

(0)

Developer

Elio Saliba

Elio Saliba

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

21 hours ago

Last modified

Categories

Features

Limited permissions

Share

Give it a scraper dataset, a CSV or JSON link, or pasted rows, and get clean rows back: duplicates removed, phones written as E.164, emails, URLs and domains normalized, dates in ISO format, countries as ISO codes, full names split, empty columns dropped and columns renamed or selected as you choose.

It is plain code. No AI, no calls to other services, and no data leaves the run. Rows go in, clean rows come out, the same way every time.

Built for people who scrape or buy lists and then spend an hour in a spreadsheet: lead-gen agencies, e-commerce teams merging several stores, data teams preparing a CRM import, and n8n or Make users who want one clean step between a scraper and a sheet.

$0.0003 per row written ($0.30 per 1,000). Duplicates, empty rows and rows you filter out are free. No fee per file. Apify's free monthly credit covers a first test run.

What you get

One row per surviving input row, with your own columns, cleaned, plus the columns your rules add next to the one they came from.

OperationExample inExample out
phone(512) 677-7667+15126777667, phoneValid: true, phoneCountry: "US", phoneType: "fixed_or_mobile"
emailJane <Jane@ACME.com>jane@acme.com, emailValid: true
urlHTTP://www.Acme.com/?utm_source=xhttp://acme.com
domainhttps://blog.acme.co.uk/postacme.co.uk
dateMarch 5, 2024, 05/03/2024, 17096490002024-03-05, 2024-05-03, 2024-03-05T14:30:00Z
countrylebanon, LBN, USALB, LB, US
money1.234,50 €1234.5, priceCurrency: "EUR"
split-nameSMITH, JOHN QfirstName: "John", middleName: "Q", lastName: "Smith"
titleBLUE DOOR BAKERYBlue Door Bakery (mixed-case text such as iPhone is left alone)

Besides the dataset, the run writes a SUMMARY record (rows read and written, duplicates dropped, invalid phones, emails, URLs and dates) and, if you ask for it, a cleaned.csv file in the key-value store. The record holds counts and no row data.

How to use

  1. Point it at your data. Paste rows, add one or more Apify dataset IDs (from the Storage tab of any run), or add links to CSV, JSON or JSONL files. You can mix them. Rows are read in that order and cleaned as one list.
  2. Write rules, one per line: column: operation option=value. For example phone: phone country=LB.
  3. Pick duplicate columns and how strict to be. Press Start.

The default input is a small made-up list of 13 rows with duplicate companies, mixed phone formats, URLs with tracking parameters and country names in different forms. It finishes in seconds and shows every operation.

Use it from an AI agent

In Claude, ChatGPT or Cursor, add the Apify MCP server (https://mcp.apify.com) and ask the agent to run this Actor on a dataset ID or a file link. The agent writes the rules lines and the dedupeBy columns from your sentence.

Example prompt: "Use the Apify Actor opstoolkit/dataset-cleaner on dataset aBcDeFgHiJkLmNoPq: normalize phones to E.164 for Lebanon, remove duplicates by phone or email, keep the most complete row and give me a CSV."

Rules

One rule per line. * as the column applies the rule to every column. A comma lists several columns. Rules run in the order you write them, after whitespace trimming.

*: trim
company: title
contact: split-name
phone: phone country=LB
email: email
website: domain into=domain
website: url
country: country
added: date dayfirst=yes
OperationOptions
trim, collapse-spacesTrim and collapse spaces (also done for you by "Trim whitespace")
lower, upper, strip-accents, strip-htmlPlain text changes. strip-html removes tags and decodes &amp;
titleforce=yes also re-cases mixed-case text
phonecountry=XX (ISO code), format=e164 (default), international or national, extras=no to skip the extra columns
emailextras=no
urlstrip-query=yes, keep-www=yes, scheme=https to force https
domainRegistered domain, public-suffix aware: blog.acme.co.uk gives acme.co.uk
hostFull host name without www
datedayfirst=yes for 31/12/2024 style, time=drop for dates only
countryto=alpha2 (default), alpha3 or name
moneycurrency=USD when none is written, decimal=comma or dot for numbers like 1.234
split-nameWrites firstName, middleName, lastName. Handles Dr., Jr., Last, First and van, de, bin
dropRemoves the column

Options for every operation except drop and split-name:

  • into=newcolumn keeps the original column and writes the result to another one.
  • invalid=blank empties values that could not be read. The default keeps the original text so you can see what failed. Combine with "Drop rows missing these columns" to remove rows with a bad phone or email.

A rule on a list value, such as the emails or phones arrays from company-contact-finder, is applied to every item, and repeated items are merged.

Duplicates

Set dedupeBy to the columns that identify a record, for example phone and email.

ModeWhat counts as the same
exactIdentical after trimming. Case counts
loose (default)Ignores case, accents, punctuation, spacing, www, http, tracking parameters, phone formatting and company endings such as Inc, Ltd, GmbH, SARL
fuzzyLoose, plus close spellings above the similarity you set (default 90 of 100)

dedupeMatch decides whether every listed column has to match (all) or one is enough (any). any is the usual choice for leads: the same phone or the same email means the same business. Choose which row to keep: first, last or most-complete (the row with the most filled columns).

Rows where all the duplicate columns are empty are never treated as duplicates. Phones are compared as E.164 when the number can be read, so (512) 677-7667 and +1 512 677 7667 match. Fuzzy mode compares values that start with the same three letters, so a typo in the first letters is not caught.

Input example

{
"datasetIds": ["YOUR_DATASET_ID"],
"defaultCountry": "LB",
"rules": [
"*: trim",
"company: title",
"phone: phone country=LB",
"email: email invalid=blank",
"website: domain into=domain",
"website: url"
],
"dedupeBy": ["phone", "email", "domain"],
"dedupeMatch": "any",
"keep": "most-complete",
"requiredFields": ["phone"],
"dropEmptyColumns": true,
"exportCsv": true
}

Output example

{
"company": "Blue Door Bakery",
"contact": "MARIA KHOURY",
"firstName": "Maria",
"lastName": "Khoury",
"phone": "+9613123456",
"phoneValid": true,
"phoneCountry": "LB",
"phoneType": "mobile",
"email": "maria@bluedoor.lb",
"emailValid": true,
"website": "https://bluedoor.lb",
"domain": "bluedoor.lb",
"country": "LB",
"added": "2024-03-04"
}

The SUMMARY record for the same run:

{
"rowsRead": 13, "rowsWritten": 7, "duplicatesDropped": 5, "emptyRowsDropped": 1,
"invalid": {"phones": 1, "emails": 1},
"chargedRows": 7, "stoppedAtMaxCost": false
}

Pricing

Pay per event: $0.30 per 1,000 rows written ($0.0003 each). Apify adds a small fee for each run start.

Rows writtenCost
1,000$0.30
10,000$3
100,000$30

You pay only for rows that reach the output. Duplicates, empty rows and rows dropped by "Drop rows missing these columns" are free, and so is reading a dataset or file. Set a max cost per run in the Apify run options to cap spending. When the run reaches it, it stops, and SUMMARY.notReturnedMaxCostReached says how many rows were left out.

Works well with

  • Local Business Leads and Company Contact Finder: pass the dataset ID of a finished run as datasetIds. Clean phone and website, merge several cities or runs into one list, and dedupe on domain, phone and email. The emails and phones of Company Contact Finder are lists, and rules work on each item.
  • Email Validator: copy the cleaned email column into its emails list to check DNS and disposable domains.
  • Phone Number Validator: the same check for phones. Give it the cleaned phone column to get valid or not, line type (mobile, fixed, VoIP), carrier, area and time zones per number, or call it as an API for one number at a time.
  • Domain Rank Lookup: use website: domain into=domain here, then give the cleaned dataset ID to Domain Rank Lookup with the field domain to sort the list by site strength.
  • ATS Jobs Feed: merge the jobs from several runs or boards, drop repeats with dedupeBy on url, and keep only the columns you need with selectFields.

A typical chain: Local Business Leads for a city, Company Contact Finder on the websites, this Actor with dedupeBy on domain, phone and email, Email Validator, then Domain Rank Lookup. Use an Apify webhook or an integration (Zapier, Make, n8n) to start each step when the previous one finishes.

Limits

  • Phone validity is a numbering-plan check. phoneValid: true means the number fits that country's rules for length and prefix, from the libphonenumber data bundled in the Actor. It does not tell you the line is active or who owns it. Numbers without a + need a country (defaultCountry or country=XX).
  • Phone type is a guess for some countries. US numbers come back as fixed_or_mobile because the numbering plan does not separate them.
  • Dates like 03/04/2024 are ambiguous. The default reads month first. Use dayfirst=yes for day first. Dates with only a year or a year and month come back as 2024 or 2024-03.
  • Names are split by common rules. Western and Arabic-style names with particles work. Single names get a first name only. Check unusual names.
  • Country matching covers ISO names, codes and common spellings. Anything else is left as written and counted in SUMMARY.invalid.countriesNotMatched.
  • Memory. Plain runs stream rows and keep only the duplicate keys in memory. Keeping the last or most complete duplicate, dropping empty columns and the CSV file hold the rows too: about 1 GB for 200,000 rows. The default is 256 MB. Raise the run memory for bigger lists. maxRows (default 200,000, up to 2 million) stops the read.
  • Files must be public CSV, JSON or JSONL links, up to 60 MB each. Excel files are not read; save them as CSV. Links to private network addresses are refused.
  • Fuzzy mode compares each value with earlier values that start with the same three letters. It is fast on large lists and misses typos in the first three letters.
  • You are responsible for having a legal basis to process the data you give it. The Actor does not look anyone up and keeps nothing after the run, except the dataset and files in your own account.

Integrations

Everything Apify supports works here: schedules, webhooks, the REST API, and the official integrations with Zapier, Make, n8n and Google Sheets. The API tab has ready code for JavaScript, Python and cURL.

FAQ

Does it use AI? No. Every step is a fixed rule, so the same input always gives the same output, and the price per row does not depend on a model.

Can it merge two datasets? Add both IDs to datasetIds. They are cleaned as one list, and duplicates across them are removed. Set sourceColumn to see which row came from where.

Why was a row dropped? It was empty, it was a duplicate of an earlier row, or it was missing a column from "Drop rows missing these columns". The SUMMARY record counts each kind.

Why did my phone stay as typed? It could not be read as a valid number for the country. Add country=XX to the rule or set the default country. The raw text is kept unless you use invalid=blank.

Something broke. Open an issue on the Issues tab with the run link. I reply within a day.