need help with making a script for rendering of frames

Hello, I need some help

The script should render a sequence of frames in a given directory. heres what it do
1 first it needs an object (the object is an empty)
2 Then it rotate it in the z value with a given amount.
3 and then the directory to render the frames.
Which parts of the blender Api do i need for it, to speed the development?
Its a a script to render the frames of animation for a game.