Blender 2.8 How to edit via the Python API an action and change keyframes An object has an action in its animation data, how can I edit its keyframes? When I print the snippet below, I see that there are 8 entries in the dictionary of fcurves (I assume that they are three entries for translation, 3 for rotation (euler) and 3 for scale). How can I edit each specific channel of this action? For example, how do I update the translation for the keyframes for channel Z-axis?

&gt;&gt; for key, value in bpy.data.actions['ActionName'].fcurves.items():
...     print(key, value)
...     
0 &lt;bpy_struct, FCurve at 0x7f2299562788&gt;
1 &lt;bpy_struct, FCurve at 0x7f2299562c88&gt; 
2 &lt;bpy_struct, FCurve at 0x7f2299562b88&gt;
3 &lt;bpy_struct, FCurve at 0x7f2299562208&gt;
4 &lt;bpy_struct, FCurve at 0x7f2299562a88&gt;
5 &lt;bpy_struct, FCurve at 0x7f2299562f08&gt;
6 &lt;bpy_struct, FCurve at 0x7f2299562888&gt;
7 &lt;bpy_struct, FCurve at 0x7f2299562d08&gt;
8 &lt;bpy_struct, FCurve at 0x7f2299690088&gt;
The related answers (provided by @batFINGER) answered my question, but I provide here an example for completeness sake.

# Configuration
action_name = 'MyAction'
data_path = 'location'
index = 2                   # Z axis

# Find the appropriate action
action = bpy.data.actions.get(action_name)
if action:
    # From this action, retrieve the appropriate F-Curve
    fcurve = action.fcurves.find(data_path, index)
    if fcurve:
        # Iterate over all keyframes
        for kfp in fcurve.keyframe_points:
            # Print current keyframe info
            print('Frame = {:04}; Value = {}'.format(kfp.co[0], kfp.co[1]))
            # Change keyframe data
            # Push back in time by 2 frames
            kfp.co[0] += 2
            # Move F-Curve up by 1
            kpf.co[1] += 1