What is a REST API?

A web API (application programming interface) is an application dedicated to transferring data. Accessing a web API is the same as accessing any other web page via a URL. The difference is APIs aren’t easy for people to read. The data returned by an API is formatted for machines.

This is a great intro to REST APIs

The purpose of an API is to share data from one application to another. Web API data is commonly transferred in the JSON (Javascript Object Notation) format because “It is easy for humans to read and write” and “It is easy for machines to parse and generate.”

This is JSON data served by my Catbook Rails 5 API (https://github.com/cbohara/catbook_API)

Back in the day, it was a headache to figure out where data was located for different APIs. REST (representational state transfer) is a standard way to format your API so it is easy for one application to communicate with another. The table below is from the Rails documentation, and it does a great job outlining how RESTful applications should respond to different HTTP requests for different links. If you follow this format, you make it easy for other applications to know where the data in your API is. And the point of a web API is to share data.

http://guides.rubyonrails.org/routing.html

I wrote this quick post because it is hard to find a straightforward definition of REST APIs. If you want to learn how to build your own REST API, I would recommend you take the Udemy course REST APIs with Flask and Python.