The new ordinance, approved unanimously by the city council, comes just weeks after a disgruntled Transportation Valley Authority employee shot and killed 10 people – including himself – at a railyard in the city.
The law takes aim at "straw purchasing," an illegal practice in which someone buys a gun for another person who may be legally prohibited from owning firearms – such as a felon or a minor, the Mercury News reported.
Though many gun retailers in the city have some sort of surveillance system in place, the new law goes a step further by requiring them to capture audio and retain videos for at least 30 days.
City Attorney Nora Frimann said those new requirements will give law enforcement the opportunity to collect evidence they might need to solve some gun crimes.
The law is part of a 10-point gun control plan Mayor Sam Liccardo unveiled earlier in June in response to the mass shooting.
"We know a significant number of crooks and gangs get firearms through straw purchasing," Mayor Sam Liccardo said at Tuesday night’s council meeting. "This set of ordinances is really focused on narrowing the flow of guns to those which are clearly legal and hopefully doing something to deter the flow of guns that are unlawful to own."
The mayor’s plan also calls for a separate ordinance that would require gun owners to carry liability insurance and pay a fee to cover taxpayer costs associated with firearm violence.
The mayor’s "Gun-Violence: A Harm-Reduction Strategy," claims that California taxpayers "shouldered the burden of more than $1.4 billion for gunshot-related medical treatment, police response, ambulance transport, and the like."
The council is expected to consider that proposal this fall.
San Jose joins Chicago and several smaller California cities in requiring gun sales to be videotaped, according to the Giffords Law Center. Walmart, the nation’s largest gun seller, started the practice voluntarily in 2008.
San Jose’s new ordinance was not without its critics, however. Gun rights advocates, like the Sacramento-based Firearms Policy Coalition, criticized the new ordinance, calling it unconstitutional.
"It is outrageous that Mayor Liccardo wants to use ‘Big Brother’-style omniveillance to record gun owners’ every move, violating the privacy of millions, especially at-risk firearm purchasers," the coalition wrote in a statement.
The Associated Press contributed to this report.