Checking firewall events via API
I want to check firewall events using the api (the ones that appear on the security tab), I am mainly interested in the number of events in a given time, how could I do this and what is the minimum time period I can check?