how to find the data_path for scripted keyframes
To get the data_path of a UI element (property, icon..), rightclick it and select "Copy Data Path"



Wrapping the resulting data_path with double quotes is a legal python string representation (eg: "modifiers['Bevel'].width"), and arguably should be allowed. But the parser of properties favours 'modifiers["Bevel"].width', presumably to keep the string parsing to a  minimal implementation.



The above will be able to compute most kinds of data_path, but if it fails you can   


make a keyframe for the property
go to the Outliner (set to view Datablocks)
navigate to Actions -> (Object/Scenename)+Action -> F-Curve
See Data Path. (this is what the initial 


  path to the property to key, analogous to the fcurve's data path


refers to.)