How can I get the value of an object property at a specific frame?

So I have an object called “Cube.” I can get, say, its x location like this:

bpy.data.objects["Cube"].location.x

Great! But this is an animated object, and its x location changes over time. The above expression gives me the x location for the currently selected frame. How can I get the x location (or, for that matter, any arbitrary property) at a given time or frame number?

You have to use the fcurve.evaluate(frame) function.

There’s probably a reasonably complete explanation of how to do so in the other threads where this question was asked.

Or you can set your current frame to the frame that you want and pull the settings from the object properties.