MAF sensor, throttle positioning sensor or fuel pump. One of these three maybe be going bad.
A fuel pump can bind up when it's on it's way out and temporarily drop the fuel pressure. When the key is switched on, can you hear the pump cycle up? Does it sound higher pitched than normal? Or lower pitched? If this is it, change the filter along with it. A clogged filter often is the reason why a pump fails. Not bad on price, but can be expensive if you pawn out the work to a shop.
A throttle positioning sensor tells the computer in voltage where the throttle is positioned, so it can adjust fuel/air mixture, timing, etc for power and economy. If the sensor stops communicating, the engine will surge and really not want to go anywhere at all. This could be accompanied by transmission shift problems, as the transmission kick down sensor is attached to the TPS. Easy fix. Probably the least expensive potential problem.
Mas Airflow Sensor is another one. It sends voltage through a wire (like a heating element) that goes in the center of the sensor, and the computer can tell how much air volume enters the engine by how fast the wire is cooled down. If it stops working, the computer cannot tell how much air is getting into the engine, and can't regulate the amount of fuel to feed the engine. Poor fuel mileage, horrible idle and sometimes the surges you experienced can happen. Expensive part, but easy to install. It's located between the throttle plenum and air cleaner box.
Without engine codes, or actually being there, these are just stabs. An auto parts place can scan the computer for engine trouble codes.