Finding active keyframe in Python

Hi everyone. I’m new to coding, so I apologise if my question sounds dumb.
In my script I need to get frame number and value of active keyframe in the Graph Editor.
In API I found a way to address all the selected keyframes but I can’t find anything regarding active one.
So i tried to print coordinates of all selected keyframes, hoping that maybe active keyframe will be always listed first or last. But unfortunately they are displayed in chronological order.
I can’t find anyting about my problem on Google either.
Any help would be much appreciated!