API is an acronym for “application program interface.” It’s a technical development environment that enables access to third party’s application or platform. An API also specifies how software components should interact. The most famous, and most often used by mobile developers, is Facebook’s API. It allows mobile developers limited access to the profile identity of Facebook members to verify identification on login. It also enable Facebook members to sign up for a third-party app like Candy Crush using their Facebook account. Facebook’s API also allows their own users to post content to their News Feed from third-party mobile applications they’re using. Like Facebook, Twitter has an API that can also be used by third-party mobile developers to identify their users on sign up and to enable users to post content easily from an app to their Twitter account.
In layman term, it's basically a collection of methods. As we know, in order to use any method we need to pass some arguments in most of the cases. Which, in turn, returns some results based upon the arguments passed. So is the case with APIs. We don't use APIs only for sign up or login but also for the interactions with databases. Say, I have an Android App and I want to use MySQL database for my app. I would love to have an API through which I can interact with my database for this App. Like, I just need to pass my values to a given method of the API and my data will be saved into the database. On the other hand, we can also fetch the data from the MySQL database by calling the appropriate method with the correct request parameter. If you are writing an API then it's a good practice to perform all the validation or verification by your end as well. It will prevent your database from storing any irrelevant entries in the database.