You don' t say if you use FortiManager. If you do, we have both an XML and a JSON API that can be used to accomplish those things. You can speak to your Fortinet rep about Fortinet Developer Network which is a subscription giving you access to documentation and code examples, as well as a special separate forums for this express purpose of collaborating with others.
If you mean directly to the FortiGate, there is no such API. However, it is certainly possible to script an SSH session from a remote box and scrape the information you are looking for and process it.
Cheers!
--
Sean Toomey, CISSP FCNSP
Consulting Security Engineer (CSE)
FORTINET— High Performance Network Security