Skip to content

Csv Diff API

POST https://api.findutils.com/api/tools/csv-diff/execute

Compare two CSV or TSV tables by key column and list the rows that were added, removed or changed - a table diff, not a line diff, so rows in a different order are not changes. keys names one or more columns (a composite key, e.g. email + country); when omitted the tool picks a shared column named id, else a unique *_id column (customer_id), else one named email, sku, uuid, key or code, else the first shared column whose values are unique in both files, else it falls back to whole-row comparison and says so in notes. A row is changed when a non-key column present in both files differs (cells compared exactly; trim and ignore_case apply to key matching only). Duplicate keys within a file keep the first row and are reported in duplicate_keys. A quote that opens and never closes stops the comparison with UNCLOSED_QUOTE naming the file and line. mode "row" compares whole rows as a multiset, with no changed class. Returns counts, the rows (capped at max_rows), and diff_csv: comma-separated, header change_type, then every column of A followed by the new columns of B, then old_<column> for each column that changed anywhere; removed rows hold A's values, added and changed rows B's, and old_<column> holds A's value on changed rows. diff_csv lists every added, removed and changed row; unchanged rows are left out. Nothing is uploaded when used on the browser page.

Request body

application/json
  • a

    string required

    The old table (file A), CSV or TSV with a header row. a and b together up to about 10 MB.

  • b

    string required

    The new table (file B), CSV or TSV with a header row. a and b together up to about 10 MB.

  • keys

    array optional

    Key column names present in both files. Omit to let the tool suggest one.

  • mode

    string optional

    key (default): match rows by key columns. row: match whole rows, counting repeats. One of key · row. Default "key".

  • trim

    boolean optional

    Ignore spaces around key values when matching. Default true. Default true.

  • ignore_case

    boolean optional

    Match key values without regard to letter case. Default false. Default false.

  • delimiter

    string optional

    Field separator for both files. Default auto: detected per file from its first line. One of auto · , · · ; · |. Default "auto".

  • header

    boolean optional

    The first row of each file is a header. Default true. When false, columns are named column_1..N. Default true.

  • max_rows

    integer optional

    Most entries returned in rows. Default 5000. Counts and diff_csv are never cut. Default 5000.

Example arguments

Verified
{
  "a": "id,name,price\n1,Apple,1.00\n2,Banana,0.50",
  "b": "id,name,price\n1,Apple,1.20\n3,Cherry,3.00"
}