What is the correct 'data_path' to animate the colour of a Principled BSDF node with Python?
Keyframe the default value of the socket
Animating by keyframe  the base colour of the bsdf node
To the python console.
From material &quot;Material&quot; get the bsdf node
&gt;&gt;&gt; mat = D.materials['Material']
&gt;&gt;&gt; bsdf = mat.node_tree.nodes['Principled BSDF']

What color is it now?
&gt;&gt;&gt; bsdf.inputs['Base Color'].default_value
bpy.data.materials['Material'].node_tree.nodes[&quot;Principled BSDF&quot;].inputs[0].default_value

&gt;&gt;&gt; bsdf.inputs['Base Color'].default_value[:]
(0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0)

Make it red and insert a keyframe at frame 30
&gt;&gt;&gt; bsdf.inputs['Base Color'].default_value = (1, 0, 0, 1)
&gt;&gt;&gt; bsdf.inputs['Base Color'].keyframe_insert(&quot;default_value&quot;, frame=30)
True

Same for blue at frame 50
&gt;&gt;&gt; bsdf.inputs['Base Color'].default_value = (0,  0, 1, 1)
&gt;&gt;&gt; bsdf.inputs['Base Color'].keyframe_insert(&quot;default_value&quot;, frame=50)
True

True above is indicating the success of adding the keyframe.  To keyframe a single channel (r, g, b, a) -&gt; index 0, 1, 2, 3.  To keyframe just the green channel
input.keyframe_insert(&quot;default_value&quot;, index=1)

One material.
See this answer, https://blender.stackexchange.com/a/185314/15543
Could instead consider using one material and animate the object color.
ob.keyframe_insert(&quot;color&quot;, frame=33)