GitLab is a great alternative to GitHub.
The feature list grows each week. GitLab offers unlimited private and public repositories on gitlab.com. GitLab can be installed locally on your own or self-managed servers in two different flavors - a free (CE) community edition and a paid (EE) enterprise edition. The community edition packs all features necessary for a successful management of your software development process. Features like SCM, Wiki, Issues, task, Jira integration, a CI runner, release management, big files in git, binary attachments (shared between SCM and CI - something like your portable JRE or mini Linux distribution image, etc.), etc. If it's still not enough then your hosted GitLab (CE) and (EE) as well as gitlab.com, offer a public REST API to read, update, insert, and delete data.