how to get a list of all FCurves in a scene
F-Curves via Actions

You can use bpy.data.actions to get a list of all F-Curves in the scene, but actions are not associated with objects, scenes or nodes:

for i in bpy.data.actions:
    print (i.name)
    for fcu in i.fcurves:
        print (fcu)
        for keyframe in fcu.keyframe_points:
            x, y = keyframe.co
            print (x,y)


It's only possible to check if the actual object is associated with an action via animation_data in a reverse operation with Object.animation_data.action to get something like: bpy.data.actions['Action']. Another option is to check animation_data.action.name.



If you need to know which F-Curve is applied to objects or nodes in your scene, the only way is to use animation_data and iterate through all components like:


Object.animation_data - F-Curves of an Object
Scene.animation_data - F-Curves of the Scene
Material.animation_data - F-Curves of a Material
...


F-Curves of an Object

import bpy
import math

obj = bpy.context.active_object
keyframes = []

anim = obj.animation_data
if anim is not None and anim.action is not None:
    for fcu in anim.action.fcurves:
        print (fcu)
        for keyframe in fcu.keyframe_points:
            x, y = keyframe.co
            print (x,y)
            if x not in keyframes:
                keyframes.append((math.ceil(x)))


To get the F-Curves of all objects in the scene you can use bpy.data.objects and iterate through the objects in the scene like:

object_list = bpy.data.objects

for i in object_list:
    anim = i.animation_data
    if anim is not None and anim.action is not None:
        for fcu in anim.action.fcurves:
            print (fcu)


F-Curves of a Node Shader

obj = bpy.context.object

shader = obj.data.materials[0].node_tree
anim_data = shader.animation_data

for fcu in anim_data.action.fcurves:
    print (fcu)
    for keyframe in fcu.keyframe_points:
        x, y = keyframe.co
        print (x,y)