American Airlines has low fares August at $534 round trip San Francisco to Barcelona. This price is offered beginning mid-April into May and late September into October. United Airlines tickets with Star Alliance partner airlines like Air Canada and Swiss are also priced from $530s to $570s for August travel.
I needed to play around with Google Flights dates to find dates actually pricing at fares shown on AA website. Many were $100 more and some many hundreds of dollars more. But testing several dates located some low fares in August directly bookable on aa.com. United fares were easier to locate.
American Airlines San Francisco SFO – Philadelphia PHL – Barcelona BCN – Chicago ORD – San Francisco SFO
Momondo.com search for same dates shows TravelMerry.com ticket
British Airways codeshare flights
SFO – Dublin – London LGW – Barcelona BCN – Chicago ORD – SFO
$456.46 round trip Thu Aug 17 – Fri Aug 25
SFO – Montreal YUL (Air Canada) – Barcelona BCN – Washington Dulles IAD (United) – SFO
Thu Aug 17 – Fri Aug 25