Insert keyframe to object's Offset Factor Python API
Keyframe the constraint &quot;object&quot;
Same as [obj.keyframe_insert, bpy.data.particles[&quot;ParticleSettings&quot;].lifetime]; how to insert keyframe to an existed particle setting, e.g lifetime only your object of concern to keyframe is the follow path constraint
Python console code
Object has a follow path constraint with default name
&gt;&gt;&gt; ob = C.object
&gt;&gt;&gt; ob.constraints['Follow Path']
bpy.data.objects['Eye.001'].constraints[&quot;Follow Path&quot;]

Alternatively, all constraints on object of type follow path in a list
&gt;&gt;&gt; constraints = [c for c in ob.constraints if c.type == 'FOLLOW_PATH']
&gt;&gt;&gt; constraints
[bpy.data.objects['Eye.001'].constraints[&quot;Follow Path&quot;]]

Getting by name, will be None if there is no constraint named &quot;Follow Path&quot;
&gt;&gt;&gt; con = ob.constraints.get(&quot;Follow Path&quot;)

Ok, set and insert a keyframe for offset_factor at frame 1
&gt;&gt;&gt; if con:
...     con.offset_factor = 0.0
...     con.keyframe_insert(&quot;offset_factor&quot;, frame=1)
...     
True

True indicating the success of inserting the keyframe