Hundreds of city street vendors who sued the Bloomberg administration for its improper overticketing will be getting a lot of dough back.

After a lengthy court battle, red-faced city officials have agreed to repay a total of nearly $230,000 to the vendors, who were overcharged for summonses going back as far as 2006, The Post has learned.

The vendors will get an average of $500 apiece.

The city blamed the mistake on “a computer error.”

The several hundred wronged cart operators, who sell everything from pretzels to cellphone cases, have already begun to be reimbursed. In at least 569 cases, they were socked with and paid fines far in excess of the legal amounts set by city law, resulting in a payback of $228,000.

Faruque Ahmed, a Bronx vendor who sells chicken and rice outside Montefiore Medical Center, was penalized $1,000 for setting up too close to a bus stop in 2006.

The penalty should have been $250, so the city has agreed to repay $877.48 — the difference plus interest.

His family needs the money: His wife, Monawara Sultana, is out of work because of a serious illness, and the couple has three children.

“Eight hundred dollars is a lot of money for [us],” she said. “They give us tickets for everything. Some days, they give us like two, three tickets.”

Peanut peddler Mohammad Ali, who works in Midtown, was charged $1,000 in March 2010 for what should have been a $100 ticket for setting up his cart too close to a crosswalk .

Ali, who supports his wife, mother and two young children, is getting a $971 refund.

Sean Basinski of the Street Vendor Project, which represented the vendors in their lawsuit, said the evidence of inflated violations should push City Council Speaker Christine Quinn to pass a bill that would lower the maximum fines for vendors to $250, from $1,000.

“Nothing will change until we stop treating small-business owners as if they were criminals,’’ Basinski said.

“We hope this settlement will spur Speaker Quinn to call a vote to lower the fines.”

Quinn, who has let the legislation languish for two years, said through a spokesman she is negotiating with the administration and stakeholders.