An API (Application Programming Interface) is essentially a layer between your database and the User Interface (UI). The API usually contains all of business logic and controls you need for your data so your UI doesn’t need to worry about that stuff as much.
Why should you build your API before you build your web project?
Scaling. It is easier to scale up when you’re not concerned with the interface, only the data.
Alternative Interfaces. Speaking of interfaces, there are plenty of interfaces besides your website. Consider mobile applications, platforms like Google+ or Salesforce or even pure database connectivity.
The Future. Who knows what changes will occur as technology constantly evolves and changes. Five years ago, accessing the web on your phone was difficult. Now more people have more computing power in their pockets than a laptop from seven years ago. By building an API first, you’ll be laying a foundation down to future-proof your data.
Separation of concerns. Let the designers and developers worry about the specifics of building a website or an app. Let the business-minded folk figure out how to manage and present the data.
Programming-language-agnosticism. Once you build an API, you can make your iOS app in Objective-C, your Android app in Java and your website using Django Framework and they can all consume the same API. If you want to switch your website to Ruby on Rails, it’s easy to do.
Here at Lift, we promote the idea of building your API first. It lets us take care of all of the above.