QUANTRIUM GUIDES

Creating a Hello World API using Swagger UI and Python

Getting started with your first Swagger UI document

Bhargav Sridhar
Quantrium.ai
Published in
5 min readJul 30, 2021

--

Swagger is a web-based API documentation framework. It is used to create interactive documents for APIs which are built to serve a specific purpose. Swagger UI documents enjoy many advantages when compared to other document types:

  • It’s open-source
  • Enable you to create and share API documentation
  • Allows you to test APIs

In this article, I explain step-by-step process for creating a Swagger UI document to get a “Hello World” response through an API which is built in Flask REST API framework. I will use Python and YAML files to implement Swagger UI and API with explanation.

As a pre-requisite, you are expected to have a basic understanding on Flask APIs and how they work. If you need to gain a basic understanding on Flask APIs, you can refer to the official Flask RESTful API documentation.

Steps to Create a Swagger UI Document

We will follow the following steps to build a Swagger UI document for an API function:

  • First, we will create the API using Flask web API framework.

--

--

Bhargav Sridhar
Quantrium.ai

Making AI / Data Science / Machine Learning basic skills in the near future.