Dataset Dedupe by Rules: URL, E-mail, Phone + Review
Pricing
from $0.30 / 1,000 compared rows
Dataset Dedupe by Rules: URL, E-mail, Phone + Review
Remove duplicates from Apify datasets and JSON, JSONL or CSV files with ordered rules: exact, text, URL, domain, phone, e-mail and number tolerance. See which rule matched. Fuzzy matches are never merged: they go to a review list with score and reason.
Pricing
from $0.30 / 1,000 compared rows
Rating
0.0
(0)
Developer
Bardach Technologies
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Dataset Dedupe by Rules removes duplicates from your scraped data using rules you can read and change: exact values, normalised text, URL, domain, phone, e-mail and number tolerance. Give it Apify datasets or links to JSON, JSONL or CSV files, list your rules in order, and get the unique rows plus a record of which rule matched which rows and why.
Fuzzy matching never merges anything. A fuzzy_review rule only lists similar pairs, with a score and a reason, so a person can decide. If you want similar names merged automatically, this is not the right tool.
What you get
Record (_dedupe.recordType) | What it is |
|---|---|
unique | Your row, unchanged apart from the _dedupe details and any fields you chose to fill. _dedupe.compared says whether any rule could compare it |
duplicate_group | One group: the kept row, the members, and each match with its rule and reason (optional) |
needs_review | Two rows a fuzzy_review rule found similar. Not merged: both stay in the output. Holds score, reason and where the rows came from |
invalid | A record that could not be used: where it was and why, without its content |
summary | Input, unique, duplicate and invalid counts, in total and per rule |
Records always come in this order. The OUTPUT record gives two ready query strings for the dataset's items link: uniqueRowsQuery (for example limit=5120&omit=_dedupe) for the clean rows and reviewRowsQuery for the review list alone.
How to use it
- Add Dataset IDs, File URLs, or both.
- Write your match rules. The first rule is applied first.
- Choose which row stays and whether empty fields are filled from its duplicates.
- Start the run. Without data it runs on a small sample for free, so you can see the output.
{"datasetIds": ["WkzbQMuFYuamGv3YF"],"fileUrls": ["https://files.example.com/leads.csv"],"rules": [{ "id": "same-site", "type": "normalized_url", "fields": ["website"] },{ "id": "same-mail", "type": "email", "fields": ["email"] },{ "id": "same-price", "type": "numeric", "fields": ["price"], "blockFields": ["sku"], "tolerance": 0.5 },{ "id": "similar-name", "type": "fuzzy_review", "fields": ["company"], "blockFields": ["city"], "threshold": 0.85 }],"survivor": "most_complete","mergeEmptyFields": true}
Match rules
| Type | Rows match when | Merges? |
|---|---|---|
exact | The values are identical (1 and "1" differ; key order inside objects does not matter) | Yes |
normalized_text | Equal apart from case, repeated spaces, invisible characters and punctuation at the edge of a word (Acme, Inc. = acme inc) | Yes |
normalized_url | Same address, ignoring http/https, www., the scheme's own default port, # parts, trailing slashes, query order and tracking parameters such as utm_*, gclid, fbclid | Yes |
domain | Same host name without www. (shop.example.com and example.com differ) | Yes |
phone | Same number after normalising, extension included; compared as hashes only | Yes |
email | Same valid address, ignoring case and mailto:; compared as hashes only | Yes |
numeric | Equal blockFields and a difference within tolerance, measured from the lowest value of the cluster, so a chain of small steps does not merge | Yes |
fuzzy_review | Similar text. See below | Never |
normalized_text is deliberately strict. Accents, signs, symbols and punctuation inside a word all count, so these stay apart: Müller / Muller, Maße / Masse, C++ / C#, (-5) / (5), 5 % / 5, 1.5 / 1/5, 1,000 / 1.000.
Values that are not usable never match and are not billed: empty text, invisible characters, [null], ["N/A"], {"a":""}, and placeholders in any spelling such as N/A., (none), unknown!, -. Over-long values are also refused for their rule: URLs above 8,192 characters, e-mails above 320, phone numbers above 64. Dates are not phone numbers, addresses with a user name are not URLs, and a value written without a scheme must end like a real host, so main.py, Dr.No and v1.2 are not domains.
A rule with several fields needs all of them to match, field by field. With a single field that holds a list, one shared value is enough. Rules work together: if rule 1 joins A and B and rule 2 joins B and C, all three are one group.
What fuzzy_review does
The score runs from 0 to 1 and compares the two texts with case, Latin accents, punctuation and word order ignored. A pair at or above threshold (default 0.85) becomes a needs_review record with one of these reasons:
| Reason | Meaning |
|---|---|
same_words | The same words, possibly in another order or split across fields differently |
possible_typo | One or two words are one edit apart. This can still be two different names (Stanford / Stamford) |
numbers_differ | Words holding a digit differ or come in another order (Store 12 / Store 13) |
words_differ | Other differences |
Expect misses. This rule finds spelling slips, not different ways of writing a name: Acme Corp / Acme Corporation and 123 Main Street / 123 Main St usually score below the threshold and are not listed at all. Many listed pairs are not duplicates. Lowering the threshold finds more and lists more noise.
Candidates are rows sharing blockFields, or, without them, the first four letters of a word. A block over 200 rows is not compared, texts over 4,096 characters are not compared, and comparisons are limited per run by count (500 per input row, at least 20,000, at most 5 million) and by a work budget that grows with the rows billed. The summary reports oversizeBlocks, rowsInOversizeBlocks and comparisonLimitReached per rule. The needs_review records show the compared text, so do not use this rule on a field you do not want to see there.
What is kept, and what is limited
Every run satisfies: input rows = valid + invalid, and valid = unique + duplicates.
- A row with no content at all (
{}, only blanks or placeholders, only true/false flags) is invalid with reasonempty_row: free and not written. - A row with content that no rule could compare stays unique and is written free, up to 5 per billed row (at least 100). Rows beyond that are not written;
uncomparedRowsNotWrittencounts them. Add a rule that covers them if you need them all. invalidandneeds_reviewrecords are each listed up to 5 per billed row (at least 100, at most 10,000), best scores first. The totals in the summary are always complete.- Rows nested more than 64 levels deep and rows too large to write are invalid, counted by reason.
- If nothing is comparable after 50,000 rows or 32 MB, the run stops free, because the rules do not fit the data. If at least 10,000 rows are unreadable and they outnumber readable rows nine to one, it also stops free.
- A rule that finds no value fails a small run free, since that nearly always means a misspelled field. On a larger run where other rules did compare rows, the run finishes and names the rule in
rulesWithoutValues.
Same input, same output
Rows are read in the order given and every tie has a fixed rule, so the same input and settings give the same result. If a run is restarted it reads the input again and checks a digest of it. If the digest matches, it continues after the last row already written. If the input changed in between, the run stops rather than mix two versions.
Limits
| Limit | Default | Highest |
|---|---|---|
| Input rows per run | 1,000,000 | 5,000,000 |
| Input size per run | 1,024 MB | 4,096 MB |
| Size of one row | 1,024 KB | 5,120 KB |
| Datasets, files | 20 each | 20 each |
| Download time per file | 1 hour | 1 hour |
At a row or size limit, or at your maximum charge, reading stops and the run ends as stoppedEarly: the result is correct for the rows read. If the disk fills up, the run fails without a charge; more memory also gives more disk.
Memory. Datasets are read in pages that are sized by bytes: the first page holds 10 items, then each page holds as many items as fit in about 32 MB of JSON (at most 1,000). A single item can be as large as the platform allows (about 9 MB), so a page of very large items is small. Files are read in 64 KB chunks and one row at a time. Not measured on the platform.
Web pages are refused. A file link that answers with a web page (an HTML or XML content type, or a body that starts with <) is refused whatever fileFormat you chose: the run stops with a clear message, nothing is parsed and nothing is charged.
Names shown back. Rule ids, field names, dataset ids, file host names and unknown option names that you typed are shown in the result and in messages with phone numbers, e-mail addresses and digit chains of 8 or more digits replaced by [removed]. Matching still uses what you typed.
Not supported: compressed files, Excel files, password-protected links, automatic fuzzy merging, and matching phonetic or translated names.
CSV exports and formulas
Your values are written unchanged. A value such as =HYPERLINK(...) stays a formula when the dataset's CSV export is opened in a spreadsheet. If your data comes from strangers, sanitise it first, for example with Dataset Export to XLSX, CSV and Parquet.
Which dedupe Actor?
Use Dataset Merge & Deduplicate (dataset-merge-dedup) to combine datasets and drop rows with identical field values, with keep-first or keep-last and resume by position. Use this Actor when you need files as input, normalised URL, e-mail, phone or number rules, an audit trail of why rows matched, or a review list of similar pairs.
Your data
Row values are never written to the log. Phone and e-mail rules store and compare hashes in their working index, and group rows show no hash or value for them. Your rows are in the run's working folder only while it runs, and the result stays in your own run's storage.
Pricing
USD 0.30 per 1,000 compared rows, with a minimum of USD 0.03 per run (100 rows), plus Apify's small start fee. A compared row is one that at least one of your rules could compare, whether it turns out unique or duplicate.
A run is billed for the largest of three figures:
| Figure | Example |
|---|---|
| Compared rows | 5,000 compared rows: USD 1.50 |
| The minimum of 100 rows | 1 compared row: USD 0.03 |
| One row per 256 KB of data read | 1 compared row and 1 GB of data: 4,096 rows, USD 1.23 |
OUTPUT shows billableRows (compared), bytesRead, chargedRows (billed) and chargeBasis (which figure applied).
Free: runs that compared nothing, the sample data, failed runs, and rows that are invalid, empty or not comparable. Their size still counts towards the 256 KB figure when the run compared something, because they had to be read.
The charge is made once, after the whole result is written. If a restart interrupts it, it is not sent again, so you are not billed twice. A run with a maximum charge stops reading before going over it, and a limit below the minimum is refused before anything is read.
Run outcomes
OUTPUT.outcome is complete, stoppedEarly (with stopReason: maxCharge, maxInputRows or maxInputBytes) or failed. A failed run explains why in its status message.