Data · API · MCP · Apify
Clean data
Fixes messy spreadsheets and merges duplicate rows.
Built in
- Merges up to 20 sources into one table first, so it finds duplicates across them; columns match even when the headers differ
- Rows it isn't sure about go to a review list instead of being guessed
- Rules and import templates check every clean record against your columns
- Scheduled runs can return only new or changed rows
- Every run returns a recipe that cleans the next file the same way
Sample
A real call to the live API, stored as it came back on 2026-11-23. Lists are cut to a few items in the JSON view.
Request{"url": "https://patchwell.io/samples/customers_messy.csv"}
352 rows in, 301 clean records out: 45 duplicates merged, 1,429 values fixed, 6 blank rows removed.
| Customer Name | Phone # | State | Signup Date | Total Spend | |
|---|---|---|---|---|---|
| Renée Lee | rene.lee101@example.com | (374) 311-1047 | CO | 2019-05-03 | 1418.84 |
| Noah Wilson | noah.wilson212@example.com | (390) 631-1561 x12 | WA | 2021-01-14 | 2274.0 |
| Linda O'Brien | linda.obrien20@example.com | (692) 695-6109 | CO | 2019-03-04 | 3003.7 |
| Chloe García | chloe.garca3@example.com | (497) 629-3363 | NY | 2023-02-19 | 1247.8 |
| Maria Kowalski | maria.kowalski249@example.com | (856) 216-8243 | NY | 2025-09-11 | 2052.92 |
| Thomas Young | thomas.young234@example.com | (461) 238-6551 | NY | 2020-03-13 | 352.95 |
| James Smith | james.smith216@example.com | (291) 423-2988 | TX | 2020-08-01 | 1116.3 |
| Ava Clark | ava.clark189@example.com | (602) 673-4473 | FL | 2020-03-25 | 294.2 |
- invalid row 136: E-mail: 'not-an-email' is not a valid email; Phone #: '123' is not a valid phone; State: 'Narnia' is not a valid us_state
| Row | Column | Before | After | Rule |
|---|---|---|---|---|
| 2 | rene.lee101@example.com | rene.lee101@example.com | trim + lowercase | |
| 2 | Phone # | 13743111047 | (374) 311-1047 | valid number, national format |
| 2 | Signup Date | 05/03/19 | 2019-05-03 | ISO date YYYY-MM-DD (MDY) |
| 2 | Total Spend | 1,419 USD | 1419.0 | number, 2 decimals |
| 3 | Phone # | 390 631 1561 ext. 12 | (390) 631-1561 x12 | valid number, national format |
| 3 | State | Washington | WA | 2-letter code |
| 3 | Total Spend | 2,274 USD | 2274.0 | number, 2 decimals |
| 4 | Customer Name | O'Brien, Linda | Linda O'Brien | trim, fix encoding, Last, First -> First Last, case |
| 4 | Phone # | 692-695-6109 | (692) 695-6109 | valid number, national format |
| 4 | State | COLORADO | CO | 2-letter code |
| 4 | Signup Date | 3/4/2019 | 2019-03-04 | ISO date YYYY-MM-DD (MDY) |
| 4 | Total Spend | 3003.7 | 3003.7 | number, 2 decimals |
{
"rows": [
{
"Customer Name": "Renée Lee",
"E-mail": "rene.lee101@example.com",
"Phone #": "(374) 311-1047",
"State": "CO",
"Signup Date": "2019-05-03",
"Total Spend": 1418.84,
"_source_rows": [
2,
21
],
"_flags": [],
"_notes": [
"E-mail: a reserved or placeholder domain; mail to it can't arrive",
"Phone #: not a real phone number in its numbering plan (e.g. a 555 or unassigned area code)"
]
},
{
"Customer Name": "Noah Wilson",
"E-mail": "noah.wilson212@example.com",
"Phone #": "(390) 631-1561 x12",
"State": "WA",
"Signup Date": "2021-01-14",
"Total Spend": 2274.0,
"_source_rows": [
3
],
"_flags": [],
"_notes": [
"E-mail: a reserved or placeholder domain; mail to it can't arrive",
"Phone #: not a real phone number in its numbering plan (e.g. a 555 or unassigned area code)"
]
},
{
"Customer Name": "Linda O'Brien",
"E-mail": "linda.obrien20@example.com",
"Phone #": "(692) 695-6109",
"State": "CO",
"Signup Date": "2019-03-04",
"Total Spend": 3003.7,
"_source_rows": [
4
],
"_flags": [],
"_notes": [
"E-mail: a reserved or placeholder domain; mail to it can't arrive",
"Phone #: not a real phone number in its numbering plan (e.g. a 555 or unassigned area code)"
]
},
"... 298 more"
],
"review": [
{
"type": "invalid",
"rows": [
136
],
"record": {
"Customer Name": "Test User",
"E-mail": null,
"Phone #": null,
"State": null,
"Signup Date": "2099-01-01",
"Total Spend": -50.0,
"_source_rows": [
136
],
"_flags": [
"E-mail: 'not-an-email' is not a valid email",
"Phone #: '123' is not a valid phone",
"State: 'Narnia' is not a valid us_state"
]
},
"reason": "E-mail: 'not-an-email' is not a valid email; Phone #: '123' is not a valid phone; State: 'Narnia' is not a valid us_state",
"kept": true
}
],
"changes": [
{
"row": 2,
"column": "E-mail",
"before": " rene.lee101@example.com ",
"after": "rene.lee101@example.com",
"rule": "trim + lowercase"
},
{
"row": 2,
"column": "Phone #",
"before": "13743111047",
"after": "(374) 311-1047",
"rule": "valid number, national format"
},
{
"row": 2,
"column": "Signup Date",
"before": "05/03/19",
"after": "2019-05-03",
"rule": "ISO date YYYY-MM-DD (MDY)"
},
"... 1426 more"
],
"columns": {
"Customer Name": {
"kind": "name",
"match": 1.0,
"source": "detected"
},
"E-mail": {
"kind": "email",
"match": 0.997,
"source": "detected",
"fix_typos": true,
"domain_check": {
"checked": 1,
"no_domain": 0,
"no_mail": 0,
"unknown": 0
}
},
"Phone #": {
"kind": "phone",
"match": 0.997,
"phone_region": "US",
"source": "detected",
"phone_format": "national"
},
"State": {
"kind": "us_state",
"match": 0.997,
"source": "detected"
},
"Signup Date": {
"kind": "date",
"match": 1.0,
"source": "detected",
"date_order": "MDY",
"date_order_evidence": "87 values only valid month-first vs 0 day-first"
},
"Total Spend": {
"kind": "money",
"match": 1.0,
"source": "detected",
"decimal": ".",
"decimal_evidence": "187 values only valid with a decimal point vs 0 with a decimal comma",
"currency": "USD"
}
},
"dedupe_key": [
"E-mail"
],
"clusters": [],
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"Customer Name": {
"type": "string",
"x-kind": "name"
},
"E-mail": {
"type": "string",
"format": "email",
"x-kind": "email"
},
"Phone #": {
"type": "string",
"x-kind": "phone"
},
"State": {
"type": "string",
"pattern": "^[A-Z]{2}$",
"x-kind": "us_state"
},
"Signup Date": {
"type": "string",
"format": "date",
"x-kind": "date"
},
"Total Spend": {
"type": "number",
"x-kind": "money"
}
},
"required": []
},
"recipe": {
"version": 2,
"columns": {
"Customer Name": {
"kind": "name"
},
"E-mail": {
"kind": "email",
"fix_typos": true
},
"Phone #": {
"kind": "phone",
"phone_region": "US",
"phone_format": "national"
},
"State": {
"kind": "us_state"
},
"Signup Date": {
"kind": "date",
"date_order": "MDY"
},
"Total Spend": {
"kind": "money",
"decimal": "."
}
},
"dedupe_on": [
"E-mail"
],
"dedupe_mode": "auto",
"required": []
},
"quality": {
"columns": {
"Customer Name": {
"filled": 346,
"fixed": 260,
"invalid": 0,
"already_clean": 86
},
"E-mail": {
"filled": 346,
"fixed": 90,
"invalid": 1,
"already_clean": 255
},
"Phone #": {
"filled": 330,
"fixed": 281,
"invalid": 1,
"already_clean": 48
},
"State": {
"filled": 346,
"fixed": 246,
"invalid": 1,
"already_clean": 99
},
"Signup Date": {
"filled": 336,
"fixed": 276,
"invalid": 0,
"already_clean": 60
},
"Total Spend": {
"filled": 334,
"fixed": 266,
"invalid": 0,
"already_clean": 68
}
},
"before": 0.3023,
"after": 0.9985,
"note": "share of filled cells in a clean, consistent form, before and after cleaning"
},
"stats": {
"input_rows": 352,
"blank_removed": 6,
"review_only": 0,
"clean_records": 301,
"duplicates_merged": 45,
"values_changed": 1429,
"duplicate_conflicts": 0,
"possible_duplicates": 0,
"shared_email_groups": 0,
"flagged_records": 1,
"records_with_notes": 300
},
"ingest": {
"format": "csv",
"encoding": "utf-8",
"dialect": {
"delimiter": ",",
"quotechar": "\"",
"detected_by": "clevercsv"
},
"header_row": 1
},
"compute_s": 2.64,
"billing": {
"price": 0.01,
"units": 0.352,
"compute_s": 8.8
},
"status": "done",
"schema_version": "1.6"
}What you get back
- Clean rows
- Review list (invalid values, conflicts, likely duplicates with a confidence, shared emails kept apart, totals rows)
- Per-value change log
- Detected columns with evidence
- Value clusters
- Data quality before and after
- JSON Schema
- A replayable recipe
Call it
Send url of a CSV / XLSX / JSON file.
curl https://patchwell.io/v1/clean_data \
-H "Authorization: Bearer $PATCHWELL_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://patchwell.io/samples/customers_messy.csv"}'import os, httpx
r = httpx.post("https://patchwell.io/v1/clean_data",
headers={"Authorization": f"Bearer {os.environ['PATCHWELL_KEY']}"},
json={"url": "https://patchwell.io/samples/customers_messy.csv"}, timeout=300)
print(r.json()){
"mcpServers": {
"patchwell": {
"type": "http",
"url": "https://patchwell.io/mcp/",
"headers": { "Authorization": "Bearer YOUR_KEY" }
}
}
}Measured quality
- Finds 88% of duplicate people in files it never saw (239 real duplicate pairs); 97% of the pairs it flags are real duplicates, with 0 wrong merges on these files.
- Finds 84% of duplicate companies in files it never saw (282 real duplicate pairs); 97% of the pairs it flags are real duplicates, with 0 wrong merges on these files.
Re-measured on every deploy (it's free to run). Measured 2026-11-22.