We demonstrate experimentally that flapping foils within an oncoming stream can efficiently extract energy from the flow, thus offering an attractive, alternative way for energy production. The greatest promise for flapping foils is to use them in unsteady and turbulent flow, where their own unsteady motion can be controlled to maximize energy extraction. The foils in this study perform a sinusoidal linear motion (sway, or heave) in combination with a sinusoidal angular motion (yaw or pitch); the effect of three principal parameters is studied systematically, yaw amplitude, the Strouhal number, and the phase angle between sway and yaw. The foils are made of aluminum, in the shape of NACA 0012 airfoils, using three different aspect ratios, 4.1, 5.9, and 7.9; they were tested at Reynolds numbers around 14,000. Efficiencies of up to 52 ± 3% are achieved with simple sinusoidal motions, thus demonstrating that foils can efficiently extract energy from unsteady flows.