Ki Sung-yueng’s shot from 20 yards put them ahead in the eighth minute.
West Ham's Winston Reid went off with a nasty injury and it soon got worse for the visitors.
Mike van der Hoorn headed in Ki’s corner at the far post in the 32nd minute.
Three minutes after the break Andy King scored his first goal since joining on loan from Leicester City at another corner.
Jordan Ayew’s penalty made it 4-0 after Cheikhou Kouyate had fouled Andre Ayew, while Michail Antonio got a late consolation for the Hammers.
The win lifts Swansea to 13th, with 30 points, above West Ham and Huddersfield Town on goal difference.
Swansea: 10 Mar v Huddersfield Town (A)
West Ham: 10 Mar v Burnley (H)