blender api - get current location and rotation of camera tracking an object
Use the matrices

Use the cameras matrices to get the visual transform.  For global transform use ob.matrix_world

&gt;&gt;&gt; C.scene.camera.matrix_world.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')

&gt;&gt;&gt; C.scene.camera.matrix_local.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')


The matrix can be decomposed to location, rotation and scale. The quaternion rotation can be converted to Euler if need be.

&gt;&gt;&gt; loc, rot, scale = C.scene.camera.matrix_world.decompose()
&gt;&gt;&gt; rot
Quaternion((0.7804827094078064, 0.483536034822464, 0.20870360732078552, 0.33687159419059753))

&gt;&gt;&gt; rot.to_euler()
Euler((1.1093189716339111, 4.011331711240018e-09, 0.8149281740188599), 'XYZ')