Most of the markets were constructed in the late 19th and early 20th centuries, reflecting the architectural styles of the day — or even pioneering them. The airy Born Market — designed by the Catalan architect Josep Fontserè, and erected in the 1870s — was Barcelona’s first cast-iron and glass building. The structure, which resembles a fanciful greenhouse the size of a cathedral, today encloses not food stalls but an archaeological site and visitors’ center — under the market, ruins were uncovered of structures predating the Spanish conquest of the city in 1714 — but it’s worth checking out if only to admire the building.

Later markets were smaller, but no less impressive, breaking out in the curves and naturalistic motifs of Modernista architecture. The Galvany Market, in upscale Sant Gervasi, is perhaps the prettiest of the elaborately decorated brick food halls of the early 20th century. Exterior tilework depicts urns erupting with ripe fruit.

By the 1980s, many markets were languishing. The buildings were in disrepair, and vendors were locked in competition with supermarkets.

“It was war,” said Raimond Blasi, president of the Barcelona Municipal Institute of Markets, established to revive the food halls, which employ about 7,500 people and represent 10 percent of the city’s commerce.