Defacto2 has a downloadable daily dump of the MySQL 5.7 database.
Currently, the source code to Defacto2 is not open, but the medium-term goal is to have it publically accessible on GitHub.
Defacto2 has a GitHub page where you can find notes and wikis for Defacto2 and repositories for historical scene websites. As well the defacto2.net repository where you can submit issues and feature requests for this website.
For clarification there is no API for Defacto2.