Airbnb is now suing New York City over a recently passed law that forces the company to reveal hosts’ data, saying this law violates users privacy rights.

New York recently passed new legislation that is designed to target illegal short-term rental activity but is slated to slash Airbnb’s New York booking revenue in half.

Airbnb and its users are on track to generate about $140 million in booking revenue this year from which Airbnb takes about a 15% cut. But once the new law takes effect in January, Airbnb and its New York hosts could lose about $70 million of that revenue.

The law prevents landlords and tenants from illegally renting out apartments for a few days at a time to tourists, a trend that the city says has aggravated the housing crisis by making short-term rentals more profitable than long-term leases.

Airbnb and other home rental services, like HomeAway, would be required to provide the addresses and names of hosts to the city’s Office of Special Enforcement each month, and to specify whether rentals are for a whole apartment or just a room.

But now, Airbnb is fighting back.

“The ordinance is an unlawful end-run around established restraints on governmental action and violates core constitutional rights,” the company said in a claim it filed in a New York court on Friday.

This article by Olivia Zaleski and Gerrit De Vynck for Bloomberg explained people close to Airbnb said the new law is a devastating blow to the company as New York is one of its most popular markets.

But New York City insists the law is critical in its crackdown of illegal short-term rentals.

From the article:

“This law provides the city with the critical data it needs to preserve our housing stock, keep visitors safe and ensure residents feel secure in their homes and neighborhoods,” Christian Klossner, executive director for the mayor’s special enforcement office, wrote in an emailed statement. “The city will defend it.”

And New York isn’t the only city cracking down on short-term rentals. In San Diego, the city council recently voted to outlaw vacation rentals in secondary homes, restricting Airbnb and other short-term rentals to primary residences only.