We present an optical method (optical current meter) to measure the longshore component of nearshore surface currents by measuring the alongshore drift of persistent sea foam in the surf zone. The method uses short time series of video data collected from an alongshore array of pixels. These space-time data are first Fourier transformed to a frequency-wave number spectrum and, finally, to a velocity spectrum. A model of the velocity spectrum is fit to the observed spectrum to estimate the foam drift velocity. Confidence intervals and other measures of the input and output data quality are calculated. Field test comparisons were made against an in situ bidirectional electromagnetic current meter on the basis of 1 month of video data from the 1997 Sandy Duck field experiment. The root mean square error between the two approaches was 0.10 m/s. Linear regression analysis showed the gain between the two instruments to not be statistically different from one. Differences between the surface and interior measurements were compared to forcing mechanisms that may cause surface velocity shear. Velocity offsets and alongshore wind stress were well correlated for cases when waves and wind were not aligned to within ±45°, when wind- and wave-forced currents are reasonably separable. Calculated wind-dependent surface current shear, modeled as a surface boundary layer, correlated well with the observed velocity offsets for observations of nonalignment between wind and waves. This technique can be applied to study large-scale coastal behavior.