A bed placed by City Hall in Barcelona’s Plaza de la Catedral. CARLES RIBAS / EL PAÍS

The campaign aims to warn visitors of the risks of renting unlicensed accommodation through sites such as Airbnb and HomeAway. A website, www.fairtourism.barcelona, provides information for tourists about vacation rentals and that can also be used to report unlicensed apartments.

The rise of short-term vacation rentals available through online operators has changed Spain’s tourism landscape. Between 2012 and 2016, supply skyrocketed by 1,633% in 22 cities that together represent 84.5% of all city tourism in the country.

Residents of Barcelona see tourism as the city’s main problem, even though 83% recognize that it provides benefits

Around 40% of Barcelona’s 16,000 holiday apartments are rented out illegally by sites such as Airbnb, according to figures from the city’s town hall.

Residents of Barcelona see tourism as the city’s main problem, even though 83% recognize that it provides benefits. Barcelona cannot turn its back on a sector that provides 20% of its GDP. But it needs to manage it well, as does Madrid and other Spanish cities.

Last year, Barcelona City Hall decided to tackle the problem by introducing a €1.3 million raft of measures to crack down on owners letting out apartments using sites like Airbnb without a license. The authorities set up a website and called on residents to report apartments being rented out illegally.

Airbnb has defended itself by saying European legislation does not require accommodation sites to systematically monitor for illegal activity on the part of owners. The responsibility for that falls instead to local authorities.

On Monday, Barcelona City Hall told Airbnb to withdraw, before the end of July, the more than 1,000 apartments on its website whose owners do not have permission to rent them out.

City Hall official Janet Sanz met with Airbnb representatives, saying afterwards that she had told they could not accept apartments on the platform’s website that do not include the license number issued by City Hall.

Sanz pointed out that City Hall has imposed two fines, of €30,000 and €600,000, on Airbnb. “We are considering another of €600,000, depending on how the situation develops,” she said.

An Airbnb representative said that the company had “withdrawn 1,300 advertisements” in recent months and that it would consider City Hall’s proposals and reply next week.