Hard to say without an exact starting point, but we’ll assume MSP due to your location field. You can generally save the most money by flying on Tuesdays, Thursdays, and Saturdays.
In my experience, the big travel sites are about the same in terms of fares, and often the airline is just as good, if not better, in price. Also, if you have a frequent flier membership, airlines will often give you a bonus for booking online directly through their website.
Now, some prices, assuming you leave on the 28th and return on the 31st to save as much as possible:
Southwest flies out of MSP by codesharing with ATA. Southwest also flies to Oakland and San Jose, and ATA flies into San Francisco. The problem with Southwest is that you can’t fly from MSP to San Francisco without having to schedule a same-day depature from another city from which you can get to one of those cities (MSP to SLO to SAJ for example.) The problem with this is that you’d probably have to leave the secured area, get your luggage, recheck in, reclear security, and get your next flight. However, if you were willing to do all that, you could fly on the 28th (Saturday) for about 200 bucks plus taxes. The 27th (Friday) is better than 300 bucks plus taxes. Then, of course, you’d have to do the entire thing in reverse for about the same amount of money, so Southwest is probably not a good choice in your case.
However, ATA (which I’ve never flown on) would work and be fairly cheap. Say $167 plus taxes and fees for Saturday, and $197 plus taxes and fees for the return on Tuesday. According to ATA, it’ll be just about 400 bucks.
The flights I picked for American are 450 bucks, but you might be able to find a lower fare if you sort by fare instead of time. Plus, the lowest fare of 350 bucks requires you leaving SFO at 12:30 AM. So if you don’t mind going on the red-eye and getting to the airport about 11 PM Monday night, that would work.
Travelocity is giving me MSP to SFO for 213 bucks on something called Sun Country Airlines. That is if you don’t mind traveling on what must be a really low-cap airline and leaving SFO at 11:35 PM Monday night.
Basically, just keep looking around. If you don’t want to fly Saturday and Tuesday, prices will go up.