How to Build a REST API Using Flask and SQLAlchemy

Anju Mercian
WWCode Python
Published in
7 min readJul 21, 2022

--

Learn how to build a RESTful API to generate quotes using Flask and SQLAlchemy.

Photo by Austin Poon on Unsplash

Motivation

While designing my personal portfolio website, an idea stuck onto my thoughts: to have motivational quotes displayed on top of the page and update periodically. It seemed like a useful idea to learn and showcase my skills about building a REST API.

This API is an interface between the database (where the quotes are stored) and the front end (where the quotes will be displayed).

In this article, learn the foundations of designing and building the API, as well as the design considerations made to make it robust.

The code can be found here.

This article will cover the following topics:

  1. What is an API? What are the benefits of using an API? What is a REST API?
  2. Technologies used in this project
  3. Design pattern used
  4. Error handling
  5. Authentication and authorization
  6. Deployment

Let’s begin...

Why develop an API?

While designing, I had three choices on how I wanted to display the quotes on the…

--

--

Anju Mercian
WWCode Python

ML and Data Enthusiast|Writing about my experience with learning ML/Data