Using software bots to buy concert tickets will soon be illegal, thanks to a bill passed by Congress yesterday.

The Better Online Ticket Sales (BOTS) Act makes it illegal to bypass any computer security system designed to limit ticket sales to concerts, Broadway musicals, and other public events with a capacity of more than 200 persons. Violations will be treated as "unfair or deceptive acts" and can be prosecuted by the Federal Trade Commission or the states.

Sen. Jerry Moran (R-Kansas), who sponsored the bill, told The Associated Press that he intends to "level the playing field" for people buying tickets.

"The need to end this growing practice is reflected in the bill's widespread support," Moran said.

The bill passed the Senate by unanimous consent last week, and the House of Representatives voted yesterday to pass it as well. It now proceeds to President Barack Obama for his signature.

Computer programs that automatically buy tickets have been a frustration for the concert industry and fans for a few years now. The issue had wide exposure after a 2013 New York Times story on the issue.

Earlier this year, the office of New York Attorney General Eric Schneiderman completed an investigation into bots. The New York AG's ticket sales report (PDF) found that the tens of thousands of tickets snatched up by bots were marked up by an average of 49 percent.

"I want the thousands of tickets for shows, concerts, and sporting events that are now purchased by bots and resold at higher prices to go into the general market so that you have a chance to get them," wrote Lin-Manuel Miranda, creator of the hit musical "Hamilton," in a New York Times op-ed in June. "You shouldn’t have to fight robots just to see something you love."

The Senate took up the matter a few months ago, holding a September hearing at which Jeffrey Seller, the producer of "Hamilton," testified. Seller told legislators that bots quickly buy up tickets, which are then resold on platforms like StubHub and TicketsNow for big markups.

The National Association of Ticket Brokers, a group of about 200 ticket resellers that do not use bots, supported the act.

"People should not be competing with ticket-hoarding software to make a purchase," Gary Adler, Executive Director of NATB, said in an e-mailed statement. "We look forward to Congress continuing its work by addressing other practices that harm consumers and the function of an open secondary resale market for tickets."

NATB emphasized that ticket holds placed by artists, teams, and venues mean that only 46 percent of tickets become available to the public at sale time, "which is the reason events sell out too quickly and lead to frustration over supply and market price."