Is there any API for taking web browser screenshots?

I want to know whether there is any API available for taking web browser screenshots or not.