Explain It Like I'm 5: API

API is short for Application Programming Interface.

An interface is simply a predefined way to work with a tool. That tool can be a 3rd party service like Facebook, a library like ReactJS, or your own internal service.

Imagine you want to display your recent tweets on a website. Your first might be to copy the last few tweets into your code. Nice! But now every time you write a tweet, you have to copy the tweet into your website. Damn! Twitter's API solves this by giving you a way to work with their database without needing to work within their application code. Using their API, you can fetch your recent tweets, retrieve them as data, and display them however you like.

Real-world examples:

  • Facebook API - The way to get data from Facebook like users, friends, likes.
  • Twitter API - The way to get data from Twitter like tweets, profiles, followers.
  • Stripe API - The way to handle payments using the Stripe service.
  • REST API - An API designed to creove consistency for common operations like create, read, update, and destroy.

See the entire series.