API, AJAX, JSON, REST, CRUD… what are all these acronyms and what do they have to do with each other?

API stands for Application Program Interface. An API provides a way for one program to interact with another program over HTTP. As mentioned in the previous post, HTTP, or hypertext transfer protocol, is what allows browser to communicate with web applications. Many web applications use APIs to retrieve data from another application. For example, a weather application may pull data from an API provided by an organization that makes weather predictions.

REST stands for representational state transfer and is an architectural style for designing APIs. One principle of REST is to use HTTP verbs. These verbs reference to how an API is exchanging information with an application. These methods correspond to CRUD operations. CRUD stands for Create-Read-Update-Delete.

GET – Retrieves an item (Read)
POST – Creates a new item (Create)
PUT – Creates or updates a new item (Update)
DELETE – Removes an item (Delete)

Another principle of REST is that the data is transfered through JSON or XML files. You can see examples of these file types here.

A common way to call an API is through an AJAX request in a Javascript application. AJAX stands for Asynchronous Javascript and XML.

Given a GET request, an API may retrieve information from a database, convert that information to JSON, and send that back to the client. Javascript can then be used to build out HTML using the data from the JSON object.

AJAX is done client-side and it is much quicker than calling information through a web application on the server. Since it is client-side, it will also load information without refreshing the entire page.

Hopefully this post sheds some light on some of the confusing acronyms that get tossed around in web development. If you don’t entirely understand this post, don’t worry. As you continue to learn web development and build applications, the concepts discussed here will become clearer.

Further Resources:

Working with Web APIs – A free online book by Launch School.

What is an API? In English, please. – An article by freeCodeCamp.

What the CRUD is an API?

Leave a Reply

Your email address will not be published.