At a glance
What the Merge CSV Files & Datasets does
- Sources
- Apify datasets, CSV, TSV, JSON, JSON Lines, Excel links, Google Sheets links, pasted rows
- Dedupe
- By any fields or nested paths, or whole rows; keep first or last
- Matching
- URLs (scheme, www., trailing slash, utm/gclid/fbclid), emails, numbers, case and spaces
- Size
- About 5 million unique rows per run in the default 1 GB (2 million with keep last)
- Output
- Merged dataset plus a STATS record; JSON, CSV, Excel, API
- Automate
- Only-new mode, integrations after any scraper, schedules, MCP
Who it is for
- Combining the results of several scraper runs into one lead list without repeats
- Passing on only new rows from a daily scraper to Google Sheets, a CRM or Slack
- Cleaning a CSV or Excel export: one row per website, email or phone
- Joining files from different tools that spell the same URL or email differently
Output
What you get
- One output row per unique row, with all its fields (or only the 'Output fields' you list, nested values as their own columns)
- _source on each row: dataset:<ID>, file:<link> or rows
- STATS record: rowsRead, rowsWritten, duplicatesRemoved, rowsWithEmptyDedupeFields, seenInEarlierRuns, unreadableRows, dedupeFields and per-source read/written/duplicates/error
- A status message with the same counts and every source that could not be read and why
Example
Input and output
Input
{
"fileUrls": [
"https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/merge-sample-a.csv",
"https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/merge-sample-b.json"
],
"dedupeFields": [
"website"
]
}One output record
{
"name": "Northwind Coffee Roasters",
"website": "https://www.northwindcoffeeroasters.example/",
"city": "Toronto",
"category": "cafe",
"rating": "4.0",
"_source": "file:https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/merge-sample-a.csv"
}From a real run of this tool; long text and lists shortened here.
How to use it
Three steps
- Pick the datasets to merge in 'Datasets', or add CSV, JSON or Excel links in 'File links', or paste rows.
- List the fields that make a row unique in 'Dedupe by fields', e.g. website, or leave it empty to compare whole rows.
- Click Start. Download the merged rows as JSON, CSV or Excel, and open the STATS record for the counts.
API
Call it from Python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("aurelix/dataset-merge-dedup").call(run_input={'fileUrls': ['https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/merge-sample-a.csv',
'https://api.apify.com/v2/key-value-stores/twkCCtTWzsi8fVbx5/records/merge-sample-b.json'],
'dedupeFields': ['website']})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)pip install apify-client. The same input works from the Apify console, a schedule, Make, n8n, Zapier or an AI agent through the Apify MCP server.
Pricing
Pay per result
| Per 1,000 rows, free plan | $0.02 |
| Per 1,000 rows, paid plans | $0.02 |
| Rows read 1000, per 1,000, free plan | $1.50 |
| Data read mb, per 1,000, free plan | $0.05 |
| Start fee per run | $0.02 |
Live prices from the Apify Store; no subscription and no platform usage billed on top. See the Store page.
Honest limits
What it does not do
- No JavaScript transform functions; use 'Output fields' to choose and flatten columns.
- About 5 million unique rows per run at the default 1 GB (2 million with 'Last'); the run stops cleanly at that point and says so.
- Excel files up to 30 MB with up to 40 MB of text in the shared-string table (streamed); CSV, JSON Lines and JSON lists up to 200 MB (streamed); other JSON shapes up to 20 MB.
- Google Sheets links work only for sheets shared 'anyone with the link'.
- Only-new memory keeps the newest 5 million keys (8 bytes each), saved after every batch of written rows.
- No phone-number matching: write phones the same way (or dedupe by another field).
- 'Which duplicate to keep: Last' reads every source twice and bills reading twice.
- File links must download at 2.5 MB/s or faster (after the first 10 s); a slower host is stopped and named in the status.
FAQ
Questions buyers ask
Does it work with limited-permission runs?
Yes. This Actor reads datasets given through Apify's dataset picker, which limited-permission Actors need, and names a source it cannot read in the status instead of failing.
Can I send the merged rows to Google Sheets, n8n or an AI agent?
Yes. Use Apify's Google Sheets integration on the run, the n8n Apify node, or call it from an AI agent through Apify's MCP server; pass rows directly in 'Rows' from an agent.
How much does the Merge CSV Files & Datasets cost?
$0.02 per 1,000 rows ($0.02 on paid Apify plans), billed through your Apify account; you pay only for results. Apify's free plan includes $5 of credit a month, enough for about 249,999 rows.
How are duplicates found?
Each row's values in 'Dedupe by fields' are normalised and compared. Always: spaces trimmed and, with 'Ignore upper/lower case' on, case ignored. With Smart matching on, also: URLs match with or without http(s)://, www., the host's case, one trailing slash and utm_*, gclid and fbclid tags (other parameters, the path's case and #fragments still count); emails match in any case; 5 and 5.0 are one number. Signs, decimals, exponents and leading zeros are kept, so -12 and 12, 1.5 and 15 or 02111 and 2111 stay different. Phone numbers, dates and IDs must be written the same way to match. With no fields listed, whole rows are compared, ignoring timestamp fields such as scraped_at.
What does a run cost in total?
Rows written cost $0.02 per 1,000. Reading costs $0.0015 per 1,000 rows plus $0.00005 per MB of row data, plus a $0.005 start fee per run.
What happens to rows without the dedupe fields?
By default they are kept and never merged with rows that have a value. With 'Only rows new since the last run' on, such a row is remembered by its whole content, so it is not sent (or charged) again. Choose 'Drop them' to remove them. The STATS record counts them either way. Empty rows (null or {}) are skipped and counted.
Why does it say it may not read my dataset?
Apify lets this Actor read only the datasets you give it in the 'Datasets' field. Pick the dataset there (or paste its ID there, not in 'File links'), and Apify grants read access for that run.
Can it merge datasets from another Apify account?
Only if the dataset is readable by anyone with its link; put that link in 'File links'. Datasets of your own account go in 'Datasets'.
How big can the input be?
Sources are read 1,000 rows at a time and only an 8-byte fingerprint of each unique key is kept, so about 5 million unique rows per run fit in the default 1 GB (about 2 million with 'Which duplicate to keep: Last'), with at least 20% of the memory left free. At the limit the run stops cleanly, keeps what it wrote and says so; give the run more memory to go higher. Files up to 200 MB each; Excel up to 30 MB with up to 40 MB of text in its shared-string table (about 400,000 rows of short text).
Is it legal to merge and dedupe datasets?
It reads only public data any logged-out visitor can see: public file links, plus the datasets, files and rows you give it, and it changes nothing at the source. You are responsible for the data you load and how you use it. This is not legal advice; check the rules that apply to your use.
Guides
Tutorials using this tool
Related
Related tools
Tennis Betting Odds Scraper
Tennis results and upcoming matches with opening and closing odds per bookmaker and implied probabilities.
Agoda API
Scrape Agoda guest reviews at $0.50 per 1,000 with this unofficial Agoda API, cheaper than the leading tools: Agoda and...
Bulk Website Screenshot Tool
Full-page screenshots or PDFs of a list of URLs, cookie banners hidden, lazy images loaded, a public link per image.
Try the Merge CSV Files & Datasets
Open it on the Apify Store, paste the example input above and click Start. Results download as CSV, Excel or JSON.