An Application Programming Interface (API) is a set of abstractions that makes complex programming tasks easier. This might be a browser API that provides deeper access to the browser and its surrounding environment. It could also be a third-party API that lets you access data from another service in your own application.

  1. Browser APIs
    1. The Document Object Model
    2. The Fetch API
    3. The Web Storage API
  2. Third-party APIs
    1. The Twitter Developer Platform
    2. The Google Maps Platform
    3. The New York Times Developer Network
  3. More information

Browser APIs

Browser APIs provide deeper access to the browser and its surrounding environment. There are many, but here is a few of the most common.

The Document Object Model

The Document Object Model (DOM) has to be the most common browser API. It's a representation of the HTML document that you can manipulate with JavaScript. For example, if you've ever:

  • Selected an element on the page
  • Added a class to an element
  • Written code that responds to user input (events)

Then you've worked with the DOM.

Learn more: What is the DOM?

The Fetch API

The Fetch API provides functionality for fetching data across the network. For example, you might use it to fetch data from an external JSON file. You could then use this data in your application. The XMLHttpRequest interface is older, but it provides similar functionality.

The Web Storage API

Before the Web Storage API, there were only cookies. Nowadays, developers are increasingly using localStorage and sessionStorage to manage data in their applications. The Web Storage API is powerful and easier to work with than cookies.

Third-party APIs

Third-party APIs let you access data from another service in your own application. There could be an infinite number of these, but here are some popular services.

The Twitter Developer Platform

The Twitter Developer Platform provides a suite of APIs that let you access Twitter data programmatically. For example, you can use Twitter for Websites to display a live feed of Tweets on your website.

The Google Maps Platform

The Google Maps Platform offers a set of APIs for adding powerful mapping features to your application. For example, you might use it to add 360° Street View imagery to your website.

The New York Times Developer Network

The New York Times Developer Network is a set of APIs that allow you to use data from The New York Times in your own application. For example, you can use the Top Stories API to create a live feed of articles from The New York Times.

View a demo of the Top Stories API.

More information

For more information, check out the introduction to web APIs in the MDN Web Docs. It was a really helpful resource when writing this post.

My friend Chris Ferdinandi also wrote a guide called APIs and Asynchronous JS which should be helpful.