Mouse Tracking

Does anyone know of any mouse tracking APIs out there? i.e. tracking mouse movements of a user session for data collection. If there’s nothing out there, I can come up with something but I don’t want to develop something that’s already around and better implemented.