How do I programmatically query the state of the timeline "record" button?
If you place the mouse cursor above the record button, you will see:

bpy.data.scenes["Scene"].tool_settings.use_keyframe_insert_auto