Is there any direct API which provides Call and SMS logs details which I can use in my application?

Or otherwise is there any other way to achieve the task?