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.”

Image for post
Image for post
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.

Image for post
Image for post

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store