Tantei Monogatari (Detective Story) "is an action Japanese TV series ... which was originally broadcast on Nippon TV in 27 forty-five-minute episodes from September 18, 1979 to April 1, 1980." [1]
Matsuda Yusaku (松田 優作) stars as Kudou Shunsaku (工藤 俊作), who "sets up office in a rundown building as a private detective after spending five years as a cop in San Francisco where he became familiar with firearms." [1]
A scene of Kudou spitting out coffee in the opening credits is frequently parodied. See the scene here.