Regarding margin fetching in realtime

I wanted to fetch margins in real-time for F&O maybe using API. Is there any broker providing the same?