I believe it's the landlord's responsibility to provide the detector. However, the tenant usually has some responsibility in ensuring it is functioning. Not sure what the current NYS/NYC rules are.
I'm pretty certain, the rules/laws/regulations on this, very from city to county to state across the fruited plains.
In SoCal, one town might have a city inspection (including mainly safety concerns) upon change of ownership. But no further inspections until the next change of ownership.
Newport Beach, for example. the major concern in this wealthy area, is "bootlegs" rentals which generate money for owner, but create parking issues for neighbors, and unruly short term renters.
There are state laws about smoke and CO2 alarm devices, but no official inspections. Sellers and buyers agree on a contract that they were disclosed relevant information. A buyer might stipulate that all safety items get installed as conditions of closing the sale.
I am not aware of jurisdictions which have any records along those lines. However they are fully up to speed for collecting any taxes.