calculate_typing_score
Calculate typing score
Use this when a typing test has finished, or when the user gives the target passage, what they typed, and the time taken and wants their typing speed. Compares word by word and computes exact WPM = (correct characters / 5) / minutes, raw WPM (all typed characters), accuracy = correct / (correct + errors), errors (incorrect + extra + skipped letters), consistency and per-second speed (when samples are given), and the weakest keys. Returns a shareable result card (SVG) and a challenge link. Does not run a test or time anything itself; seconds must be between 1 and 3600. Do not use for reading speed or word counts.
modeseedsamplessecondsrequireddifficultyfocus_keystyped_textrequiredcustom_textmissed_keystarget_textrequiredduration_seconds