American Airlines has some low fares from San Francisco to Liberia LIR Costa Rica in the low $300s round trip. These fares are available from next week into June 2016. Liberia is the primary airport for Pacific beach resorts in Costa Rica.
Most of January has low fare dates. January is considered one of the best weather months of the year to visit Costa Rica when it is dry season in the Liberia area.
American Airlines $322.42 SFO-Liberia LIR Costa Rica
Wednesday Jan 13 San Francisco SFO – Dallas DFW – Liberia LIR Costa Rica
Wednesday Jan 20 Liberia LIR – Miami MIA (22 hour overnight layover) – San Francisco SFO
Of course, you have plenty of options to avoid an overnight in Miami, however, many of these American Airlines low fare itineraries force an overnight in DFW.