When we think of ketchup we probably think of Heinz but it actually began in English kitchens as anchovy sauce, and borrowed the Indonesian word for fish sauce, kecap. Variations were created using mushrooms, walnuts, lemons, and eventually tomatoes (referred to widely in prior centuries as "love apples")
The tomato ketchup that we know was first made by a New Jersey resident sometime before 1782.
The first published recipe for tomato ketchup appeared in 1812, written by a prominent Philadelphia physician and horticulturist, James Mease:
LOVE APPLE CATSUP:
Slice the apples [tomatoes] thin, and over every layer sprinkle a little salt; cover them, and let them lie twenty-four hours; then beat them well, and simmer them half an hour in a bell-metal kettle; add mace and allspice. When cold, add two cloves of raw shallots cut small, and half a gill of brandy to each bottle, which must be corked tight, and kept in a cool place. -- James Mease, Archives of Useful Knowledge, Philadelphia, 1812