While the series was fictionalized, it was inspired by the real-life experiences of Bud Ruskin, who worked as an undercover agent for the Los Angeles Police Department in the 1950s. He infiltrated youth gangs and used his knowledge of their culture to help solve crimes.
It's worth noting that the series, which premiered in 1968, took eight years to come to fruition after Ruskin's original 1960 pilot.