Andre, who was making his first start during his second spell at the club after his January move from the Hammers, soon combined with brother Jordan, only for his touch to let the former down at the vital moment inside the visitors' box.
Andre and Jordan combo helps Swansea to solid victory
The visitors started with the kind of lethargy you would expect after a lengthy coach journey to Wales, which came in stark contrast to an energetic Swans side who hassled and harangued their opponents from the off.
The Swans soon took the lead after eight minutes, when the returning Ayew fed Ki on the edge of the area, leaving the South Korean to drive an adroit finish past Adrian from distance.
The Hammers were punished again in the 32nd minute, this time as Rice fell asleep at the back post, allowing van der Hoorn to steal in and score only his second career goal to put the Swans two ahead at the break.
Swansea made it 3-0 after a corner was initially met by Ayew, before the ensuing rebound fell kindly to King, who prodded home from close range to register on his first start for the club.
A shambolic afternoon was to get worse for the Hammers too, when Ayew returned to haunt his former club by winning a cheap penalty off Cheikhou Kouyate after the hour mark, allowing his brother Jordan to step up and convert the spot kick beyond Adrian to make it 4-0.
West Ham were able to leave Wales with a slither of respectability, however, as substitute Michail Antonio profited from Aaron Cresswell's free kick in order to earn a late consolation for the visitors with a simple finish from close range.