Build APIs with Falcon in Python — All Essentials You Need

Learn a simple but efficient API framework in Python

Lynn G. Kwong
14 min readJul 11, 2021

Falcon is a WSGI library for building web APIs using the REST architectural style. Before we get started, let’s get familiar with two important terminologies, which can be mentioned in interviews and the Falcon documentation.

Photo by Erik van Dijk on Unsplash
  • WSGI — Web Server Gateway Interface. It is an interface specification by which web server and application communicate. A WSGI application is just a callable with a well-defined signature so that you can host the application with any web server that understands the WSGI protocol.
  • REST — REpresentational State Transfer. It is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. Any web service that obeys the REST constraints is informally described as RESTful.

This article covers the traditional synchronous flavor of Falcon using the WSGI protocol. Since this is a practice course for coding rather than a theoretical one, we won’t introduce any more abstract concepts. Now let’s get our hands dirty and start writing our first API with Falcon.

Before we get started, we need to install Falcon and other libraries needed for development. It’s better to install all the…

--

--

Lynn G. Kwong

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.