To avoid crowds, go to Barcelona in the winter (outside of the Christmas holiday period). It won't be warm enough to visit the beach, but the weather is mild compared to other European cities.