Coding a REST API With Python

Eric Chi
The Startup
Published in
8 min readAug 31, 2020

--

Image made by the author.

Complete source code can be found here: https://github.com/ericjaychi/sample-rest-api

Before we go into building the actual application, we need to take a quick step back to understand at a very high level what a REST API is. Ironically, REST APIs are not something new. It has been around since the year 2000 but has been very popular recently with the rise of JavaScript libraries. If you are curious about all the specific details, I’ll let you go ahead and read about it on Google as I am not trying to bore you with all these crazy details.

At a very high level, REST APIs are a way for developers to pass data back and forth for an application. It uses the concept of CRUD (Create, Read, Update, Delete). CRUD operations are performed on a piece of data inside of a database but with REST APIs we use the verbs POST, GET, PUT, and DELETE instead.

With that all said, let's get into building the actual application! If none of this makes sense to you, then no worries, hopefully, the code will speak for itself as this tutorial is very straightforward. If you still have questions, then feel free to reach out in the responses below!

Table of Contents

  • Step 1: Installing Flask
  • Step 2: Setting up the Flask Application
  • Step 3: Starting the Flask…

--

--

Eric Chi
The Startup

Passion for learning, teaching, and helping others understand the world of software. Currently working @ Apple